zooui.windows.dialogwindows.dialogwindows module

ZooUI DialogWindows - Main dialog module that aggregates all dialog components.

class zooui.windows.dialogwindows.dialogwindows.AutosaveSettingsDialog(parent=None, initial_config=None)[source]

Bases: QDialog

Constructor :

AutosaveSettingsDialog(parent=None, initial_config=None)

Parameters :
parentOptional[QtWidgets.QWidget]

Parent widget

initial_configOptional[Dict[str, Any]]

Initial autosave configuration

AutosaveSettingsDialog(parent=None, initial_config=None) –> None

__init__(parent=None, initial_config=None)[source]
_load_initial_config()[source]

Load initial configuration into UI.

_on_enable_changed()[source]

Handle enable checkbox state change.

_setup_ui()[source]

Setup the dialog UI components.

static get_autosave_settings(parent=None, initial_config=None)[source]
Method :

get_autosave_settings(parent=None, initial_config=None)

Static method to show dialog and get autosave settings.

Parameters :
parentOptional[QtWidgets.QWidget]

Parent widget

initial_configOptional[Dict[str, Any]]

Initial autosave configuration

Returns :
Optional[Dict[str, Any]]

Autosave configuration if accepted, None if cancelled

get_autosave_settings(parent=None, initial_config=None) –> Optional[Dict[str, Any]]

get_config()[source]
Method :

get_config()

Get the current configuration from the dialog.

Returns :
Dict[str, Any]

Autosave configuration dictionary

get_config() –> Dict[str, Any]

staticMetaObject = PySide6.QtCore.QMetaObject("AutosaveSettingsDialog" inherits "QDialog": )
class zooui.windows.dialogwindows.dialogwindows.DialogWindows[source]

Bases: object

Constructor :

DialogWindows()

Parameters :

None

DialogWindows() –> None

All the windows that require a user input rather than simple click.

This class serves as a namespace/container for dialog-related functionality. The actual dialogs are implemented in separate modules.

open_zoom_sensitivity_input_dialog()
Function :

OpenZoomSensitivityInputDialog(current_sensitivity)

Parameters :

current_sensitivity : float

OpenZoomSensitivityInputDialog(current_sensitivity) –> Tuple[bool, str]

Opens a dialog to set zoom sensitivity. Returns (ok_pressed, text_input) tuple.

open_new_string_input_dialog

alias of OpenNewStringInputDialog

modify_string_input_dialog

alias of ModifyStringInputDialog

modify_tiled_media_object_dialog

alias of ModifyTiledMediaObjectDialog

open_svg_picker_input_dialog

alias of OpenSVGPickerInputDialog

modify_svg_input_dialog

alias of ModifySVGInputDialog

autosave_settings_dialog

alias of AutosaveSettingsDialog

usage_dialog

alias of UsageDialog

class zooui.windows.dialogwindows.dialogwindows.ModifySVGInputDialog(svg_media_object)[source]

Bases: object

Constructor :

ModifySVGInputDialog(svg_media_object)

Parameters :

svg_media_object : SVGMediaObject

ModifySVGInputDialog(svg_media_object) –> None

Dialog for modifying color and thickness of existing SVG objects. Designed for simple shapes (arrows, triangles, circles, squares) that were added via svgpickerinputdialog.py.

Constructor :

ModifySVGInputDialog(svg_media_object)

Parameters :

svg_media_object : SVGMediaObject

ModifySVGInputDialog(svg_media_object) –> None

Initialize dialog for modifying an existing SVG object.

DEFAULT_COLOR = '000000'
DEFAULT_THICKNESS = '10'
__init__(svg_media_object)[source]
Constructor :

ModifySVGInputDialog(svg_media_object)

Parameters :

svg_media_object : SVGMediaObject

ModifySVGInputDialog(svg_media_object) –> None

Initialize dialog for modifying an existing SVG object.

_apply_preview()[source]

Apply thickness changes to preview.

_color_button(color_code)[source]

Create a color selection button.

_color_button_click(color)[source]

Handle color button click event.

_color_name_to_hex(color_name)[source]

Convert color name to hex code.

Parameters:

color_name – Color name (e.g., ‘black’, ‘red’) or hex code

Returns:

Hex color without # (e.g., ‘000000’)

_color_square(color_code)[source]

Create a colored square widget.

_extract_current_color()[source]

Extract color from SVG content. For simple shapes, look for stroke or fill attributes. Returns hex color without # (e.g., ‘000000’ for black).

_extract_current_thickness()[source]

Extract stroke-width from SVG content. Returns string value (e.g., ‘8’).

_get_current_svg_content()[source]

Get current SVG content with modifications applied.

_load_color_history()[source]

Load color history from color store file.

_main_dialog()[source]

Create and configure the main dialog window.

_modify_svg_file(color, thickness)[source]

Create modified SVG in cache.

Returns:

Cache hash of modified SVG

_pick_color_from_dialog()[source]

Open a QColorDialog to pick a custom color.

_reset_to_original()[source]

Reset to original values.

_run_dialog()[source]

Run the dialog and return result.

Returns:

  • ok: True if accepted, False if cancelled

  • cache_hash: New cache hash if modified, None if no changes

Return type:

(ok, cache_hash) where

_show_source_warning_dialog()[source]

Warning: This SVG was not added via SVG Picker dialog. The modify dialog is designed for simple shapes from zooui/data/SVG/.

Default values will be used: color=black, stroke-width=10 Continue anyway?

_svg_preview_widget()[source]

Create widget showing the SVG preview (300x300).

_update_preview()[source]

Update the preview widget.

_validate_svg_source()[source]

Check if SVG is from safe source (SVG cache directory). Show warning dialog for other sources.

Returns:

True if safe or user confirms, False if user cancels

class zooui.windows.dialogwindows.dialogwindows.ModifyStringInputDialog(media_id)[source]

Bases: object

Constructor :

ModifyStringInputDialog(media_id)

Parameters :

media_id : Optional[str]

ModifyStringInputDialog(media_id) –> None

Gather the string through a dialog and let select the color. Also gives a selection column of the last 20 used colors.

Constructor :

ModifyStringInputDialog(media_id)

Parameters :

media_id : Optional[str]

ModifyStringInputDialog(media_id) –> None

Create a new ModifyStringInputDialog for editing an existing string media object.

The media_id parameter contains the string URI in format ‘string:RRGGBB:text’. If media_id is provided, the dialog is pre-populated with the existing color and text. Loads previously used colors from the color store file.

__init__(media_id)[source]
Constructor :

ModifyStringInputDialog(media_id)

Parameters :

media_id : Optional[str]

ModifyStringInputDialog(media_id) –> None

Create a new ModifyStringInputDialog for editing an existing string media object.

The media_id parameter contains the string URI in format ‘string:RRGGBB:text’. If media_id is provided, the dialog is pre-populated with the existing color and text. Loads previously used colors from the color store file.

_color_button(color_code)[source]
Method :

ModifyStringInputDialog._color_button(color_code)

Parameters :

color_code : str

ModifyStringInputDialog._color_button(color_code) –> QWidget

Creates a color selection button.

_color_button_click(color)[source]
Method :

ModifyStringInputDialog._color_button_click(color)

Parameters :

color : str

ModifyStringInputDialog._color_button_click(color) –> None

Handles color button click event.

_color_square(color_code)[source]
Method :

ModifyStringInputDialog._color_square(color_code)

Parameters :

color_code : str

ModifyStringInputDialog._color_square(color_code) –> QWidget

Creates a colored square widget.

_main_dialog()[source]
Method :

ModifyStringInputDialog._main_dialog()

Parameters :

None

ModifyStringInputDialog._main_dialog() –> QDialog

Creates and configures the main dialog window.

_pick_color_from_dialog()[source]

Open a QColorDialog to pick a custom color.

_run_dialog()[source]
Method :

ModifyStringInputDialog._run_dialog()

Parameters :

None

ModifyStringInputDialog._run_dialog() –> Tuple[bool, str, str, str]

Runs the dialog and returns the result. Returns (ok, media_id, color, text) where ok is True if accepted.

class zooui.windows.dialogwindows.dialogwindows.ModifyTiledMediaObjectDialog(mediaobject)[source]

Bases: object

Constructor :

ModifyTiledMediaObjectDialog(mediaobject)

Parameters :

mediaobject : TiledMediaObject

ModifyTiledMediaObjectDialog(mediaobject) –> None

Display the tiled media object with image manipulation options. Shows the top tile of the tiled media object and provides buttons for image manipulation (rotate, invert colors, black and white).

Method :

ModifyTiledMediaObjectDialog.__init__(mediaobject)

Parameters :

mediaobject : TiledMediaObject

ModifyTiledMediaObjectDialog.__init__(mediaobject) –> None

Initialize the dialog with the given mediaobject. Loads the top tile (0,0,0) of the tiled media object.

__init__(mediaobject)[source]
Method :

ModifyTiledMediaObjectDialog.__init__(mediaobject)

Parameters :

mediaobject : TiledMediaObject

ModifyTiledMediaObjectDialog.__init__(mediaobject) –> None

Initialize the dialog with the given mediaobject. Loads the top tile (0,0,0) of the tiled media object.

_create_button_panel()[source]
Method :

ModifyTiledMediaObjectDialog._create_button_panel()

Parameters :

None

ModifyTiledMediaObjectDialog._create_button_panel() –> QWidget

Creates the button panel with image manipulation options.

_create_image_panel()[source]
Method :

ModifyTiledMediaObjectDialog._create_image_panel()

Parameters :

None

ModifyTiledMediaObjectDialog._create_image_panel() –> QWidget

Creates the image display panel showing the top tile.

_main_dialog()[source]
Method :

ModifyTiledMediaObjectDialog._main_dialog()

Parameters :

None

ModifyTiledMediaObjectDialog._main_dialog() –> QDialog

Creates and configures the main dialog window.

_on_black_white()[source]
Method :

ModifyTiledMediaObjectDialog._on_black_white()

Parameters :

None

ModifyTiledMediaObjectDialog._on_black_white() –> None

Toggle black and white (grayscale) effect. Updates preview only; actual effect applied on OK.

_on_invert_colors()[source]
Method :

ModifyTiledMediaObjectDialog._on_invert_colors()

Parameters :

None

ModifyTiledMediaObjectDialog._on_invert_colors() –> None

Toggle invert colors effect. Updates preview only; actual effect applied on OK.

_on_rotate_left()[source]
Method :

ModifyTiledMediaObjectDialog._on_rotate_left()

Parameters :

None

ModifyTiledMediaObjectDialog._on_rotate_left() –> None

Rotate the image 90 degrees counter-clockwise (left). Updates preview only; actual rotation applied on OK.

_on_rotate_right()[source]
Method :

ModifyTiledMediaObjectDialog._on_rotate_right()

Parameters :

None

ModifyTiledMediaObjectDialog._on_rotate_right() –> None

Rotate the image 90 degrees clockwise (right). Updates preview only; actual rotation applied on OK.

_replace_mediaobject_with_rotated(rotated_ppm_path)[source]
Method :

ModifyTiledMediaObjectDialog._replace_mediaobject_with_rotated(rotated_ppm_path)

Parameters :

rotated_ppm_path : str

ModifyTiledMediaObjectDialog._replace_mediaobject_with_rotated(rotated_ppm_path) –> bool

Remove the current mediaobject from scene and add the rotated PPM as a new mediaobject. Returns True if successful, False otherwise.

_run_dialog()[source]
Method :

ModifyTiledMediaObjectDialog._run_dialog()

Parameters :

None

ModifyTiledMediaObjectDialog._run_dialog() –> Tuple[bool, Optional[str]]

Runs the dialog and returns the result. Returns (ok, media_id) where ok is True if accepted. If rotation occurred, replaces the mediaobject in the scene.

_update_image_display()[source]
Method :

ModifyTiledMediaObjectDialog._update_image_display()

Parameters :

None

ModifyTiledMediaObjectDialog._update_image_display() –> None

Update the image display with current rotation, invert, and grayscale effects.

class zooui.windows.dialogwindows.dialogwindows.OpenNewStringInputDialog(initial_text='')[source]

Bases: object

Constructor :

OpenNewStringInputDialog()

Parameters :

None

OpenNewStringInputDialog() –> None

Gather the string through a dialog and let select the color. Also gives a selection column of the last 20 used colors.

Constructor :

OpenNewStringInputDialog(initial_text)

Parameters :
initial_textstr

Optional text to pre-fill the text edit widget (e.g., OCR output).

OpenNewStringInputDialog(initial_text=””) –> None

Create a new OpenNewStringInputDialog for gathering string input with color selection.

If initial_text is provided, the text edit will be pre-filled with that content. This is used by the OCR screenshot feature to seed the dialog with tesseract output.

Initializes the dialog with empty string color, loads previously used colors from the color store file, or creates default colors (red, green, blue) if no color history exists.

__init__(initial_text='')[source]
Constructor :

OpenNewStringInputDialog(initial_text)

Parameters :
initial_textstr

Optional text to pre-fill the text edit widget (e.g., OCR output).

OpenNewStringInputDialog(initial_text=””) –> None

Create a new OpenNewStringInputDialog for gathering string input with color selection.

If initial_text is provided, the text edit will be pre-filled with that content. This is used by the OCR screenshot feature to seed the dialog with tesseract output.

Initializes the dialog with empty string color, loads previously used colors from the color store file, or creates default colors (red, green, blue) if no color history exists.

_color_button(color_code)[source]
Method :

OpenNewStringInputDialog._color_button(color_code)

Parameters :

color_code : str

OpenNewStringInputDialog._color_button(color_code) –> QWidget

Creates a color selection button.

_color_button_click(color)[source]
Method :

OpenNewStringInputDialog._color_button_click(color)

Parameters :

color : str

OpenNewStringInputDialog._color_button_click(color) –> None

Handles color button click event.

_color_square(color_code)[source]
Method :

OpenNewStringInputDialog._color_square(color_code)

Parameters :

color_code : str

OpenNewStringInputDialog._color_square(color_code) –> QWidget

Creates a colored square widget.

_main_dialog()[source]
Method :

OpenNewStringInputDialog._main_dialog()

Parameters :

None

OpenNewStringInputDialog._main_dialog() –> QDialog

Creates and configures the main dialog window.

_pick_color_from_dialog()[source]

Open a QColorDialog to pick a custom color.

_run_dialog()[source]
Method :

OpenNewStringInputDialog._run_dialog()

Parameters :

None

OpenNewStringInputDialog._run_dialog() –> Tuple[bool, str]

Runs the dialog and returns the result. Returns (ok, uri) where ok is True if accepted, uri is the formatted string.

class zooui.windows.dialogwindows.dialogwindows.OpenSVGPickerInputDialog[source]

Bases: object

Constructor :

OpenSVGPickerInputDialog()

Parameters :

None

OpenSVGPickerInputDialog() –> None

Gather SVG file selection through a dialog with color selection. Also gives a selection column of the last 20 used colors.

Constructor :

OpenSVGPickerInputDialog()

Parameters :

None

OpenSVGPickerInputDialog() –> None

Create a new OpenSVGPickerInputDialog for gathering SVG file selection with color selection.

Initializes the dialog with empty color, loads previously used colors from the color store file, or creates default colors (red, green, blue) if no color history exists. Also scans the SVG directory for available SVG files.

DEFAULT_SVG_THICKNESS = '50'
SVG_FILES = []
SVG_NAMES = {}
__init__()[source]
Constructor :

OpenSVGPickerInputDialog()

Parameters :

None

OpenSVGPickerInputDialog() –> None

Create a new OpenSVGPickerInputDialog for gathering SVG file selection with color selection.

Initializes the dialog with empty color, loads previously used colors from the color store file, or creates default colors (red, green, blue) if no color history exists. Also scans the SVG directory for available SVG files.

_apply_changes_to_svg()[source]

Apply both color and thickness changes to the selected SVG preview.

_apply_color_to_svg()[source]

Apply the selected color to the selected SVG preview.

_apply_thickness_to_svg()[source]

Apply the entered thickness to the selected SVG preview.

_color_button(color_code)[source]
Method :

OpenSVGPickerInputDialog._color_button(color_code)

Parameters :

color_code : str

OpenSVGPickerInputDialog._color_button(color_code) –> QWidget

Creates a color selection button.

_color_button_click(color)[source]
Method :

OpenSVGPickerInputDialog._color_button_click(color)

Parameters :

color : str

OpenSVGPickerInputDialog._color_button_click(color) –> None

Handles color button click event.

_color_square(color_code)[source]
Method :

OpenSVGPickerInputDialog._color_square(color_code)

Parameters :

color_code : str

OpenSVGPickerInputDialog._color_square(color_code) –> QWidget

Creates a colored square widget.

_create_modified_svg_renderer(svg_path, force_update=False)[source]

Create a modified SVG renderer with color and thickness applied. Uses XML parsing instead of regex for more reliable modification.

Parameters:
  • svg_path – Path to the SVG file

  • force_update – If True, always create new renderer even if cached

_main_dialog()[source]
Method :

OpenSVGPickerInputDialog._main_dialog()

Parameters :

None

OpenSVGPickerInputDialog._main_dialog() –> QDialog

Creates and configures the main dialog window.

_modify_svg_file(svg_path, color=None, thickness=None)[source]

Modify an SVG file with new color and/or thickness using XML parsing.

Parameters:
  • svg_path – Path to the original SVG file

  • color – Hex color code (without #) to apply to stroke and fill

  • thickness – Stroke width value

Returns:

svg_{8_char_hex})

Return type:

Cache hash of modified SVG (format

_pick_color_from_dialog()[source]

Open a QColorDialog to pick a custom color.

_run_dialog()[source]
Method :

OpenSVGPickerInputDialog._run_dialog()

Parameters :

None

OpenSVGPickerInputDialog._run_dialog() –> Tuple[bool, str]

Runs the dialog and returns the result. Returns (ok, filepath) where ok is True if accepted, filepath is the selected SVG file path.

_svg_button_click(svg_path)[source]

Handle SVG button click event.

_svg_widget(svg_path)[source]

Create a widget that displays an SVG preview and acts as a button.

zooui.windows.dialogwindows.dialogwindows.OpenZoomSensitivityInputDialog(current_sensitivity)[source]
Function :

OpenZoomSensitivityInputDialog(current_sensitivity)

Parameters :

current_sensitivity : float

OpenZoomSensitivityInputDialog(current_sensitivity) –> Tuple[bool, str]

Opens a dialog to set zoom sensitivity. Returns (ok_pressed, text_input) tuple.

class zooui.windows.dialogwindows.dialogwindows.UsageDialog(parent=None)[source]

Bases: QDialog

Constructor :

UsageDialog(parent=None)

Parameters :
parentOptional[QtWidgets.QWidget]

Parent widget

UsageDialog(parent=None) –> None

Dialog that displays the user interface usage instructions from the embedded reStructuredText source.

__init__(parent=None)[source]
_load_html()[source]
_setup_ui()[source]
staticMetaObject = PySide6.QtCore.QMetaObject("UsageDialog" inherits "QDialog": )

See Also

  • zooui/windows/dialogwindows/autosavesettingsdialog - Autosave settings dialog

  • zooui/windows/dialogwindows/modifystringdialog - String modification dialog

  • zooui/windows/dialogwindows/modifysvginputdialog - SVG modification dialog

  • zooui/windows/dialogwindows/modifytiledmediaobjectdialog - Tiled media object dialog

  • zooui/windows/dialogwindows/stringinputdialog - String input dialog

  • zooui/windows/dialogwindows/svgpickerinputdialog - SVG picker dialog

  • zooui/windows/dialogwindows/zoomsensitivitydialog - Zoom sensitivity dialog

  • zooui/windows/dialogwindows/zoomsettingsdialog - Zoom settings dialog