2.5 KiB
GUI Preset Selection Plan
Objective
Modify the GUI so that no preset is selected by default, and the preview table is only populated after the user explicitly selects a preset. This aims to prevent accidental processing with an unintended preset and clearly indicate to the user that a preset selection is required for preview.
Plan
-
Modify
gui/main_window.py:- Remove the logic that selects a default preset during initialization.
- Initialize the preview table to display the text "please select a preset".
- Disable the mechanism that triggers the
PredictionHandlerfor preview generation until a preset is selected. - Update the slot connected to the preset selection signal:
- When a preset is selected, clear the placeholder text and enable the preview generation mechanism.
- Pass the selected preset configuration to the
PredictionHandler. - Trigger the
PredictionHandlerto generate and display the preview.
- (Optional but recommended) Add logic to handle the deselection of a preset, which should clear the preview table and display the "please select a preset" text again, and disable preview generation.
-
Review
gui/prediction_handler.py:- Verify that the
PredictionHandler's methods that generate predictions (get_detailed_file_predictions) correctly handle being called only when a valid preset is provided. No major changes are expected here, but it's good practice to confirm.
- Verify that the
-
Update Preview Table Handling (
gui/preview_table_model.pyandgui/main_window.py):- Ensure the
PreviewTableModelcan gracefully handle having no data when no preset is selected. - In
gui/main_window.py, configure theQTableViewor its parent widget to display the placeholder text "please select a preset" when the model is empty or no preset is active.
- Ensure the
Data Flow Change
The current data flow for preview generation is roughly: Initialization -> Default Preset Loaded -> Trigger PredictionHandler -> Update Preview Table
The proposed data flow would be: Initialization -> No Preset Selected -> Preview Table Empty/Placeholder -> User Selects Preset -> Trigger PredictionHandler with Selected Preset -> Update Preview Table
graph TD
A[GUI Initialization] --> B{Is a Preset Selected?};
B -- Yes (Current) --> C[Load Default Preset];
B -- No (Proposed) --> D[Preview Table Empty/Placeholder];
C --> E[Trigger PredictionHandler];
D --> F[User Selects Preset];
F --> E;
E --> G[Update Preview Table];