GUI Options¶

Provides the main QDialog subclass that creates the preferences menu and keeps track of all internally saved options. The window used for the kwargs dicts is defined in kwargs_dicts.

class prism._gui.widgets.preferences.options.OptionsDialog(main_window_obj, *args, **kwargs)[source]

Defines the OptionsDialog class for the Projection GUI.

This class provides both the ‘Preferences’ dialog and the functions that are required to load; save; set; and change them.

__call__()[source]

Qt slot that shows the options dialog in the center of the main window.

__init__(main_window_obj, *args, **kwargs)[source]

Initialize an instance of the OptionsDialog class.

Parameters: Other Parameters: main_window_obj (MainViewerWindow object) – Instance of the MainViewerWindow class that acts as the parent of this dialog. args (positional arguments) – The positional arguments that must be passed to the constructor of the QDialog class. kwargs (keyword arguments) – The keyword arguments that must be passed to the constructor of the QDialog class.
closeEvent(*args, **kwargs)[source]

Special closeEvent() event that makes sure that all dialogs will be closed related to the options menu, and discards all changes made.

create_entry(name, box, default)[source]

Creates a new OptionsEntry instance, using the provided name, box and default, and registers it in the options dialog.

Parameters: name (str) – The name of this options entry. box (QWidget object) – The widget that will hold the values of this entry. default (object) – The default value of this entry.
create_group(name, options_list)[source]

Creates a new option group with the given name and adds the options defined in options_list to it.

This function acts as a base function called by create_group_ functions.

Parameters: name (str) – The name of this option group. options_list (list of str) – A list containing the names of all options that need to be added to this group. group (QGroupBox object) – The created option group.
create_group_buttons(window_layout)[source]

Creates the button box that is shown at the bottom of the options dialog and registers it in the provided window_layout.

create_group_fonts()[source]

Creates the ‘Fonts’ group and returns it.

create_group_interface()[source]

Creates the ‘Interface’ group and returns it.

create_group_proj_grid()[source]

Creates the ‘Projection grid’ group and returns it.

create_group_proj_kwargs()[source]

Creates the ‘Projection keywords’ group and returns it.

create_option_align()[source]

Creates the ‘align’ option and returns it.

This option sets the value of the ‘align’ projection parameter.

create_option_auto_show()[source]

Creates the ‘auto_show’ option and returns it.

This option sets whether the projection subwindows are automatically shown whenever created.

create_option_auto_tile()[source]

Creates the ‘auto_tile’ option and returns it.

This option sets whether the projection subwindows are automatically tiled.

create_option_dpi()[source]

Creates the ‘dpi’ option and returns it.

This option allows for the DPI used in the GUI to be modified.

create_option_full_impl_rng()[source]

Creates the ‘full_impl_rng’ option and returns it.

This option sets the value of the ‘full_impl_rng’ projection parameter.

create_option_kwargs_dicts()[source]

Creates the ‘kwargs_dicts’ option and returns it.

This option allows for the KwargsDictDialog to be shown to the user. This dialog is able to set the values of all ‘XXX_kwargs’ projection parameters.

create_option_progress_dialog()[source]

Creates the ‘progress_dialog’ option and returns it.

This option sets whether a threaded progress dialog is used for some operations.

create_option_proj_depth()[source]

Creates the ‘proj_depth’ option and returns it.

This option sets the value of the ‘proj_depth’ projection parameter.

create_option_proj_res()[source]

Creates the ‘proj_res’ option and returns it.

This option sets the value of the ‘proj_res’ projection parameter.

create_option_show_cuts()[source]

Creates the ‘show_cuts’ option and returns it.

This option sets the value of the ‘show_cuts’ projection parameter.

create_option_smooth()[source]

Creates the ‘smooth’ option and returns it.

This option sets the value of the ‘smooth’ projection parameter.

create_option_text_fonts()[source]

Creates the ‘text_fonts’ option and returns it.

This option allows for the fonts used in the GUI to be modified.

create_option_use_par_space()[source]

Creates the ‘use_par_space’ option and returns it.

This option sets the value of the ‘use_par_space’ projection parameter.

create_tab(name, groups_list)[source]

Creates a new options tab with the given name and adds the groups defined in groups_list to it.

This function acts as a base function called by create_tab_ functions.

Parameters: name (str) – The name of this options tab. groups_list (list of str) – A list containing the names of all option groups that need to be added to this tab. tab (QWidget object) – The created options tab. name (str) – The name of this options tab as provided with name. This variable is mainly returned such that it is easier to pass tab names between functions.
create_tab_appearance()[source]

Creates the ‘Appearance’ tab and returns it.

create_tab_general()[source]

Creates the ‘General’ tab and returns it.

disable_save_button()[source]

Qt slot that disables the save button at the bottom of the options dialog. The save button is disabled whenever no changes have been made to any option entry.

discard_options()[source]

Discards the current values of all option entries and sets them back to their saved values.

This function acts as a Qt slot.

enable_save_button()[source]

Qt slot that enables the save button at the bottom of the options dialog. The save button is enabled if at least one change has been made to any option entry.

get_option(name)[source]

Returns the value of the option entry associated with the given name.

init()[source]

Sets up the options dialog after it has been initialized.

This function is mainly responsible for initializing all option entries that the GUI has, and creating a database for them. It also creates the layout of the options dialog.

reset_options()[source]

Resets the saved and current values of all option entries back to their default values.

This function acts as a Qt slot.

save_options()[source]

Saves all current values of all option entries.

Option entries that affect projection parameters are automatically modified as well.

This function acts as a Qt slot.

class prism._gui.widgets.preferences.options.OptionsEntry(parent, name, box, default)[source]

Defines the OptionsEntry class.

This class is used as a container for making option entries in the OptionsDialog class.

__init__(parent, name, box, default)[source]

Initialize an instance of the OptionsEntry class.

Parameters: parent (QWidget object) – The widget to use as the parent of this entry. name (str) – The name of this options entry. box (QWidget object) – The widget that will hold the values of this entry. default (object) – The default value of this entry.
discard_value()[source]

Qt slot that discards the current value and sets it back to its saved value.

init()[source]

Sets up the options entry after it has been initialized.

This function is mainly responsible for making sure that the current and saved values of this entry are set to its default value.

reset_value()[source]

Qt slot that resets the current value of this options entry to its default value.

save_value()[source]

Qt slot that saves the current value of this options entry.

box

The widget box that contains this options entry.

Type: QWidget object
default

The default value of this options entry.

Type: object
name

The name of this options entry.

Type: str
value

The currently saved value of this options entry.

Type: object