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.
This commit is contained in:
Thomas Goyne 2011-10-23 17:00:21 +00:00
parent 1364527681
commit f875938ee4

View file

@ -160,7 +160,7 @@ void DialogProgress::Run(std::tr1::function<void(agi::ProgressSink*)> 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"));
}