mafw.steering_gui.main_window
Main window orchestrator for the steering GUI layout.
- Author:
Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)
- Description:
Build the menu, splitter, tree, stacked editors, and status bar required by the GUI.
Classes
|
Compose the steering GUI main window without executing controller logic. |
- class mafw.steering_gui.main_window.MainWindow(controller: SteeringController | None = None, parent: QWidget | None = None, *, startup_file: Path | None = None, recent_files: RecentFileService | None = None)[source]
Bases:
QMainWindowCompose the steering GUI main window without executing controller logic.
- static _normalize_text(value: str) str | None[source]
Treat empty or whitespace-only strings as unset.
- _confirm_discard() bool[source]
Ask whether the user wants to save/discard/cancel when the document is dirty.
- _confirm_unsaved_changes(action: str) bool[source]
Ask whether to save, discard, or cancel before replacing the current document.
- _create_actions() None[source]
Declare the main window actions and store them for later menu wiring.
- _create_group(parent_group: str | None) str | None[source]
Create a new group and attach it to the requested parent list.
Compose the menu bar using the actions previously created.
- _display_section(section: str) None[source]
Show the editor that corresponds to the selected tree section.
- _export_filters(*, strip: bool = False) None[source]
Export current filters, optionally stripping them after a successful write.
- _finalize_connection_test(result: object | None = None) None[source]
Reset worker references and re-enable the test button.
- _load_file(path: Path) bool[source]
Confirm replacement, load a steering file, and record it on success.
- _load_startup_file() None[source]
Load a requested startup file after processor plugins are available.
- _on_add_processor_requested() None[source]
Open the Add Processor dialog and append selections to the pipeline.
- _on_connection_test_failure(exc: Exception) None[source]
Report a failure with the provided exception message.
- _on_connection_test_success(_: object) None[source]
Report a successful connection and reset the UI state.
- _on_database_configuration_changed(data: dict[str, Any]) None[source]
Commit every database widget change back to the controller.
- _on_dirty_changed(dirty: bool) None[source]
Update the window title when the controller dirty state changes.
- _on_env_files_changed(paths: list[str]) None[source]
Update the steering path list and refresh its safe validation status.
- _on_group_add_group_requested() None[source]
Create a new group nested within the currently edited group.
- _on_group_description_changed(description: str) None[source]
Update the description for the currently edited group.
- _on_group_move_requested(direction: str, items: list[PipelineItem]) None[source]
Reorder items inside the currently edited group.
- _on_group_remove_requested(items: list[PipelineItem]) None[source]
Remove items from the currently edited group.
- _on_pipeline_edit_requested(item: PipelineItem) None[source]
Switch to the appropriate placeholder editor for the selected item.
- _on_pipeline_move_requested(direction: str, items: list[PipelineItem]) None[source]
Reorder the selected items within the top-level pipeline list.
- _on_pipeline_ready(pipeline: ProcessorPipeline) None[source]
Update the tree and editors with the built pipeline.
- _on_pipeline_remove_requested(items: list[PipelineItem]) None[source]
Remove selected items from the top-level processors_to_run list.
- _on_pipeline_selection_changed(items: list[PipelineItem]) None[source]
Switch editors when a pipeline item is selected in the tree.
- _on_plugin_load_failure(exc: Exception) None[source]
Report plugin loading failures to the user and refresh the UI.
- _on_storage_enabled_changed(enabled: bool) None[source]
Commit storage section enablement and refresh validation feedback.
- _on_storage_volume_added(name: str, configuration: dict[str, Any]) None[source]
Add a storage volume and refresh dependent editor choices.
- _on_storage_volume_changed(name: str, changes: dict[str, Any]) None[source]
Commit edited storage fields through controller mutation tracking.
- _on_storage_volumes_removed(names: list[str]) None[source]
Remove selected storage volumes as a single UI action.
- _on_test_connection_requested(config: dict[str, Any]) None[source]
Start an asynchronous database connection test and update the UI.
- _on_ui_interface_changed(interface: str) None[source]
Tell the controller to use the selected UI interface.
- _on_validation_level_changed(level: ValidationLevel | None) None[source]
Tell the controller about the user-selected validation level.
- _perform_save_as() bool[source]
Prompt the user for a location and persist the current builder there.
- _populate_from_model() None[source]
Refresh the tree and metadata editor from the controller model.
- _refresh_database_editor() None[source]
Push the controller database metadata into the database editor.
- _refresh_metadata_summary() None[source]
Update the metadata view with configured and available plugin data.
Rebuild recent-file actions from the reusable history service.
- _refresh_pipeline_after_change(select_name: str | None = None) None[source]
Rebuild the pipeline and refresh dependent widgets.
- _refresh_storage_editor() None[source]
Refresh storage controls and validation messages from the controller.
- _refresh_title_from_controller(dirty: bool | None = None) None[source]
Compose the window title with the associated file and dirty marker.
- _refresh_ui_editor() None[source]
Update the UI combobox once plugin metadata or configuration changes.
- _reload_environment() None[source]
Refresh dotenv values and show only safe path/status information.
- _save_file() None[source]
Action handler that keeps the QAction signature while delegating to DoSave.
- _set_test_button_enabled(enabled: bool) None[source]
Toggle the database editor test button when the feature is active.
- _start_connection_test_worker(task: Callable[[], bool]) None[source]
Start the worker via a thread pool and bind completion callbacks.
- mafw.steering_gui.main_window._DEFAULT_SAVE_NAME = 'mysteerfile.toml'
Default suggestion when the user invokes Save As.