wonambi.widgets.settings module
Large and simple widget to indicate settings/Settings.
- class wonambi.widgets.settings.Config(widget, update_widget)[source]
Bases:
QWidget
Base class for widgets used in the Settings.
- Parameters:
widget (str) – name of the widget
update_widget (function) – function to run to update the main window with new values
- modified
if the preference widget has been changed
- Type:
bool
- value
dictionary with the actual current values
- Type:
dict
- index
dictionary with the instances of the small widgets
- Type:
dict
Notes
You’ll need to implement create_config with the QGroupBox and layouts
- create_indices(value_names)[source]
Create empty indices as None. They’ll be created by create_config.
- create_values(value_names)[source]
Read original values from the settings or the defaults.
- Parameters:
value_names (list of str) – list of value names to read
- Returns:
dict – dictionary with the value names as keys
- class wonambi.widgets.settings.HelpDialog[source]
Bases:
QDialog
Generic help dialog, showing uneditable HTML text.
- class wonambi.widgets.settings.Settings(parent)[source]
Bases:
QDialog
Window showing the Settings/settings.
- Parameters:
parent (instance of QMainWindow) – the main window
- button_clicked(button)[source]
Action when button was clicked.
- Parameters:
button (instance of QPushButton) – which button was pressed
- wonambi.widgets.settings.read_settings(widget, value_name)[source]
Read Settings information, either from INI or from default values.
- Parameters:
widget (str) – name of the widget
value_name (str) – name of the value of interest.
- Returns:
multiple types – type depends on the type in the default values. We make it more flexible so that if the default type is int, it accepts float