mafw.steering_gui.views

Placeholder package for steering GUI views while the GUI is being scaffolded.

Author:

Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)

Description:

UI views live here once they are implemented, keeping the controller agnostic of toolkit code.

class mafw.steering_gui.views.DatabaseEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Widget that exposes database backend selection and layered configuration.

_detect_backend_from_url(url: str | None) → str[source]

Determine the backend type from the given URL.

This method analyses the provided URL to identify the corresponding backend type by matching URL prefixes or extracting the protocol. If no match is found, it defaults to the current backend or the default backend.

Parameters:

url – The URL string to be analysed for backend detection.

Returns:

A string representing the detected backend type.

_normalize_config(config: dict[str, Any] | None) → dict[str, Any][source]

Normalize the configuration dictionary to ensure consistent backend, URL, authentication, and parameters.

This method processes the input configuration dictionary to extract and normalize values for backend type, URL, authentication details, and backend-specific parameters, ensuring defaults are applied where necessary.

Parameters:

config – A dictionary containing configuration details such as backend, URL, authentication, and parameters. If None, defaults are applied.

Returns:

A dictionary with normalized configuration values including backend, URL, enabled status, authentication, parameters, and pragmas.

_on_migration_directory_browse() → None[source]

Open a directory-selection dialog and store the chosen migration directory.

The dialog starts from the currently configured directory when it is set, falling back to the current working directory otherwise. The selection is written back verbatim (absolute path) so the user can review or edit it.

get_data() → dict[str, Any][source]

Return a normalized view of the current database configuration.

is_enabled() → bool[source]

Return whether the database configuration group is active.

set_data(config: dict[str, Any] | None) → None[source]

Populate the UI from a configuration dictionary without emitting signals.

migration_directory_browse

Button opening a directory-selection dialog for the migration directory.

migration_directory_edit

Editable field for the schema-migration directory (steering DB-config entry).

class mafw.steering_gui.views.GlobalsEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Editor that exposes analysis metadata and global flags without touching the builder.

_add_env_file() → None[source]

Add an empty path row and focus its line editor.

_emit_env_files() → None[source]

Emit the current ordered paths after a drag operation.

_update_remove_button() → None[source]

Enable removal only while at least one complete row is selected.

current_values() → tuple[str, str, bool, bool][source]

Return the current UI values without normalizing them.

set_data(analysis_name: str | None, description: str | None, new_only: bool | None, create_standard_tables: bool | None, env_files: list[str] | None = None, env_file_statuses: list[dict[str, object]] | None = None) → None[source]

Populate the widgets and avoid re-triggering their change signals.

set_environment_statuses(statuses: list[dict[str, object]]) → None[source]

Refresh table flags after validation or environment reload.

class mafw.steering_gui.views.GroupEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Widget used to edit group metadata and the processor list.

refresh() → None[source]

Refresh the table root index after model updates.

set_group_item(item: PipelineItem) → None[source]

Display the provided group item and its processors.

set_model(model: SteeringTreeModel) → None[source]

Attach the steering tree model to the group editor.

class mafw.steering_gui.views.MetadataEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Provide a quick summary of the steering file when no specific section is active.

set_validation_level(level: ValidationLevel | None) → None[source]

Update the combo to reflect the controller’s validation preference.

update_summary(analysis_name: str | None, processor_count: int, available_processors: int | None = None, available_db_modules: int | None = None, available_uis: int | None = None) → None[source]

Refresh the summary labels to match the loaded model.

class mafw.steering_gui.views.PathEditor(parent: QWidget | None = None, role: PathRole = PathRole.INPUT_FILE, on_selected: Callable[[str], None] | None = None, on_browse_started: Callable[[], None] | None = None, on_browse_cancelled: Callable[[], None] | None = None)[source]

Bases: QWidget

Inline path editor whose browse action depends on a PathRole.

Build the editor for the given role.

Parameters:
  • parent – Optional parent widget.

  • role – The browse behaviour to use; defaults to input-file selection.

  • on_selected – Optional callback for values chosen in a browse dialog.

_browse() → None[source]

Open the file dialog matching the configured path role.

_finish_editing() → None[source]

Avoid committing a blank row while Browse temporarily owns focus.

eventFilter(watched: Any, event: QEvent) → bool[source]

Notify a containing table when the inline path field receives focus.

set_value(value: Any) → None[source]

Update the displayed path string.

value() → str[source]

Return the currently selected path string.

class mafw.steering_gui.views.PipelineEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Widget exposing the processor pipeline as a flat table plus toolbox actions.

refresh() → None[source]

Refresh the processors root index after model resets.

set_model(model: SteeringTreeModel) → None[source]

Attach the steering tree model and focus on the processors section.

class mafw.steering_gui.views.ProcessorEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Placeholder widget representing per-processor configuration editors.

class mafw.steering_gui.views.ProcessorParameterEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Widget used to edit parameters and metadata of a processor entry.

_activate_parameter_editor_on_click(index: QModelIndex) → None[source]

Show the list or path editor after one click on its value cell.

current_name() → str | None[source]

Return the currently displayed processor full name.

set_processor_data(config: ProcessorConfig) → None[source]

Populate the editor with processor configuration data.

set_storage_volumes(volumes: Iterable[str]) → None[source]

Update the volume choices offered by logical-reference editors.

class mafw.steering_gui.views.SteeringTreeView(parent: QWidget | None = None)[source]

Bases: QWidget

Widget exposing the steering-file sections as a QTreeView.

_on_selection_changed(*_: object) → None[source]

Emit the section key and pipeline selection for the new tree selection.

refresh() → None[source]

Refresh expansion and selection after model updates.

select_pipeline_item(name: str) → None[source]

Select a pipeline item by its processor/group name.

set_model(model: SteeringTreeModel) → None[source]

Attach a steering tree model to the view.

class mafw.steering_gui.views.StorageEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Edit named volumes and show storage validation feedback.

Added in version 2.4.

_add_row(name: str, root: str) → None[source]

Append one volume name and expose its root through the row tooltip.

_add_volume() → None[source]

Open the shared volume dialog and emit a validated new volume.

_edit_selected() → None[source]

Edit the selected valid volume and emit its replacement fields.

_remove_selected() → None[source]

Remove all selected valid or malformed volume entries.

_selected_names() → list[str][source]

Return selected volume names in visual row order.

_update_selection_actions() → None[source]

Enable edit and remove buttons according to the current selection.

set_configuration(config: StorageConfiguration, *, database_enabled: bool, issues: list[str]) → None[source]

Refresh volume rows, tooltips, availability, and validation feedback.

class mafw.steering_gui.views.UIEditor(parent: QWidget | None = None)[source]

Bases: QWidget

Widget that exposes the configured user interface and allows switching it.

set_available_interfaces(names: Iterable[str] | None) → None[source]

Populate the combo box once plugins have produced their UI list.

set_current_interface(interface: str | None) → None[source]

Request the combobox to display a specific interface without emitting signals.

Modules

database_editor

Expose the database editor UI for steering file configuration.

filter_editors

Editors for different filter types in the steering GUI.

filter_manager

Manager widget for filter configuration.

filter_tree

Tree view for displaying and interacting with processor filters.

globals_editor

Expose the globals editor fields required by the steering GUI.

group_editor

Group editor widget for managing processor groups.

meta_editor

Editor showing metadata when the root node is selected.

path_editor

Reusable line editor with a role-aware filesystem browse button.

pipeline_editor

Pipeline editor widget exposing processors and groups in execution order.

processor_editor

Editor scaffolding for processor-specific configurations.

processor_parameter_editor

Processor parameter editor for steering GUI pipelines.

steering_tree

Present a hierarchical representation of the steering file sections.

storage_editor

Editor for named storage volumes in steering files.

ui_editor

Editor for selecting the user interface defined in a steering file.