From de8886b73b4ff4c3e063f22379f5fe947b52a6f5 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 15 Jan 2018 14:37:07 +0100 Subject: [PATCH] [update] leave rename phase mode when picking initiated --- pylot/RELEASE-VERSION | 2 +- pylot/core/util/widgets.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pylot/RELEASE-VERSION b/pylot/RELEASE-VERSION index 7d063375..878d172c 100644 --- a/pylot/RELEASE-VERSION +++ b/pylot/RELEASE-VERSION @@ -1 +1 @@ -1c51-dirty +f483-dirty diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index c2d34800..9a2c9411 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -1679,6 +1679,8 @@ class PickDlg(QDialog): self.deactivatePicking() def activatePicking(self): + self.leave_rename_phase() + self.renamePhaseAction.setEnabled(False) phase = self.currentPhase phaseID = self.getPhaseID(phase) if not phaseID: @@ -1709,6 +1711,7 @@ class PickDlg(QDialog): self.disconnectPressEvent() self.multicompfig.connectEvents() + self.renamePhaseAction.setEnabled(True) self.connect_pick_delete() self.draw() @@ -2034,7 +2037,7 @@ class PickDlg(QDialog): self.disconnectPressEvent() self.enable_ar_buttons() self.zoomAction.setEnabled(True) - #self.pick_block = self.togglePickBlocker() + #self.pick_block = self.togglPickBlocker() self.leave_picking_mode() def savePick(self, phase, phasepicks): @@ -2219,9 +2222,7 @@ class PickDlg(QDialog): except KeyError as e: QtGui.QMessageBox.warning(self, 'Could not rename phase', 'Could not rename phase {} to {}: {}'.format(phase, new_phase, e)) - self.renamePhaseAction.setChecked(False) - self.multicompfig.set_frame_color() - self.multicompfig.connectEvents() + self.leave_rename_phase() self.refreshPlot() def renamePhaseInDict(self, picks, phase_old, phase_new): @@ -2233,6 +2234,11 @@ class PickDlg(QDialog): picks.pop(phase_old) self.setDirty(True) + def leave_rename_phase(self): + self.renamePhaseAction.setChecked(False) + self.multicompfig.set_frame_color() + self.multicompfig.connectEvents() + def remove_pick_by_x(self, x): if not self.picks and not self.autopicks: return