From f875938ee499c6e99dd9c70a0672a7c07ac1ce0a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 23 Oct 2011 17:00:21 +0000 Subject: [PATCH] Don't report a user cancel when the user clicks on the 'Close' button after completion in the progress dialog Originally committed to SVN as r5761. --- aegisub/src/dialog_progress.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/src/dialog_progress.cpp b/aegisub/src/dialog_progress.cpp index 8cb9e7031..a9c1f847a 100644 --- a/aegisub/src/dialog_progress.cpp +++ b/aegisub/src/dialog_progress.cpp @@ -160,7 +160,7 @@ void DialogProgress::Run(std::tr1::function task, int DialogProgressSink ps(this); this->ps = &ps; new TaskRunner(task, &ps, this, priority); - if (ShowModal()) + if (!ShowModal()) throw agi::UserCancelException("Cancelled by user"); } @@ -208,7 +208,7 @@ void DialogProgress::OnComplete(wxThreadEvent &evt) { // close button bool cancelled = ps->IsCancelled(); if (cancelled || log_output->IsEmpty()) - EndModal(cancelled); + EndModal(!cancelled); else cancel_button->SetLabelText(_("Close")); }