Add validation for station selection to require at least one station

Co-authored-by: nmemmert <67961292+nmemmert@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]andnmemmert committed 2025-11-28 16:31:36 +00:00
1 parent 013edb952f
commit f0d9b06ef4
2 files changed
+12 -3

No files matched your search

+9 -1
View File
@@ -155,7 +155,7 @@ class SetupWizard(QDialog):
buttons = QDialogButtonBox(
QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel
)
buttons.accepted.connect(self.accept)
buttons.accepted.connect(self.validate_and_accept)
buttons.rejected.connect(self.reject)
layout.addWidget(buttons)
@@ -192,6 +192,14 @@ class SetupWizard(QDialog):
'SELECTED_STATIONS': ','.join(selected_stations)
}
def validate_and_accept(self):
"""Validate configuration before accepting"""
if not self.journey_fm_checkbox.isChecked() and not self.spirit_fm_checkbox.isChecked():
QMessageBox.warning(self, "Validation Error",
"Please select at least one station to monitor.")
return
self.accept()
class LogViewer(QWidget):
"""Widget for viewing application logs"""
def __init__(self, parent=None):