spinetoolbox.widgets.settings_widget

Widget for controlling user settings.

author:
  1. Savolainen (VTT)
date:

17.1.2018

Module Contents

Classes

SettingsWidgetBase Initialize class.
SpineDBEditorSettingsMixin
SpineDBEditorSettingsWidget A widget to change user’s preferred settings, but only for the Spine db editor.
SettingsWidget A widget to change user’s preferred settings.
class spinetoolbox.widgets.settings_widget.SettingsWidgetBase(qsettings)[source]

Bases: PySide2.QtWidgets.QWidget

Initialize class.

connect_signals(self)[source]

Connect signals.

keyPressEvent(self, e)[source]

Close settings form when escape key is pressed.

Parameters:e (QKeyEvent) – Received key press event.
mousePressEvent(self, e)[source]

Save mouse position at the start of dragging.

Parameters:e (QMouseEvent) – Mouse event
mouseReleaseEvent(self, e)[source]

Save mouse position at the end of dragging.

Parameters:e (QMouseEvent) – Mouse event
mouseMoveEvent(self, e)[source]

Moves the window when mouse button is pressed and mouse cursor is moved.

Parameters:e (QMouseEvent) – Mouse event
update_ui(self)[source]

Updates UI to reflect current settings. Called when the user choses to cancel their changes. Undoes all temporary UI changes that resulted from the user playing with certain settings.

save_settings(self)[source]

Gets selections and saves them to persistent memory.

update_ui_and_close(self, checked=False)[source]

Updates UI to reflect current settings and close.

save_and_close(self, checked=False)[source]

Saves settings and close.

class spinetoolbox.widgets.settings_widget.SpineDBEditorSettingsMixin[source]
connect_signals(self)[source]

Connect signals.

set_show_cascading_relationships(self, checked=False)[source]
read_settings(self)[source]

Read saved settings from app QSettings instance and update UI to display them.

save_settings(self)[source]

Get selections and save them to persistent memory.

update_ui(self)[source]
class spinetoolbox.widgets.settings_widget.SpineDBEditorSettingsWidget(db_mngr)[source]

Bases: spinetoolbox.widgets.settings_widget.SpineDBEditorSettingsMixin, spinetoolbox.widgets.settings_widget.SettingsWidgetBase

A widget to change user’s preferred settings, but only for the Spine db editor.

Initialize class.

show(self)[source]
class spinetoolbox.widgets.settings_widget.SettingsWidget(toolbox)[source]

Bases: spinetoolbox.widgets.settings_widget.SpineDBEditorSettingsMixin, spinetoolbox.widgets.settings_widget.SettingsWidgetBase

A widget to change user’s preferred settings.

Parameters:toolbox (ToolboxUI) – Parent widget.
connect_signals(self)[source]

Connect signals.

browse_gams_path(self, checked=False)[source]

Open file browser where user can select a GAMS program.

browse_julia_button_clicked(self, checked=False)[source]

Calls static method that shows a file browser for selecting the Julia path.

browse_julia_project_button_clicked(self, checked=False)[source]

Calls static method that shows a file browser for selecting a Julia project.

browse_python_button_clicked(self, checked=False)[source]

Calls static method that shows a file browser for selecting Python interpreter.

show_python_kernel_editor(self, checked=False)[source]

Opens kernel editor, where user can make a kernel for the Python Console.

python_kernel_editor_closed(self, ret_code)[source]

Catches the selected Python kernel name when the editor is closed.

show_julia_kernel_editor(self, checked=False)[source]

Opens kernel editor, where user can make a kernel the Julia Console.

julia_kernel_editor_closed(self, ret_code)[source]

Catches the selected Julia kernel name when the editor is closed.

browse_work_path(self, checked=False)[source]

Open file browser where user can select the path to wanted work directory.

show_color_dialog(self, checked=False)[source]

Let user pick the bg color.

Parameters:checked (boolean) – Value emitted with clicked signal
update_bg_color(self)[source]

Set tool button icon as the selected color and update Design View scene background color.

update_scene_bg(self, checked=False)[source]

Draw background on scene depending on radiobutton states.

Parameters:checked (boolean) – Toggle state
toggle_julia_execution_mode(self, checked=False)[source]

Toggles between console and non-console Julia execution modes depending on radiobutton states.

Parameters:checked (boolean) – Toggle state
toggle_python_execution_mode(self, checked=False)[source]

Toggles between console and non-console Python execution modes depending on radiobutton states.

Parameters:checked (boolean) – Toggle state
read_settings(self)[source]

Read saved settings from app QSettings instance and update UI to display them.

read_project_settings(self)[source]

Get project name and description and update widgets accordingly.

save_settings(self)[source]

Get selections and save them to persistent memory. Note: On Linux, True and False are saved as boolean values into QSettings. On Windows, booleans and integers are saved as strings. To make it consistent, we should use strings.

update_project_settings(self)[source]

Update project name and description if these have been changed.

check_if_work_dir_changed(self, new_work_dir)[source]

Checks if work directory was changed.

Parameters:new_work_dir (str) – Possibly a new work directory
update_ui(self)[source]

Updates UI to reflect current settings. Called when the user choses to cancel their changes. Undoes all temporary UI changes that resulted from the user playing with certain settings.