als.ui package

Submodules

als.ui.dialogs module

Provides all dialogs used in ALS GUI

class als.ui.dialogs.AboutDialog(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

Our about dialog box

class als.ui.dialogs.PreferencesDialog(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

Our main preferences dialog box

accept()[source]

checks and stores user settings

browse_scan()[source]

Opens a folder dialog to choose scan folder

browse_work()[source]

Opens a folder dialog to choose work folder

class als.ui.dialogs.SaveWaitDialog(controller: als.logic.Controller, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

Dialog shown while waiting for all pending image saves to complete

count_remaining_images()[source]

Count images that still need to be saved.

We count 1 image to save for each image in the queues and each worker still Busy and also take ‘save every image’ setting and web server status into account

Returns

the number of images remaining to be saved

Return type

int

on_btn_quit_clicked()[source]

Qt slot called when user clicks ‘Discard unsaved images and quit’

update_display(_)[source]

Update display

als.ui.dialogs.error_box(title, message)[source]

Displays an error Qt MessageBox

Parameters
  • title – Title of the box

  • message – Message displayed in the box

Returns

None

als.ui.dialogs.message_box(title, message, icon=1)[source]

Displays a Qt MessageBox with custom icon : Info by default

Parameters
  • title – Title of the box

  • message – Message displayed in the box

  • icon – The icon to show

Returns

None

als.ui.dialogs.question(title, message, default_yes: bool = True)[source]

Asks a question to user in a Qt MessageBox and return True/False as Yes/No

Parameters
  • title – Title of the box

  • message – Message displayed in the box

  • default_yes (bool) – set ‘yes’ button as the default button

Returns

True if user replies “Yes”, False otherwise

als.ui.dialogs.warning_box(title, message)[source]

Displays a waring Qt MessageBox

Parameters
  • title – Title of the box

  • message – Message displayed in the box

Returns

None

als.ui.params_utils module

Provide logic for mapping processing params < = > GUI controls

exception als.ui.params_utils.UnknownWidget(message, details)[source]

Bases: als.code_utilities.AlsException

Raised when trying to get a control’s value getter / setters functions

exception als.ui.params_utils.UnsupportedParamMapping(message, details)[source]

Bases: als.code_utilities.AlsException

Raised when trying to work on incompatible couple param / control

als.ui.params_utils.reset_params(params: List[als.model.params.ProcessingParameter], controls: List[PyQt5.QtWidgets.QWidget])[source]

Reset a list of ProcessingParameter and update associated controls

Parameters
  • params (List[ProcessingParameter]) – the param list

  • controls (List[QWidget]) – the control list

als.ui.params_utils.set_sliders_defaults(params: List[als.model.params.RangeParameter], sliders: List[als.ui.widgets.Slider])[source]

Works on matched lists : sets each slider’s default value according to matched param default value

Parameters
als.ui.params_utils.update_controls_from_params(params: List[als.model.params.ProcessingParameter], controls: List[PyQt5.QtWidgets.QWidget])[source]

Update a list of GUI controls from a matched list of processing parameters

Parameters
  • params (List[ProcessingParameter]) – the param list

  • controls (List[QWidget]) – the control list

als.ui.params_utils.update_params_from_controls(params: List[als.model.params.ProcessingParameter], controls: List[PyQt5.QtWidgets.QWidget])[source]

Update a list of processing parameters from a matched list of GUI controls

Parameters
  • params (List[ProcessingParameter]) – the param list

  • controls (List[QWidget]) – the control list

als.ui.widgets module

Our custom widgets

class als.ui.widgets.HistogramView(parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Our main histogram display

paintEvent(_)[source]

Do the painting, Leonardo !

Parameters

_ – ignored Qt event

class als.ui.widgets.ImageView(parent: Optional[PyQt5.QtWidgets.QWidget] = Ellipsis)[source]

Bases: PyQt5.QtWidgets.QGraphicsView

The main image view.

Subclasses QGraphicsView to add mousewheel zoom features

mouseDoubleClickEvent(_)[source]

Reacts to a double-click in image view : Fit image in view

Parameters

_ – ignored Qt event

wheelEvent(event: PyQt5.QtGui.QWheelEvent) → None[source]

Performs zoom in & out according to mousewheel moves

Parameters

event (QtGui.QWheelEvent) – The Qt wheel event

class als.ui.widgets.Slider(parent=None)[source]

Bases: PyQt5.QtWidgets.QSlider

A slider that has a default value and resets to it when double-clicked

MAX_VALUE = 255
mouseDoubleClickEvent(_)[source]

User double-clicked the slider

Parameters

_ – ignored Qt event

set_default_value(default_value)[source]

Sets the slider default value

Parameters

default_value (int) – the default value

als.ui.windows module

Holds all windows used in the app

class als.ui.windows.MainWindow(controller: als.logic.Controller, parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

ALS main window.

cb_about()[source]

Qt slot for activation of the ‘about’ action

cb_pause()[source]

Qt slot for mouse clicks on the ‘Pause’ button

cb_play()[source]

Qt slot for mouse clicks on the ‘play’ button

cb_prefs()[source]

Qt slot for activation of the ‘preferences’ action

cb_quit()[source]

Qt slot for activation of the ‘quit’ action

cb_save()[source]

Qt slot for mouse clicks on the ‘save’ button.

This saves the processed image using user chosen format

cb_stop()[source]

Qt slot for mouse clicks on the ‘Stop’ button

closeEvent(event)[source]

Handles window close events.

on_action_full_screen_toggled(checked)[source]

Qt slot executed when action ‘Full screen’ is toggled

Parameters

checked (bool) – is the action active ?

on_action_image_only_triggered()[source]

Qt slot executed when ‘image only’ action is triggered

on_btn_web_start_clicked()[source]

Qt slot executed when START web button is clicked

on_btn_web_stop_clicked()[source]

Qt slot executed when START web button is clicked

on_cb_stacking_mode_currentTextChanged(stacking_mode: str)[source]

Qt slot executed when stacking mode comb box changed

Parameters

stacking_mode (str) – new stacking mode

on_chk_align_toggled(checked: bool)[source]

Qt slot executed when ‘align’ check box is changed

Parameters

checked (bool) – is checkbox checked ?

on_chk_levels_active_clicked(checked: bool)[source]

Qt slot executed when levels ‘active’ checkbox is clicked

Parameters

checked – is the box now checked ?

Type

bool

on_chk_rgb_active_clicked(checked: bool)[source]

Qt slot executed when RGB ‘active’ checkbox is clicked

Parameters

checked – is the box now checked ?

Type

bool

on_chk_save_every_image_toggled(checked: bool)[source]

Qt slot executed when ‘save ever image’ check box is changed

Parameters

checked (bool) – is checkbox checked ?

on_chk_stretch_active_clicked(checked: bool)[source]

Qt slot executed when autostretch ‘active’ checkbox is clicked

Parameters

checked – is the box now checked ?

Type

bool

on_log_dock_visibilityChanged(visible)[source]

Qt slot executed when log dock visibility changed

Parameters

visible (bool) – is it now visible ?

on_log_message(message)[source]

print received log message to GUI log window

Parameters

message (str) – the log message

on_processing_dock_visibilityChanged(visible)[source]

Qt slot executed when prcessing dock visibility changed

Parameters

visible (bool) – is it now visible ?

on_session_dock_visibilityChanged(visible)[source]

Qt slot executed when session dock visibility changed

Parameters

visible (bool) – is it now visible ?

reset_image_view()[source]

Reset image viewer to its initial state

update_display(image_only: bool = False)[source]

Updates all displays and controls depending on DataStore held data

Module contents