From 69530f76aa81d7471efec0996c3c791c21a66d1d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Sat, 12 May 2012 17:25:37 +0200 Subject: [PATCH] Core: Add "canceled" signal to class FutureProgress. This allows clients to get notified that the operation has been canceled by the user without the need to create an additional QFutureWatcher themselves. Change-Id: I928f87eef98ce762d77dcc6962c082fe49f38f6e Reviewed-by: Eike Ziller --- src/plugins/coreplugin/progressmanager/futureprogress.cpp | 6 ++++++ src/plugins/coreplugin/progressmanager/futureprogress.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.cpp b/src/plugins/coreplugin/progressmanager/futureprogress.cpp index 36102d4d8fd..29bd86b74b4 100644 --- a/src/plugins/coreplugin/progressmanager/futureprogress.cpp +++ b/src/plugins/coreplugin/progressmanager/futureprogress.cpp @@ -129,6 +129,11 @@ FutureProgressPrivate::FutureProgressPrivate(FutureProgress *q) : progress indicator. */ +/*! + \fn void FutureProgress::canceled() + Connect to this signal to get informed when the operation is canceled. +*/ + /*! \fn void FutureProgress::finished() Another way to get informed when the task has finished. @@ -157,6 +162,7 @@ FutureProgress::FutureProgress(QWidget *parent) : connect(&d->m_watcher, SIGNAL(started()), this, SLOT(setStarted())); connect(&d->m_watcher, SIGNAL(finished()), this, SLOT(setFinished())); + connect(&d->m_watcher, SIGNAL(canceled()), this, SIGNAL(canceled())); connect(&d->m_watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(setProgressRange(int,int))); connect(&d->m_watcher, SIGNAL(progressValueChanged(int)), this, SLOT(setProgressValue(int))); connect(&d->m_watcher, SIGNAL(progressTextChanged(QString)), diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.h b/src/plugins/coreplugin/progressmanager/futureprogress.h index 1349b06e64d..a82aa78c474 100644 --- a/src/plugins/coreplugin/progressmanager/futureprogress.h +++ b/src/plugins/coreplugin/progressmanager/futureprogress.h @@ -77,6 +77,7 @@ public: signals: void clicked(); void finished(); + void canceled(); void removeMe(); protected: