spinetoolbox.widgets.settings_widget
¶
Widget for controlling user settings.
author: |
|
---|---|
date: | 17.1.2018 |
Module Contents¶
-
class
spinetoolbox.widgets.settings_widget.
SettingsWidget
(toolbox)[source]¶ Bases:
PySide2.QtWidgets.QWidget
A widget to change user’s preferred settings.
Initialize class.
-
browse_gams_path
(self, checked=False)[source]¶ Open file browser where user can select a GAMS program.
-
browse_julia_path
(self, checked=False)[source]¶ Open file browser where user can select a Julia executable (i.e. julia.exe on Windows).
-
browse_julia_project_path
(self, checked=False)[source]¶ Open file browser where user can select a Julia project path.
-
browse_python_path
(self, checked=False)[source]¶ Open file browser where user can select a python interpreter (i.e. python.exe on Windows).
-
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
-
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.
-
handle_ok_clicked
(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_python_env_changed
(self, new_path)[source]¶ Checks if Python environment was changed. This indicates that the Python Console may need a restart.
-
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
-
file_is_valid
(self, file_path, msgbox_title)[source]¶ Checks that given path is not a directory and it’s a file that actually exists. Needed because the QLineEdits are editable.
-
dir_is_valid
(self, dir_path, msgbox_title)[source]¶ Checks that given path is a directory. Needed because the QLineEdits are editable.
-
keyPressEvent
(self, e)[source]¶ Close settings form when escape key is pressed.
Parameters: e (QKeyEvent) – Received key press event.
-
closeEvent
(self, event=None)[source]¶ Handle close window.
Parameters: event (QEvent) – Closing event if ‘X’ is clicked.
-
mousePressEvent
(self, e)[source]¶ Save mouse position at the start of dragging.
Parameters: e (QMouseEvent) – Mouse event
-