fix: reset overwrite/delete state on profile switch

Switching profiles now clears the overwrite path, button states, and
next-label so stale state from the old profile doesn't persist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 11:22:20 +02:00
parent f9c5a42453
commit 0e38c5666e
+10
View File
@@ -1538,6 +1538,16 @@ class MainWindow(QMainWindow):
def _on_profile_changed(self, text: str) -> None: def _on_profile_changed(self, text: str) -> None:
self._settings.setValue("profile", text) self._settings.setValue("profile", text)
# Clear overwrite state — the selected marker belongs to the old profile
if self._overwrite_path:
self._overwrite_path = ""
self._overwrite_group = []
self._btn_export.setText("Export")
self._btn_export.setStyleSheet("")
self._btn_delete.setText("Delete")
if not self._last_export_path:
self._btn_delete.setEnabled(False)
self._update_next_label()
if self._file_path: if self._file_path:
self._refresh_markers() self._refresh_markers()
self.statusBar().showMessage(f"Profile: {text}", 3000) self.statusBar().showMessage(f"Profile: {text}", 3000)