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
- 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.
- _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’)
- _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’).
- _modify_svg_file(color, thickness)[source]¶
Create modified SVG in cache.
- Returns:
Cache hash of modified SVG
- _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
- 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.
- 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.
- 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.
- 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.
- _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
- 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.
- 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