- Replaced hardcoded tooltips for the log and about buttons with references
to the 'tooltips' dictionary passed during MenuBar initialization.
- This further enhances the flexibility and translatability of the MenuBar.
- Updated MenuBar to use the new GiteaUpdater class for update checks.
- Modified __init__ to accept gitea_api_url and a dictionary of tooltips,
making the MenuBar more project-independent and translatable.
- Refactored check_for_updates and update_ui_for_update to handle the
new GiteaUpdater's return values (new version string or None) and
new states (DISABLED, ERROR).
- Improved updater logic to prevent execution when no updates are available
or an error occurred.
- Corrected about dialog icon parameter.
Die
Komponenten des CustomFileDialog wurden aus einem separaten Repository importiert
und in ein eigenes Verzeichnis verschoben. Die Test-Datei 'mainwindow.py' wurde
entfernt. 'animated_icon.py' wurde als gemeinsam genutzte Komponente im
Stammverzeichnis platziert.
The `CustomFileDialog` class had become too large and complex, making it difficult to maintain.
This change refactors the monolithic class into several specialized manager classes, each responsible for a specific area of concern:
- `SettingsDialog`: Moved to its own file, `cfd_settings_dialog.py`.
- `FileOperationsManager`: Handles file/folder creation, deletion, and renaming.
- `SearchManager`: Encapsulates all search-related logic.
- `NavigationManager`: Manages directory navigation and history.
- `ViewManager`: Controls the rendering of file and folder views.
The main `CustomFileDialog` class has been streamlined and now acts as an orchestrator for these managers. This improves readability, separation of concerns, and the overall maintainability of the code.
Modified the button layout methods to place the primary action button (Open/Save) at the top and the Cancel button at the bottom of their respective containers.
This creates a more consistent and predictable user experience across all dialog modes and view settings.
Further refactored the _setup_sidebar method by breaking it down into smaller, more focused methods: _setup_sidebar_bookmarks, _setup_sidebar_devices, and _setup_sidebar_storage.
This completes the modularization of the UI setup, resulting in a highly organized and maintainable WidgetManager class.
Further refactored the _setup_sidebar method by breaking it down into smaller, more focused methods: _setup_sidebar_bookmarks, _setup_sidebar_devices, and _setup_sidebar_storage.
This completes the modularization of the UI setup, resulting in a highly organized and maintainable WidgetManager class.
Further refactored the WidgetManager class by extracting the setup logic for the top bar and the sidebar into their own dedicated methods: _setup_top_bar and _setup_sidebar.
This simplifies the main setup_widgets method into a high-level blueprint, significantly improving code organization and readability.
To improve readability and reduce the size of the main setup_widgets method, the logic for creating and laying out all widgets in the bottom bar has been extracted into a new _setup_bottom_bar method.