From 3417a0f603406689c37bf72cdef87b8b2844775b Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sat, 18 Apr 2026 22:00:23 +0200 Subject: [PATCH] fix: crash when switching folder in train dialog (signal recursion) Co-Authored-By: Claude Opus 4.6 --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index 37b7e22..3f43948 100755 --- a/main.py +++ b/main.py @@ -330,6 +330,8 @@ class TrainDialog(QDialog): inc = inc_scan.isChecked() if inc_scan else False prev_pos = self._cmb_positive.currentData() prev_neg = self._cmb_negative.currentData() + self._cmb_positive.blockSignals(True) + self._cmb_negative.blockSignals(True) self._cmb_positive.clear() # Keep "(auto only)" as first item in negative, remove the rest while self._cmb_negative.count() > 1: @@ -348,6 +350,8 @@ class TrainDialog(QDialog): idx = self._cmb_negative.findData(prev_neg) if idx >= 0: self._cmb_negative.setCurrentIndex(idx) + self._cmb_positive.blockSignals(False) + self._cmb_negative.blockSignals(False) def _update_stats(self): self._populate_folder_combos()