Commit 14bde93
authored
feat: better config group editor widget (#500)
* wip
* use dev prop table
* feat: enhance ConfigTreeModel to support settings and update header data
* fix init
* fix bug
* two way updates
* feat: add custom delegate for Setting value editing in ConfigTreeModel
* refactor: improve duplicate group handling and name validation in ConfigTreeModel
* move example
* move example
* updates
* feat: enhance ConfigGroupsEditor with tree view and layout adjustments~
* breaking into two
* feat: restructure configuration editor and update device property handling
* future import
* docs
* feat: add methods to retrieve QModelIndex for groups and presets in QConfigGroupsModel
fix: update icon names for AutoFocus and Magnifier device types
refactor: enhance PropertyValueDelegate and ConfigGroupsEditor for better structure and functionality
* wip: preset-table
* better table
* better table
* more improvements
* more improvements
* starting tests
* remove config props
* move file
* remove file
* feat: Introduce QConfigGroupsModel for managing configuration groups and presets
- Added QConfigGroupsModel to handle a three-level model structure for configuration groups, presets, and settings.
- Implemented _Node class to represent tree nodes for groups, presets, and settings.
- Enhanced data handling and editing capabilities within the model.
- Updated related views and widgets to utilize the new model structure.
- Refactored existing code to improve clarity and maintainability, including renaming and restructuring imports.
- Adjusted tests to align with the new model and property handling.
* feat: Add QConfigGroupsModel and related functionality for configuration management
* tmp
* wip
* wip
* Refactor configuration model and tree structure
- Introduced a new base tree model (_BaseTreeModel) to handle tree structures for configuration groups and presets.
- Created a new module (_py_config_model) to define configuration-related data models including Device, DevicePropertySetting, ConfigPreset, and ConfigGroup.
- Implemented a QConfigGroupsModel to manage the interaction between the UI and the configuration data.
- Removed the old base tree model implementation from the config_presets module.
- Updated various views and widgets to utilize the new model structure, ensuring proper data handling and display.
- Adjusted tests to reflect the new model organization and ensure functionality remains intact.
* feat: Implement ConfigGroupPivotModel and update related references in the project
* fix test
* refactor: Consolidate imports and move core functions to a new module
* fixes
* feat: Enhance device property management by adding QDevicePropertyModel and integrating it into the ConfigGroupsEditor
* tmp models
* tmp models
* add more example
* remove
* better resizing
* Refactor and enhance configuration presets management
- Removed the obsolete FlattenProxyModel class and its demo implementation from _flat_chatgpt.py.
- Updated QDevicePropertyModel to improve type hinting in the data method.
- Added GroupPresetSelector to manage group and preset selections with a unified interface.
- Refactored ConfigGroupsEditor to utilize GroupPresetSelector for better organization and functionality.
- Improved layout handling and selection synchronization between group and preset views.
- Enhanced DeviceTypeFilter to ensure proper return types in filter methods.
* good selection sync
* activate buttons
* better icons
* fix delegate
* Enhance ConfigGroupsEditor layout and add persistent editor functionality
* good flat
* good flat model
* wip
* less code
* moew
* refactor: replace FlattenModel with TreeFlatteningProxy for improved tree model handling
* Refactor configuration presets and device property selection
- Removed the unused ConfigGroupsEditor import from __init__.py and updated the import for ConfigGroupsEditor from the correct module.
- Deleted the _config_views.py file, which contained the ConfigGroupsEditor class and related functionality, to streamline the codebase.
- Refactored the DevicePropertySelector to utilize a new DeviceTypeFilter class for filtering device types, improving code organization and readability.
- Introduced a new _device_type_filter_proxy.py file containing the DeviceTypeFilter class, which manages filtering based on allowed device types and property flags.
- Updated the DevicePropertySelector to connect the new filtering logic to the UI components, ensuring proper functionality with the new structure.
* remove flattening
* feat: add help dialog and HTML documentation for configuration groups editor
refactor: improve icon handling and toolbar actions in config groups editor
refactor: enhance QConfigGroupsModel to manage channel groups
refactor: streamline device property selector and view mode toggling
* fix persistent
* remove example
* fix visibility
* refactor: update icon sizes and layout margins in configuration editors
* feat: add preset property update functionality and enhance device property selector
* refactor: streamline data change handling and improve rebuild logic in ConfigGroupPivotModel
* feat: add system group and startup/shutdown preset icons; enhance property handling in models
* fix tests
* undo redo 1
* undo redo 2
* undo redo 3
* feat: add name change validation for group and preset renaming; improve error handling
* fix undo redo
* wip
* wip
* Merge branch 'main' into qconfig-again
* lots of changes
* prevent use-after-free bug
* get rid of local pymmcore-plus install
* cleaner node registry, less error prone
* don't use closure
* refactor: streamline imports and enhance ConfigGroupsEditor functionality
- Simplified import of ConfigGroupsEditor in config_groups_editor.py
- Added resizing to ConfigGroupsEditor instance
- Updated method docstrings for clarity in GroupsPresetFinder
- Enhanced device property selector with new actions for checking/unchecking all devices
- Improved context menu handling in PropertySettingDelegate
* refactor: improve model change handling and streamline toolbar action setup
* fix import
* tests
* fixes
* feat: connect tree selection changes to update toolbar actions in ConfigGroupsEditor
* feat: implement update preset properties command and enhance undo/redo functionality
* feat: enhance undo/redo functionality and improve command structure in ConfigGroupsEditor
* feat: update undo/redo actions to be icon-only with tooltips and improve delegate setup for group/preset lists
* feat: update edit properties action enabling logic to use current group index
* feat: enhance view switching by adding focus and selection sync between column and tree views
* feat: enable dynamic configuration updates based on command line argument
* feat: improve navigation in ConfigGroupsEditor by expanding tree view on selection
* feat: simplify preset list model handling in GroupsPresetFinder
* feat: preserve focus during selection changes in ConfigGroupsEditor and ConfigPresetsTableView
* before losing persistent editors
* feat: enhance property setting editor with control-type classification and improved event handling
* feat: refactor PropertySettingDelegate to improve control type handling and painting logic
* feat: add property type icons and improve icon handling in device property model
* feat: improve table selection synchronization and update transpose action handling
* feat: enhance selection behavior in ConfigPresetsTableView for transposed views
* feat: enhance multi-selection handling in ConfigPresetsTableView and GroupsPresetFinder
* feat: refactor ConfigGroupsEditor to streamline creation and update from core
- Updated `create_from_core` method to include `load_configs` parameter for better control over configuration loading.
- Modified `update_from_core` method to default `update_configs` to False, enhancing flexibility.
- Adjusted test cases to reflect changes in the `ConfigGroupsEditor` initialization and behavior.
- Improved test coverage for group and preset operations, including undo functionality and selection synchronization.
* feat: update import statements to include GroupsPresetFinder in test_config_groups_widgets
* feat: add 'Set Channel Group' action to ConfigEditorToolbar
* feat: implement node registry cleanup on row removal and enhance undo delegate functionality
* feat: comment out keyPressEvent handling and skip corresponding test
* refactor: clean up imports and improve readability in config presets views
* feat: implement undo macro context manager for batch undo operations
* refactor: simplify view mode toggling and clean up unused code in DevicePropertySelector
* refactor: standardize parameters in command constructors for consistency
* refactor: improve context menu testing by subclassing QMenu for exec method1 parent dc48564 commit 14bde93
33 files changed
Lines changed: 5478 additions & 266 deletions
File tree
- examples
- src/pymmcore_widgets
- _help
- _models
- config_presets
- _views
- device_properties
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
32 | 40 | | |
33 | 41 | | |
| |||
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
70 | 100 | | |
71 | 101 | | |
72 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
108 | 118 | | |
109 | 119 | | |
110 | 120 | | |
| |||
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
120 | 154 | | |
121 | 155 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
130 | 160 | | |
131 | 161 | | |
132 | 162 | | |
| |||
143 | 173 | | |
144 | 174 | | |
145 | 175 | | |
146 | | - | |
| 176 | + | |
| 177 | + | |
147 | 178 | | |
148 | 179 | | |
149 | 180 | | |
| |||
167 | 198 | | |
168 | 199 | | |
169 | 200 | | |
170 | | - | |
| 201 | + | |
0 commit comments