fosKeyMan
Loading...
Searching...
No Matches
src.frontend.mainwindow.MainWindow Class Reference

Main User Interface for the application. More...

Inheritance diagram for src.frontend.mainwindow.MainWindow:

Public Member Functions

 __init__ (self)
 
 adjust_window_size (self)
 Dynamically adapts window size to available screen space.
 
 check_activation_status (self, serial_number)
 Check the activation status for a given serial number.
 
 closeEvent (self, event)
 Triggered when user clicks X to close the window.
 
 connect_actions (self)
 Connect UI actions to corresponding methods.
 
 create_status_button (self, status)
 Creates a colored QPushButton based on its activation status.
 
 delete_keyfile (self)
 Delete selected keyfiles and move them to trash directory.
 
 execute_search (self)
 Perform search based on the selected key item in the comboBox and display the results in TextBrowser.
 
 exit_application (self)
 Method to handle application exit.
 
 get_checked_serial_numbers (self)
 Retrieve serial numbers for rows where the checkbox is checked.
 
 initialize_handlers (self)
 Initialize KeyHandler and FolderContent based on the selected directory paths.
 
 keyfile_export (self)
 Export selected keyfiles from activated or deactivated directories to an external directory.
 
 keyfile_import (self)
 Import selected .od6pkg keyfiles as extracted folders into the deactivated directory.
 
 open_column_configurator (self)
 Open a dialog to configure table columns.
 
 open_documentation (self)
 Open the Doxygen generated documentation web page.
 
 open_filter_widget (self)
 Control visibility of filter widget.
 
 open_info_widget (self)
 Control visibility of extra information widget.
 
 open_json_edit_dialog (self)
 Open a dialog to edit metadata of the selected keyfile.
 
 open_search_widget (self)
 Control visibility of full text search widget.
 
 open_setting_dialog (self)
 Open a dialog for selecting two directories.
 
 open_trash_manage_dialog (self)
 Open a dialog that displays deleted keyfiles and allows user to restore or permanently delete them.
 
 populate_search_combobox (self)
 Populate QComboBox with the keyfiles.
 
 populate_table (self)
 Load activated and deactivated keys, set their status, and fill in all related metadata fields.
 
 rename_sensor_name (self)
 Rename the sensor name.
 
 reset_all_checkboxes (self)
 Reset all checkboxes in the table to an unchecked state.
 
 save_as_json (self)
 Save the contents of the table to 'metadata.json' file inside each corresponding keyfile directory.
 
 save_current_column_order (self)
 Save the current order of custom columns based on the table's visual layout (only applies to customized columns; fixed columns are not affected).
 
 set_columns_background_color (self, columns)
 Apply a light gray background color to the specified columns.
 
 set_columns_read_only (self, columns)
 Set the specified columns to read-only.
 
 setup_filter_dockwidget (self)
 Dynamically set up the filter dock widget based on the current table columns.
 
 setup_table (self)
 Set up the table with the necessary headers, styles, and configurations.
 
 show_about_dialog (self)
 Open a dialog displaying information about the software.
 
 show_and_check_config (self)
 Show the main window and check the configuration.
 
 switch_language (self, language)
 Switch the UI language and save it to the configuration file.
 
 table_cell_info (self, row, column)
 Display relevant information on the right side panel for the selected table cell.
 
 toggle_activation (self)
 Activate the selected items (checkbox is checked) in the table.
 
 toggle_deactivation (self)
 Deactivate the selected item (checkbox is checked) in the table.
 
 update_table_row (self, serial_numbers)
 Update specific rows in the table given a list of serial numbers.
 

Public Attributes

 config_manager = ConfigManager(file_path('fosKeyManConfig.json'))
 
 custom_columns = self.config_manager.check_and_load_previous_config()
 
 delete_keyfile
 
 directory1 = None
 
 directory2 = None
 
 directory3 = None
 
dict dynamic_filter_inputs = {}
 
 execute_search
 
 exit_application
 
 folder_content = None
 
 hover_info = HoverInfo(self.ui.tableWidget, self)
 
 key_handler = None
 
 keyfile_export
 
 keyfile_import
 
 language
 
 open_column_configurator
 
 open_documentation
 
 open_filter_widget
 
 open_info_widget
 
 open_json_edit_dialog
 
 open_search_widget
 
 open_setting_dialog
 
 open_trash_manage_dialog
 
 rename_sensor_name
 
 save_as_json
 
 setup_table
 
 show_about_dialog
 
 table_cell_info
 
 table_operator = TableOperator(self.ui.tableWidget)
 
 toggle_activation
 
 toggle_deactivation
 
 translator = QTranslator(self)
 
 ui = Ui_MainWindow()
 

Detailed Description

Main User Interface for the application.

This class represents the main window of the application, which includes setting up the UI, loading configurations, initializing handlers, setting up the table, and connecting various actions for user interaction.

Definition at line 46 of file mainwindow.py.

Constructor & Destructor Documentation

◆ __init__()

src.frontend.mainwindow.MainWindow.__init__ ( self)

Definition at line 53 of file mainwindow.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ adjust_window_size()

src.frontend.mainwindow.MainWindow.adjust_window_size ( self)

Dynamically adapts window size to available screen space.

Definition at line 75 of file mainwindow.py.

◆ check_activation_status()

src.frontend.mainwindow.MainWindow.check_activation_status ( self,
serial_number )

Check the activation status for a given serial number.

Parameters
serial_number(str): The serial number to check.
Returns
(ActivationStatus): The activation status of the given serial number, or None if not found.

Definition at line 558 of file mainwindow.py.

Here is the caller graph for this function:

◆ closeEvent()

src.frontend.mainwindow.MainWindow.closeEvent ( self,
event )

Triggered when user clicks X to close the window.

Definition at line 891 of file mainwindow.py.

Here is the call graph for this function:

◆ connect_actions()

src.frontend.mainwindow.MainWindow.connect_actions ( self)

Connect UI actions to corresponding methods.

Definition at line 166 of file mainwindow.py.

Here is the call graph for this function:

◆ create_status_button()

src.frontend.mainwindow.MainWindow.create_status_button ( self,
status )

Creates a colored QPushButton based on its activation status.

The button will be colored differently depending on whether the status is 'Activated' or 'Deactivated'. The button is not clickable and will display the status text.

Parameters
status(str): The activation status ('Activated', 'Deactivated').
Returns
(QWidget): A QWidget containing the styled QPushButton for status display.

Definition at line 792 of file mainwindow.py.

Here is the caller graph for this function:

◆ delete_keyfile()

src.frontend.mainwindow.MainWindow.delete_keyfile ( self)

Delete selected keyfiles and move them to trash directory.

Definition at line 459 of file mainwindow.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute_search()

src.frontend.mainwindow.MainWindow.execute_search ( self)

Perform search based on the selected key item in the comboBox and display the results in TextBrowser.

Definition at line 940 of file mainwindow.py.

◆ exit_application()

src.frontend.mainwindow.MainWindow.exit_application ( self)

Method to handle application exit.

Definition at line 886 of file mainwindow.py.

Here is the call graph for this function:

◆ get_checked_serial_numbers()

src.frontend.mainwindow.MainWindow.get_checked_serial_numbers ( self)

Retrieve serial numbers for rows where the checkbox is checked.

Definition at line 571 of file mainwindow.py.

Here is the caller graph for this function:

◆ initialize_handlers()

src.frontend.mainwindow.MainWindow.initialize_handlers ( self)

Initialize KeyHandler and FolderContent based on the selected directory paths.

If success, set up the table for further operations.

Definition at line 522 of file mainwindow.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyfile_export()

src.frontend.mainwindow.MainWindow.keyfile_export ( self)

Export selected keyfiles from activated or deactivated directories to an external directory.

Compress each keyfile folder into .od6pkg format.

Definition at line 404 of file mainwindow.py.

Here is the call graph for this function:

◆ keyfile_import()

src.frontend.mainwindow.MainWindow.keyfile_import ( self)

Import selected .od6pkg keyfiles as extracted folders into the deactivated directory.

Conflicts are handled based on user choice.

Definition at line 340 of file mainwindow.py.

◆ open_column_configurator()

src.frontend.mainwindow.MainWindow.open_column_configurator ( self)

Open a dialog to configure table columns.

Save the selected columns to config.json and refresh the table and filter in the UI.

Definition at line 226 of file mainwindow.py.

Here is the call graph for this function:

◆ open_documentation()

src.frontend.mainwindow.MainWindow.open_documentation ( self)

Open the Doxygen generated documentation web page.

Definition at line 921 of file mainwindow.py.

◆ open_filter_widget()

src.frontend.mainwindow.MainWindow.open_filter_widget ( self)

Control visibility of filter widget.

Definition at line 588 of file mainwindow.py.

◆ open_info_widget()

src.frontend.mainwindow.MainWindow.open_info_widget ( self)

Control visibility of extra information widget.

Definition at line 592 of file mainwindow.py.

◆ open_json_edit_dialog()

src.frontend.mainwindow.MainWindow.open_json_edit_dialog ( self)

Open a dialog to edit metadata of the selected keyfile.

Update the table row and the metadata.json file after editing is completed .

Definition at line 206 of file mainwindow.py.

Here is the call graph for this function:

◆ open_search_widget()

src.frontend.mainwindow.MainWindow.open_search_widget ( self)

Control visibility of full text search widget.

Definition at line 596 of file mainwindow.py.

◆ open_setting_dialog()

src.frontend.mainwindow.MainWindow.open_setting_dialog ( self)

Open a dialog for selecting two directories.

If valid, initialize KeyHandler and FolderContent, and save the paths to the config.json file.

Definition at line 490 of file mainwindow.py.

Here is the call graph for this function:

◆ open_trash_manage_dialog()

src.frontend.mainwindow.MainWindow.open_trash_manage_dialog ( self)

Open a dialog that displays deleted keyfiles and allows user to restore or permanently delete them.

Definition at line 482 of file mainwindow.py.

◆ populate_search_combobox()

src.frontend.mainwindow.MainWindow.populate_search_combobox ( self)

Populate QComboBox with the keyfiles.

Definition at line 926 of file mainwindow.py.

Here is the caller graph for this function:

◆ populate_table()

src.frontend.mainwindow.MainWindow.populate_table ( self)

Load activated and deactivated keys, set their status, and fill in all related metadata fields.

Definition at line 730 of file mainwindow.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rename_sensor_name()

src.frontend.mainwindow.MainWindow.rename_sensor_name ( self)

Rename the sensor name.

Only work for the first selected entry.

Definition at line 535 of file mainwindow.py.

Here is the call graph for this function:

◆ reset_all_checkboxes()

src.frontend.mainwindow.MainWindow.reset_all_checkboxes ( self)

Reset all checkboxes in the table to an unchecked state.

Definition at line 581 of file mainwindow.py.

Here is the caller graph for this function:

◆ save_as_json()

src.frontend.mainwindow.MainWindow.save_as_json ( self)

Save the contents of the table to 'metadata.json' file inside each corresponding keyfile directory.

If the JSON file exists, update it; if it does not exist, create and save a new file.

Definition at line 241 of file mainwindow.py.

Here is the call graph for this function:

◆ save_current_column_order()

src.frontend.mainwindow.MainWindow.save_current_column_order ( self)

Save the current order of custom columns based on the table's visual layout (only applies to customized columns; fixed columns are not affected).

Update the configuration and write the new column order to config.json.

Definition at line 896 of file mainwindow.py.

Here is the caller graph for this function:

◆ set_columns_background_color()

src.frontend.mainwindow.MainWindow.set_columns_background_color ( self,
columns )

Apply a light gray background color to the specified columns.

Parameters
columns(List[int]): A list of column indices (integers) to apply the background color.

Definition at line 718 of file mainwindow.py.

Here is the caller graph for this function:

◆ set_columns_read_only()

src.frontend.mainwindow.MainWindow.set_columns_read_only ( self,
columns )

Set the specified columns to read-only.

These columns will still allow user interaction like selection and clicking, but their content will not be editable

Parameters
columns(List[int]): A list of column indices that should be set to read-only.

Definition at line 705 of file mainwindow.py.

Here is the caller graph for this function:

◆ setup_filter_dockwidget()

src.frontend.mainwindow.MainWindow.setup_filter_dockwidget ( self)

Dynamically set up the filter dock widget based on the current table columns.

Definition at line 103 of file mainwindow.py.

Here is the caller graph for this function:

◆ setup_table()

src.frontend.mainwindow.MainWindow.setup_table ( self)

Set up the table with the necessary headers, styles, and configurations.

Enables the ability to drag and move columns for custom arrangement. Sets certain columns as read-only to prevent unintended modification. Populate table with data in metadata.json, and connect a cell click event to display additional information.

Definition at line 635 of file mainwindow.py.

Here is the call graph for this function:

◆ show_about_dialog()

src.frontend.mainwindow.MainWindow.show_about_dialog ( self)

Open a dialog displaying information about the software.

Definition at line 301 of file mainwindow.py.

Here is the call graph for this function:

◆ show_and_check_config()

src.frontend.mainwindow.MainWindow.show_and_check_config ( self)

Show the main window and check the configuration.

Switch the language based on the saved configuration.

If all required paths (directory1, directory2) are valid, it will set up the table. If any of the paths are missing, it will open the setting dialog for the user to initialize the configuration.

Definition at line 87 of file mainwindow.py.

Here is the call graph for this function:

◆ switch_language()

src.frontend.mainwindow.MainWindow.switch_language ( self,
language )

Switch the UI language and save it to the configuration file.

Parameters
language(str): The target language, either 'English' or 'German'.

Definition at line 867 of file mainwindow.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ table_cell_info()

src.frontend.mainwindow.MainWindow.table_cell_info ( self,
row,
column )

Display relevant information on the right side panel for the selected table cell.

Parameters
row(int): The row index of the selected table cell.
column(int): The column index of the selected table cell.

Definition at line 600 of file mainwindow.py.

◆ toggle_activation()

src.frontend.mainwindow.MainWindow.toggle_activation ( self)

Activate the selected items (checkbox is checked) in the table.

For valid items, the keyfile moved from deactivated directory to activate directory. Upon successful activation, the item's status is updated to 'Activated' and the status button is turn green.

Definition at line 833 of file mainwindow.py.

Here is the call graph for this function:

◆ toggle_deactivation()

src.frontend.mainwindow.MainWindow.toggle_deactivation ( self)

Deactivate the selected item (checkbox is checked) in the table.

For valid items, the keyfile moved from the activated directory to the deactivated directory. Upon successful deactivation, the item's status is updated to 'Deactivated', and the status button turns grey.

Definition at line 850 of file mainwindow.py.

Here is the call graph for this function:

◆ update_table_row()

src.frontend.mainwindow.MainWindow.update_table_row ( self,
serial_numbers )

Update specific rows in the table given a list of serial numbers.

Parameters
serial_numbers(List[str]): A list of serial numbers for the rows to be updated.

Definition at line 964 of file mainwindow.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ config_manager

src.frontend.mainwindow.MainWindow.config_manager = ConfigManager(file_path('fosKeyManConfig.json'))

Definition at line 63 of file mainwindow.py.

◆ custom_columns

src.frontend.mainwindow.MainWindow.custom_columns = self.config_manager.check_and_load_previous_config()

Definition at line 64 of file mainwindow.py.

◆ delete_keyfile

src.frontend.mainwindow.MainWindow.delete_keyfile

Definition at line 194 of file mainwindow.py.

◆ directory1

src.frontend.mainwindow.MainWindow.directory1 = None

Definition at line 58 of file mainwindow.py.

◆ directory2

src.frontend.mainwindow.MainWindow.directory2 = None

Definition at line 59 of file mainwindow.py.

◆ directory3

src.frontend.mainwindow.MainWindow.directory3 = None

Definition at line 60 of file mainwindow.py.

◆ dynamic_filter_inputs

src.frontend.mainwindow.MainWindow.dynamic_filter_inputs = {}

Definition at line 73 of file mainwindow.py.

◆ execute_search

src.frontend.mainwindow.MainWindow.execute_search

Definition at line 70 of file mainwindow.py.

◆ exit_application

src.frontend.mainwindow.MainWindow.exit_application

Definition at line 197 of file mainwindow.py.

◆ folder_content

src.frontend.mainwindow.MainWindow.folder_content = None

Definition at line 62 of file mainwindow.py.

◆ hover_info

src.frontend.mainwindow.MainWindow.hover_info = HoverInfo(self.ui.tableWidget, self)

Definition at line 68 of file mainwindow.py.

◆ key_handler

src.frontend.mainwindow.MainWindow.key_handler = None

Definition at line 61 of file mainwindow.py.

◆ keyfile_export

src.frontend.mainwindow.MainWindow.keyfile_export

Definition at line 200 of file mainwindow.py.

◆ keyfile_import

src.frontend.mainwindow.MainWindow.keyfile_import

Definition at line 199 of file mainwindow.py.

◆ language

src.frontend.mainwindow.MainWindow.language

Definition at line 64 of file mainwindow.py.

◆ open_column_configurator

src.frontend.mainwindow.MainWindow.open_column_configurator

Definition at line 204 of file mainwindow.py.

◆ open_documentation

src.frontend.mainwindow.MainWindow.open_documentation

Definition at line 198 of file mainwindow.py.

◆ open_filter_widget

src.frontend.mainwindow.MainWindow.open_filter_widget

Definition at line 180 of file mainwindow.py.

◆ open_info_widget

src.frontend.mainwindow.MainWindow.open_info_widget

Definition at line 181 of file mainwindow.py.

◆ open_json_edit_dialog

src.frontend.mainwindow.MainWindow.open_json_edit_dialog

Definition at line 203 of file mainwindow.py.

◆ open_search_widget

src.frontend.mainwindow.MainWindow.open_search_widget

Definition at line 184 of file mainwindow.py.

◆ open_setting_dialog

src.frontend.mainwindow.MainWindow.open_setting_dialog

Definition at line 174 of file mainwindow.py.

◆ open_trash_manage_dialog

src.frontend.mainwindow.MainWindow.open_trash_manage_dialog

Definition at line 195 of file mainwindow.py.

◆ rename_sensor_name

src.frontend.mainwindow.MainWindow.rename_sensor_name

Definition at line 196 of file mainwindow.py.

◆ save_as_json

src.frontend.mainwindow.MainWindow.save_as_json

Definition at line 202 of file mainwindow.py.

◆ setup_table

src.frontend.mainwindow.MainWindow.setup_table

Definition at line 193 of file mainwindow.py.

◆ show_about_dialog

src.frontend.mainwindow.MainWindow.show_about_dialog

Definition at line 201 of file mainwindow.py.

◆ table_cell_info

src.frontend.mainwindow.MainWindow.table_cell_info

Definition at line 69 of file mainwindow.py.

◆ table_operator

src.frontend.mainwindow.MainWindow.table_operator = TableOperator(self.ui.tableWidget)

Definition at line 66 of file mainwindow.py.

◆ toggle_activation

src.frontend.mainwindow.MainWindow.toggle_activation

Definition at line 176 of file mainwindow.py.

◆ toggle_deactivation

src.frontend.mainwindow.MainWindow.toggle_deactivation

Definition at line 177 of file mainwindow.py.

◆ translator

src.frontend.mainwindow.MainWindow.translator = QTranslator(self)

Definition at line 65 of file mainwindow.py.

◆ ui

src.frontend.mainwindow.MainWindow.ui = Ui_MainWindow()

Definition at line 56 of file mainwindow.py.


The documentation for this class was generated from the following file: