Skip to content

Commit

Permalink
Add condition for read_from_disc_checkbox in main_window
Browse files Browse the repository at this point in the history
A condition has been added to check for the status of the 'read_from_disc_checkbox' in main_window.py. When checked, it clears the text from the 'source_folder_widget' and 'source_file_widget'. When unchecked, it continues with the existing check which ensures either source folder or source file is set but not both.
  • Loading branch information
cbusillo committed Jun 25, 2024
1 parent 7e49b5e commit aa0993d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bd_to_avp/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,15 @@ def toggle_processing(self) -> None:
self.processing_output_textedit.clear()
source_folder_set = bool(self.source_folder_widget.text())
source_file_set = bool(self.source_file_widget.text())
if (source_folder_set and source_file_set) or (not source_folder_set and not source_file_set):
QMessageBox.warning(self, "Warning", "Either Source Folder or Source File must be set, but not both.")
return
if self.read_from_disc_checkbox.isChecked():
self.source_folder_widget.set_text("")
self.source_file_widget.set_text("")
else:
if (source_folder_set and source_file_set) or (not source_folder_set and not source_file_set):
QMessageBox.warning(
self, "Warning", "Either Source Folder or Source File must be set, but not both."
)
return

self.start_processing()

Expand Down

0 comments on commit aa0993d

Please sign in to comment.