From 21c64545e5a295c2dce6f62489d190bf4ad3a9a5 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 3 Aug 2013 18:33:35 -0400 Subject: [PATCH] Fixed job UI cancellation It was broken since the modernization. --- hscommon/gui/progress_window.py | 3 +-- qtlib/progress_window.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hscommon/gui/progress_window.py b/hscommon/gui/progress_window.py index a7aa91cc..d628160c 100644 --- a/hscommon/gui/progress_window.py +++ b/hscommon/gui/progress_window.py @@ -21,7 +21,7 @@ class ProgressWindow(GUIObject, ThreadedJobPerformer): self.jobid = None def cancel(self): - self.user_cancelled = True + self.job_cancelled = True def pulse(self): # Call this regularly from the GUI main run loop. @@ -44,7 +44,6 @@ class ProgressWindow(GUIObject, ThreadedJobPerformer): # target is a function with its first argument being a Job. It can then be followed by other # arguments which are passed as `args`. self.jobid = jobid - self.user_cancelled = False self.progressdesc_textfield.text = '' j = self.create_job() args = tuple([j] + list(args)) diff --git a/qtlib/progress_window.py b/qtlib/progress_window.py index 07ede5d3..0194be16 100644 --- a/qtlib/progress_window.py +++ b/qtlib/progress_window.py @@ -24,6 +24,7 @@ class ProgressWindow(QProgressDialog): self.setAutoClose(False) self._timer = QTimer() self._timer.timeout.connect(self.model.pulse) + self.canceled.connect(self.model.cancel) # --- Callbacks def refresh(self): # Labels