From 0e38c5666e8c284f461ea678b49ce3525aeb536e Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Mon, 13 Apr 2026 11:22:20 +0200 Subject: [PATCH] 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 --- main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.py b/main.py index 5fa5d81..1e3a9c4 100755 --- a/main.py +++ b/main.py @@ -1538,6 +1538,16 @@ class MainWindow(QMainWindow): def _on_profile_changed(self, text: str) -> None: 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: self._refresh_markers() self.statusBar().showMessage(f"Profile: {text}", 3000)