mafw.steering_gui.views.globals_editor

Expose the globals editor fields required by the steering GUI.

Author:

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

Description:

Provide input fields for the analysis metadata and flags managed by the controller.

Classes

GlobalsEditor([parent])

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

class mafw.steering_gui.views.globals_editor.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.globals_editor._EnvironmentFilesTable(parent: QWidget | None = None)[source]

Bases: QTableWidget

Editable ordered list of dotenv paths and their load status.

Create the three-column dotenv table with internal row reordering.

_append_row(path: str, *, valid: bool, loaded: bool) → PathEditor[source]

Create a path widget and read-only bool cells for one row.

_emit_paths_changed() → None[source]

Validate edited paths after a short pause in typing.

_move_rows(selected_rows: list[int], target: int) → None[source]

Rebuild the table in the requested order without losing cell widgets.

_records() → list[tuple[str, bool, bool]][source]

Return path and status values for each current row.

_set_flag(row: int, column: int, value: bool) → None[source]

Set a check indicator that users cannot toggle manually.

_set_row_error_style(row: int, invalid: bool) → None[source]

Paint invalid rows red while leaving valid rows with the default palette.

add_row() → PathEditor[source]

Append an empty path and return its focused editor.

dropEvent(event: QDropEvent) → None[source]

Move selected rows as a block and preserve their path and status cells.

paths() → list[str][source]

Return configured path strings in their current table order.

remove_selected_rows() → None[source]

Remove all selected rows and report the new ordered path list.

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

Replace table rows from the steering path list and current validation state.

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

Refresh the validity and loaded flags without replacing path editors.

startDrag(supported_actions: DropAction) → None[source]

Start an internal drag while retaining selected row identities.

supported_actions uses Qt.DropAction from PySide6.