-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul of models, views, data management #3497
Commits on May 17, 2020
-
Models: Persistence enhancements
- Move ModelRefreshed signal to outer class (now a QObject subclass) - Move mimeData() to proxy model, where it needs to be for views - (This allowed dropping the inner Files and Transitions model classes entirely, replaced with a stock `QStandardItemModel`. All of the special logic is in the custom proxy model class. - Add a persistent QItemSelectionModel to all three models, shared by both views. Selection is no longer lost when switching view. - Track the currently visible view for 'foo' (either fooListView or fooTreeView) in main_window, access as `get_app().window.fooView`
Configuration menu - View commit details
-
Copy full SHA for 1d3a4b6 - Browse repository at this point
Copy the full SHA 1d3a4b6View commit details -
Eliminate main_window's self.selected_files list
- Selection is now managed completely in the Files model (outer class), directly from the persistent QItemSelectionModel. - Helper functions in both files_model and main_window ease transition - updateSelection() is also gone, as there's no selection cache. Selection data always comes live from the selection model. - Also greatly simplify drag-and-drop code, using proxy & selection models
Configuration menu - View commit details
-
Copy full SHA for 55b9468 - Browse repository at this point
Copy the full SHA 55b9468View commit details -
Files: Move add_file, get_image_seq() into model
Major overhaul to the code for adding items to the file model. - `add_file()` is gone from both views - files_model's new `add_files()` (<= note the plural) takes a list of paths, instead of churning over them one at a time - Image sequence management is also consolidated into files_model - Two helper methods in main_window handle communication with the user (in the form of popup questions / message boxes) for `add_files()` Also, QPersistentModelIndex()es are stored in the custom model outer classes' in-memory hashes, and can be used to locate a given item's row for later modification (or deletion, specifically). No more having to iterate over all the items to find one! (This is done for Transitions as well, though it's currently not used there.)
Configuration menu - View commit details
-
Copy full SHA for 1a996a5 - Browse repository at this point
Copy the full SHA 1a996a5View commit details
Commits on May 19, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 02ee15a - Browse repository at this point
Copy the full SHA 02ee15aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 57d3229 - Browse repository at this point
Copy the full SHA 57d3229View commit details -
Configuration menu - View commit details
-
Copy full SHA for ece947b - Browse repository at this point
Copy the full SHA ece947bView commit details -
Properties: Use main data models for context menu
- properties_tabelview will pull data directly from files_model and transition_model on the get_app().window object. - A connection to both models' ModelRefreshed signals that forces a menu data reset replaces the previous update_model() calls
Configuration menu - View commit details
-
Copy full SHA for 424f56e - Browse repository at this point
Copy the full SHA 424f56eView commit details -
Add --test-models flag to launcher
- When passed, OpenShot will attempt to load QAbstractItemModelTester into the files, emoji, effects, and transition models (base and all proxy models). This requires Qt 5.11 or higher. - By default, if the environment variable `QT_LOGGING_RULES` is not set, it will be set to "qt.modeltest.debug=true", which causes quite a lot of console spew. It can be set to something less verbose before launching OpenShot, e.g. "qt.modeltest.warning=true".
Configuration menu - View commit details
-
Copy full SHA for 726e5d3 - Browse repository at this point
Copy the full SHA 726e5d3View commit details
Commits on May 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for dc18a20 - Browse repository at this point
Copy the full SHA dc18a20View commit details -
Titles: Use files model add_files(), new counter
- Switch from TitleFileName-N for numbered filenames, to Windows-esque "TitleFileName (N)", because the previous value would trigger the image sequence import logic
Configuration menu - View commit details
-
Copy full SHA for a9c40d1 - Browse repository at this point
Copy the full SHA a9c40d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for da09062 - Browse repository at this point
Copy the full SHA da09062View commit details