# 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(iface=None, plugin_instance=None, parent=None)

  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

  Initialize the dialog.

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

    Initialize the dialog.

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

    Centralized error handling for the dialog.

    Parameters:

      - error – The exception to handle.

      - title – Title for the error message box.

  wheelEvent(event)

    Handle mouse wheel for zooming in preview via navigation_manager.

  closeEvent(event)

    Handle dialog close event to clean up resources.

  open_help()

    Open the help file in the default browser.

  toggle_measure_tool(checked)

    Toggle measurement tool via tool_manager.

  update_measurement_display(metrics)

    Display measurement results from multi-point tool via tool_manager.

  toggle_interpretation_tool(checked)

    Toggle interpretation tool via tool_manager.

  on_interpretation_finished(interpretation)

    Handle finalized interpretation polygon.

    Parameters:

      interpretation – InterpretationPolygon object from the tool

  update_preview_checkbox_states()

    Enable or disable preview checkboxes via status_manager.

  update_button_state()

    Enable or disable buttons via status_manager.

  get_selected_values()

    Get the selected values from the dialog.

    Returns:

      Dictionary with all dialog values in legacy flat format

  get_preview_options()

    Return the state of preview layer checkboxes.

    Returns:

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

    Return type:

      dict

  update_preview_from_checkboxes()

    Update preview when checkboxes change.

    This method delegates to PreviewManager for preview updates.

  preview_profile_handler()

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

    This method delegates to PreviewManager for preview generation.

  export_preview()

    Export the current preview to a file using ExportManager.

  accept_handler()

    Handle the accept button click event.

  reject_handler()

    Handle the reject button click event.

  validate_inputs()

    Validate the inputs from the dialog.

    This method delegates to DialogValidator for input validation.

  clear_cache_handler()

    Clear cached data and notify user.

  reset_defaults_handler()

    Reset all dialog inputs and notify user.

  get_layer_names_by_type(layer_type) → list[str]

    Get layer names by type.

  get_layer_names_by_geometry(geometry_type) → list[str]

    Get layer names by geometry.

  getThemeIcon(name)

    Get a theme icon via DialogEntityManager.