GUI Kwargs Dicts Options¶
Provides a custom QDialog subclass that allows for
the projection keyword argument dicts to be modified properly in the Projection
GUI preferences.
-
class
prism._gui.widgets.preferences.kwargs_dicts.KwargsDictBoxLayout(options_dialog_obj, *args, **kwargs)[source]¶ Defines the
KwargsDictBoxLayoutclass for the preferences window.This class provides the options entry box that gives the user access to a separate window, where the various different keyword dicts can be modified.
-
__init__(options_dialog_obj, *args, **kwargs)[source]¶ Initialize an instance of the
KwargsDictBoxLayoutclass.Parameters: options_dialog_obj (
OptionsDialogobject) – Instance of theOptionsDialogclass that acts as the parent of theKwargsDictDialogthis layout creates.Other Parameters: - args (positional arguments) – The positional arguments that must be passed to the constructor of
the
QHBoxLayoutclass. - kwargs (keyword arguments) – The keyword arguments that must be passed to the constructor of the
QHBoxLayoutclass.
- args (positional arguments) – The positional arguments that must be passed to the constructor of
the
-
add_dict(*args, **kwargs)[source]¶ Adds a new kwargs dict to the box layout, by calling the
add_page()method using the provided args and kwargs.
-
init()[source]¶ Sets up the box layout after it has been initialized.
This function is mainly responsible for initializing the
KwargsDictDialogclass and binding it.
-
-
class
prism._gui.widgets.preferences.kwargs_dicts.KwargsDictDialog(options_dialog_obj, *args, **kwargs)[source]¶ Defines the
KwargsDictDialogclass for the preferences window.This class provides the ‘Projection keyword argument dicts’ dialog, which allows for the various different kwargs dicts to be modified by the user.
-
__call__()[source]¶ Qt slot that shows the kwargs dict dialog in the center of the preferences window.
-
__init__(options_dialog_obj, *args, **kwargs)[source]¶ Initialize an instance of the
KwargsDictDialogclass.Parameters: options_dialog_obj (
OptionsDialogobject) – Instance of theOptionsDialogclass that acts as the parent of this dialog.Other Parameters: - args (positional arguments) – The positional arguments that must be passed to the constructor of
the
QDialogclass. - kwargs (keyword arguments) – The keyword arguments that must be passed to the constructor of the
QDialogclass.
- args (positional arguments) – The positional arguments that must be passed to the constructor of
the
-
add_page(name, option_key, tooltip, *args, **kwargs)[source]¶ Initializes a new
KwargsDictDialogPageobject with name name and adds it to this dialog.Parameters: - name (str) – The name that this kwargs dict page will have.
- option_key (str) – The name of the options entry that this page will create.
The value of option_key must correspond to the name the
associated dict has in the
project()method. - tooltip (str) – The tooltip that must be used for this kwargs dict page.
Other Parameters: - args (positional arguments) – The positional arguments that must be passed to the constructor of
the
KwargsDictDialogPageclass. - kwargs (keyword arguments) – The keyword arguments that must be passed to the constructor of the
KwargsDictDialogPageclass.
-
-
class
prism._gui.widgets.preferences.kwargs_dicts.KwargsDictDialogPage(kwargs_dict_dialog_obj, name, std_entries, banned_entries, *args, **kwargs)[source]¶ Defines the
KwargsDictDialogPageclass for the kwargs dict dialog.This class provides the tab/page in the kwargs dict dialog where the items of the associated kwargs dict can be viewed and modified by the user.
-
__init__(kwargs_dict_dialog_obj, name, std_entries, banned_entries, *args, **kwargs)[source]¶ Initialize an instance of the
KwargsDictDialogPageclass.Parameters: - kwargs_dict_dialog_obj (
KwargsDictDialogobject) – Instance of theKwargsDictDialogclass that initialized this kwargs dict page. - name (str) – The name of this kwargs dict page.
- std_entries (list of str) – A list of all standard entry types that this kwargs dict should accept.
- banned_entries (list of str) – A list of all entry types that this kwargs dict should not accept. Usually, these entry types are used by PRISM and therefore should not be modified by the user.
Other Parameters: - kwargs_dict_dialog_obj (
-
add_editable_entry()[source]¶ Adds a new editable entry to the kwargs dict page, which allows for the user to edit the contents of the kwargs dict.
This function acts as a Qt slot.
-
entry_type_selected(entry_type, kwargs_box)[source]¶ Qt slot that modifies the field box associated with the provided kwargs_box to given entry_type.
Parameters: - entry_type (str) – The entry type that is requested for the field box.
- kwargs_box (
QW_QEditableComboBoxobject) – The combobox that is used for setting the entry type of this entry.
-
get_box_value()[source]¶ Returns the current value of the kwargs dict page.
Returns: page_dict (dict) – A dict containing all valid entries that are currently on this kwargs dict page. Any invalid entries (banned or empty ones) are ignored.
-
init()[source]¶ Sets up the kwargs dict page after it has been initialized.
This function is mainly responsibe for creating the layout of the page; determining what entry types are available; and preparing for the user to add entries.
-
remove_editable_entry(kwargs_box)[source]¶ Removes the editable entry associated with the provided kwargs_box.
This function acts as a Qt slot.
Parameters: kwargs_box ( QW_QEditableComboBoxobject) – The combobox that is used for setting the entry type of this entry.
-