2.3 KiB
2.3 KiB
GUI Enhancement Plan
Objective
Implement two new features in the Graphical User Interface (GUI) of the Asset Processor Tool:
- Automatically switch the preview to "simple view" when more than 10 input files (ZIPs or folders) are added to the queue.
- Remove the specific visual area labeled "Drag and drop folders here" while keeping the drag-and-drop functionality active for the main processing panel.
Implementation Plan
The changes will be made in the gui/main_window.py file.
-
Implement automatic preview switch:
- Locate the
add_input_pathsmethod. - After adding the
newly_added_pathstoself.current_asset_paths, check the total number of items inself.current_asset_paths. - If the count is greater than 10, programmatically set the state of the "Disable Detailed Preview" menu action (
self.toggle_preview_action) tochecked=True. This will automatically trigger theupdate_previewmethod, which will then render the simple list view.
- Locate the
-
Remove the "Drag and drop folders here" visual area:
- Locate the
setup_main_panel_uimethod. - Find the creation of the
self.drag_drop_areaQFrame and its associated QLabel (drag_drop_label). - Add a line after the creation of
self.drag_drop_areato hide this widget (self.drag_drop_area.setVisible(False)). This will remove the visual box and label while keeping the drag-and-drop functionality enabled for the main window.
- Locate the
Workflow Diagram
graph TD
A[User drops files/folders] --> B{Call add_input_paths}
B --> C[Add paths to self.current_asset_paths]
C --> D{Count items in self.current_asset_paths}
D{Count > 10?} -->|Yes| E[Set toggle_preview_action.setChecked(True)]
D{Count > 10?} -->|No| F[Keep current preview state]
E --> G[update_preview triggered]
F --> G[update_preview triggered]
G --> H{Check toggle_preview_action state}
H{Checked (Simple)?} -->|Yes| I[Display simple list in preview_table]
H{Checked (Simple)?} -->|No| J[Run PredictionHandler for detailed preview]
J --> K[Display detailed results in preview_table]
L[GUI Initialization] --> M[Call setup_main_panel_ui]
M --> N[Create drag_drop_area QFrame]
N --> O[Hide drag_drop_area QFrame]
O --> P[Main window accepts drops]
P --> B