fosKeyMan
|
Manage the loading, saving, and validation of configuration settings for directories. More...
Public Member Functions | |
__init__ (self, config_path) | |
Initialize the ConfigManager with the path to the configuration file. | |
check_and_load_previous_config (self) | |
Load and check if previously saved directories are valid. | |
confirm_directory_selection (self, dialog, open_ui) | |
Confirm the directory selection made by the user. | |
create_default_config (self) | |
Create a default configuration file. | |
load_config (self) | |
Load the configuration file. | |
save_config (self) | |
Save the current directory paths to the configuration file. | |
select_directory1 (self, dialog, open_ui) | |
Open a file dialog for the user to select the first (activated keyfile) directory. | |
select_directory2 (self, dialog, open_ui) | |
Open a file dialog for the user to select the second (deactivated keyfile) directory. | |
select_directory3 (self, dialog, open_ui) | |
Open a file dialog for the user to select the trash directory. | |
Public Attributes | |
config = self.load_config() | |
config_path = config_path | |
list | custom_columns = None |
directory1 = None | |
directory2 = None | |
directory3 = None | |
str | language = None |
Static Public Attributes | |
list | DEFAULT_COLUMNS = ["Project", "Operator", "Specimen", "DFOS_Type", "Installation", "Note"] |
Manage the loading, saving, and validation of configuration settings for directories.
Language setting for the user interface (e.g., 'english' or 'german'). Handle user interaction for selecting directories, and ensures that the configuration is correctly loaded from and saved to a JSON file.
Definition at line 7 of file configmanager.py.
src.frontend.configmanager.ConfigManager.__init__ | ( | self, | |
config_path ) |
Initialize the ConfigManager with the path to the configuration file.
config_path | (str): The file path where the configuration is stored. |
Definition at line 16 of file configmanager.py.
src.frontend.configmanager.ConfigManager.check_and_load_previous_config | ( | self | ) |
Load and check if previously saved directories are valid.
Definition at line 77 of file configmanager.py.
src.frontend.configmanager.ConfigManager.confirm_directory_selection | ( | self, | |
dialog, | |||
open_ui ) |
Confirm the directory selection made by the user.
Validate that both directories exist, and close the dialog if valid.
dialog | (QDialog): The dialog window that allows the user to select directories. |
open_ui | (QWidget): The UI that contains the directory input fields. |
Definition at line 146 of file configmanager.py.
src.frontend.configmanager.ConfigManager.create_default_config | ( | self | ) |
Create a default configuration file.
Default language is English.
Definition at line 31 of file configmanager.py.
src.frontend.configmanager.ConfigManager.load_config | ( | self | ) |
Load the configuration file.
If it doesn't exist or has errors, return an empty configuration.
Definition at line 48 of file configmanager.py.
src.frontend.configmanager.ConfigManager.save_config | ( | self | ) |
Save the current directory paths to the configuration file.
Definition at line 63 of file configmanager.py.
src.frontend.configmanager.ConfigManager.select_directory1 | ( | self, | |
dialog, | |||
open_ui ) |
Open a file dialog for the user to select the first (activated keyfile) directory.
dialog | (QDialog): The dialog window that allows the user to select directories. |
open_ui | (QWidget): The UI that contains the directory input fields. |
Definition at line 110 of file configmanager.py.
src.frontend.configmanager.ConfigManager.select_directory2 | ( | self, | |
dialog, | |||
open_ui ) |
Open a file dialog for the user to select the second (deactivated keyfile) directory.
dialog | (QDialog): The dialog window that allows the user to select directories. |
open_ui | (QWidget): The UI that contains the directory input fields. |
Definition at line 122 of file configmanager.py.
src.frontend.configmanager.ConfigManager.select_directory3 | ( | self, | |
dialog, | |||
open_ui ) |
Open a file dialog for the user to select the trash directory.
dialog | (QDialog): The dialog window that allows the user to select directories. |
open_ui | (QWidget): The UI that contains the directory input fields. |
Definition at line 134 of file configmanager.py.
src.frontend.configmanager.ConfigManager.config = self.load_config() |
Definition at line 29 of file configmanager.py.
src.frontend.configmanager.ConfigManager.config_path = config_path |
Definition at line 23 of file configmanager.py.
list src.frontend.configmanager.ConfigManager.custom_columns = None |
Definition at line 28 of file configmanager.py.
|
static |
Definition at line 14 of file configmanager.py.
src.frontend.configmanager.ConfigManager.directory1 = None |
Definition at line 24 of file configmanager.py.
src.frontend.configmanager.ConfigManager.directory2 = None |
Definition at line 25 of file configmanager.py.
src.frontend.configmanager.ConfigManager.directory3 = None |
Definition at line 26 of file configmanager.py.
src.frontend.configmanager.ConfigManager.language = None |
Definition at line 27 of file configmanager.py.