diff --git a/sohstationviewer/view/main_window.py b/sohstationviewer/view/main_window.py index 8a3bd1f28a8ba48817451b1bdfca0634d8ba4c5c..14b77f21ecf900e60d54a939d5bce9b54b0c78e8 100755 --- a/sohstationviewer/view/main_window.py +++ b/sohstationviewer/view/main_window.py @@ -321,6 +321,9 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): self.open_files_list.clear() self.set_open_files_list_texts() + # We only disable the from data card checkbox because it has behavior + # that conflics with the log file checkbox. Other widgets are kept + # enabled because they don't break what the log file checkbox does. self.from_data_card_check_box.setEnabled(not is_checked) self.filter_folder_list(self.search_line_edit.text()) @@ -501,6 +504,7 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): for item in self.open_files_list.selectedItems(): log_abspath = root_dir.joinpath(item.file_path) self.rt130_log_files.append(log_abspath) + # Log files can only come from programs that work with RT130 data. self.data_type = 'RT130' self.is_multiplex = False elif self.rt130_das_dict != {}: @@ -538,6 +542,8 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): msg = "No directories have been selected." raise Exception(msg) + # Log files don't have a data type that can be detected, so we don't + # detect the data type if we are reading them. if self.rt130_das_dict == {} and not self.log_checkbox.isChecked(): self.data_type, self.is_multiplex = detect_data_type( self.list_of_dir) @@ -950,6 +956,9 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow): self.rt130_das_dict = rt130_find_cf_dass(path) if self.log_checkbox.isChecked(): for dent in pathlib.Path(path).iterdir(): + # Currently, we only read file that has the extension .log. + # Dealing with general file is a lot more difficult and is + # not worth the time it takes to do so. if dent.is_file() and dent.name.endswith('.log'): self.open_files_list.addItem(FileListItem(dent))