Main Window#
Defines MainWindow class.
|
The main window of the app, built in Qt designer. |
- class mdaviz.mainwindow.MainWindow(*args: Any, **kwargs: Any)[source]#
The main window of the app, built in Qt designer.
connect
()status
setStatus
(text[, timeout])Write new status to the main window and terminal output.
doAboutDialog
(*args, **kw)Show the "About ..." dialog
closeEvent
(event)User clicked the big [X] to quit.
doClose
(*args, **kw)User chose exit (or quit), or closeEvent() was called.
doOpen
(*args, **kw)User chose to open a file or folder dialog.
reset_mainwindow
()dataPath
()Full path object for the selected folder
setDataPath
([path])List of mda file (name only) in the selected folder.
setMdaFileList
([mda_file_list])mdaInfoList
()setMdaInfoList
([infoList])folderList
()setFolderList
([folder_list])Set the folder path list & populating the folder QComboBox.
onFolderSelected
(folder_name)A folder was selected (from the open dialog or pull down menu).
Refreshes the file list in the currently selected folder - Re-fetch the list of MDA files in the current folder.
_buildFolderList
([folder_list])Build the list of recent folders and remove duplicates from the folder list.
- _addToRecentFolders(folder_path: str) None [source]#
Add a new folder path to the list of recent folders in the app settings.
- Args:
folder_path (str): The path of the folder to be added.
- _auto_load_first_folder() None [source]#
Auto-load the first valid folder from recent folders.
This method attempts to automatically load the first folder from the recent folders list if it exists and is valid. This provides a better user experience by not requiring manual folder selection on startup.
The auto-loading can be disabled by setting the ‘auto_load_folder’ setting to False.
- _buildFolderList(folder_list=None)[source]#
Build the list of recent folders and remove duplicates from the folder list.
If folder_list arg is not None (after a doOpen call), it just removes duplicates.
If folder_list arg is None, it grabs the list of recent folder from the app settings. The directory loaded at start-up will be added at index 0.
- Args:
folder_list (list, optional): a list folders. Defaults to None.
- Returns:
list: list of folders to be populated in the QComboBox
- _fillFolderBox(folder_list: List[str] | None = None) None [source]#
Fill the Folder ComboBox; Clear Recently Open… is added at the end by default.
- Args:
folder_list (list, optional): The list of folders to be displayed in the ComboBox. Defaults to [].
- _on_scan_complete(result: FolderScanResult) None [source]#
Handle scan completion.
- connectToFitSignals(chart_view)[source]#
Connect to fit signals from a chart view.
Parameters: - chart_view: ChartView instance that emits fit signals
- get_auto_load_setting() bool [source]#
Get the current auto-load folder setting.
- Returns:
bool: True if auto-loading is enabled, False if disabled
- onFolderSelected(folder_name)[source]#
A folder was selected (from the open dialog or pull down menu).
- onRefresh()[source]#
Refreshes the file list in the currently selected folder - Re-fetch the list of MDA files in the current folder. - Display the updated file list in the MDA folder table view.
- setFolderList(folder_list=None)[source]#
Set the folder path list & populating the folder QComboBox.
If folder_list is not None, it will remove its duplicates.
If folder_list is None, the call to buildFolderList will take care of building the list based on the recent list of folder saved in the app settings.
- Args:
folder_list (list, optional): the current list of recent folders. Defaults to None.