fix: prevent crash on save without loaded file and add status message
All checks were successful
Build Linux / Build Linux (push) Successful in 1m31s
Build Windows / Build Windows (push) Successful in 2m52s

This commit is contained in:
2026-01-26 13:28:23 +01:00
parent f8a9ad0065
commit 772827082e

View File

@@ -121,6 +121,7 @@ class MainWindow(QMainWindow):
self.service = TeletextService()
self.current_page: Page = None
self.current_file_path = None
self.clipboard = [] # List of (row, data_bytes)
self.undo_stack = []
self.redo_stack = []
@@ -520,9 +521,9 @@ class MainWindow(QMainWindow):
def save_file(self) -> bool:
if not self.current_file_path:
fname, _ = QFileDialog.getSaveFileName(self, "Save T42", "", "Teletext Files (*.t42)")
if not fname: return False
self.current_file_path = fname
# User requested status message instead of Save As behavior for empty state
self.status_label.setText("No file loaded to save. Please use 'Save As...' or 'Open' first.")
return False
try:
self.progress_bar.setVisible(True)