sec_interp.gui.main_dialog module

Main Dialog Module.

Contains the SecInterpDialog class which is the primary UI for the plugin.

class sec_interp.gui.main_dialog.SecInterpDialog(*args: Any, **kwargs: Any)

Bases: SecInterpMainWindow

Dialog for the SecInterp QGIS plugin.

This dialog provides the user interface and helper methods to populate combo boxes with layers from the current QGIS project (raster and vector layers filtered by geometry type). It also exposes the interface and plugin instance for interaction with the host application.

iface

The QGIS interface instance.

Type:

QgsInterface

plugin_instance

The plugin instance that created this dialog.

Type:

SecInterp

messagebar

The message bar widget for notifications.

Type:

QgsMessageBar

__init__(iface=None, plugin_instance=None, parent=None) None

Initialize the dialog.

accept_handler() None

Handle the accept button click event.

clear_cache_handler() None

Clear cached data and notify user.

closeEvent(event: Any) None

Handle dialog close event to clean up resources.

export_preview() None

Export the current preview to a file using ExportManager.

getThemeIcon(name: str) Any

Get a theme icon via DialogEntityManager.

get_layer_names_by_geometry(geometry_type) list[str]

Get layer names by geometry.

get_layer_names_by_type(layer_type) list[str]

Get layer names by type.

get_preview_options() dict[str, Any]

Return the state of preview layer checkboxes.

Returns:

Keys ‘show_topo’, ‘show_geol’, ‘show_struct’ with boolean values.

Return type:

dict

get_selected_values() dict[str, Any]

Get the selected values from the dialog.

Returns:

Dictionary with all dialog values in legacy flat format

handle_error(error: Exception, title: str = 'Error') None

Centralized error handling for the dialog.

Parameters:
  • error – The exception to handle.

  • title – Title for the error message box.

property interpretations: list[InterpretationPolygon]

Proxy to interpretations in the manager for backward compatibility.

on_interpretation_finished(interpretation: InterpretationPolygon) None

Handle finalized interpretation polygon.

open_help() None

Open the help file in the default browser.

preview_profile_handler() None

Generate a quick preview with topographic, geological, and structural data.

This method delegates to PreviewManager for preview generation.

push_message(title: str, message: str, level: int = qgis.core.Qgis.Info, duration: int = 5, show_in_plugin: bool = True) None

Push a message to the QGIS message bar and optionally to plugin results.

Parameters:
  • title – Message title.

  • message – Message content.

  • level – Qgis message level (Info, Warning, Critical, Success).

  • duration – Visibility duration in seconds.

  • show_in_plugin – If True, also show message in plugin results area.

reject_handler() None

Handle the reject button click event.

reset_defaults_handler() None

Reset all dialog inputs via state_manager.

show_dialog(title: str, message: str, level: str = 'info') Any

Show a message box dialog.

Parameters:
  • title – Dialog title.

  • message – Dialog content.

  • level – Message level (“info”, “warning”, “critical”, “question”).

toggle_interpretation_tool(checked: bool) None

Toggle interpretation tool via tool_manager.

toggle_measure_tool(checked: bool) None

Toggle measurement tool via tool_manager.

update_button_state() None

Enable or disable buttons via state_manager.

update_measurement_display(metrics: dict[str, Any]) None

Display measurement results from multi-point tool via tool_manager.

update_preview_checkbox_states() None

Enable or disable preview checkboxes via state_manager.

update_preview_from_checkboxes() None

Update preview when checkboxes change.

This method delegates to PreviewManager for preview updates.

validate_inputs() bool

Validate the inputs from the dialog.

This method delegates to DialogInputManager for input validation.

wheelEvent(event: Any) None

Handle mouse wheel for zooming in preview via navigation_manager.