From cb0651dc5161f9e113293c1e8ba8512a859a8102 Mon Sep 17 00:00:00 2001 From: Mohamed Sharfan Date: Thu, 15 Jan 2026 16:45:44 +0530 Subject: [PATCH] Fix: Connect cancel button to self.reject in ProgressDialog (Fixes #135) --- pyface/ui/qt/progress_dialog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyface/ui/qt/progress_dialog.py b/pyface/ui/qt/progress_dialog.py index e0c3e6b42..ba1b1d83a 100644 --- a/pyface/ui/qt/progress_dialog.py +++ b/pyface/ui/qt/progress_dialog.py @@ -170,7 +170,7 @@ def update(self, value): # Private Interface # ------------------------------------------------------------------------- - def reject(self, event): + def reject(self, event = None): self._user_cancelled = True self.close() @@ -201,7 +201,7 @@ def _create_buttons(self, dialog, layout): # TODO: hookup the buttons to our methods, this may involve subclassing from QDialog if self.can_cancel: - buttons.rejected.connect(dialog.reject) + buttons.rejected.connect(self.reject) self._connections_to_remove.append( (buttons.rejected, dialog.reject) )