Settings module¶
This module handles all operations involving the user’s settings.
-
class
Settings.Setting¶ Bases:
enum.EnumAn enum of all settings
-
CONCURRENT_REPORTS= 5¶
-
CONCURRENT_VENDORS= 4¶
-
OTHER_DIR= 1¶
-
REQUEST_INTERVAL= 2¶
-
REQUEST_TIMEOUT= 3¶
-
USER_AGENT= 6¶
-
YEARLY_DIR= 0¶
-
-
class
Settings.SettingsController(settings_widget, settings_ui)¶ Bases:
PyQt5.QtCore.QObjectControls the Settings tab
- Parameters
settings_widget (
QWidget) – The settings widget.settings_ui (
Ui_settings_tab) – The UI for settings_widget.
-
on_directory_setting_clicked(setting)¶ Handles the signal emitted when a choose folder button is clicked
- Parameters
setting (
Setting) – The setting to be changed
-
on_rebuild_database_clicked()¶ Restores the database when the restore database button is clicked
Handles the signal emitted when the save button is clicked
-
save_settings_to_disk()¶ Saves all settings to disk
-
settings_changed_signal¶
-
update_settings()¶ Updates the app’s settings using the values entered on the UI
-
class
Settings.SettingsModel(show_debug_messages, yearly_directory, other_directory, request_interval, request_timeout, concurrent_vendors, concurrent_reports, user_agent, default_currency)¶ Bases:
GeneralUtils.JsonModelThis holds the user’s settings.
- Parameters
yearly_directory (
str) – The directory where yearly reports are saved. Yearly reports are reports that include all the available data for a year.other_directory (
str) – The default directory where non-yearly reports are saved.request_interval (
int) – The time to wait between each report request, per vendor.request_timeout (
int) – The time to wait before timing out a connection (seconds).concurrent_vendors (
int) – The max number of vendors to work on at a time.concurrent_reports (
int) – The max number of reports to work on at a time, per vendor.user_agent (
str) – The user-agent that’s included in the header when making requests.
-
classmethod
from_json(json_dict)¶