Move all progress indicator handling to progress manager.

Part of it was managed in ProgressView, which only complicates things.

Change-Id: Ia9ca03e3228f3662864749da751f7ec4bdf23297
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Eike Ziller
2013-04-09 14:22:28 +02:00
parent e0f05e3b33
commit 9e714006ee
4 changed files with 147 additions and 164 deletions

View File

@@ -32,7 +32,6 @@
#include "progressmanager.h"
#include <QFuture>
#include <QWidget>
@@ -42,8 +41,6 @@ QT_END_NAMESPACE
namespace Core {
class FutureProgress;
namespace Internal {
class ProgressView : public QWidget
@@ -54,15 +51,9 @@ public:
ProgressView(QWidget *parent = 0);
~ProgressView();
/** The returned FutureProgress instance is guaranteed to live till next main loop event processing (deleteLater). */
FutureProgress *addTask(const QFuture<void> &future,
const QString &title,
const QString &type,
ProgressManager::ProgressFlags flags);
void addProgressWidget(QWidget *widget);
void removeProgressWidget(QWidget *widget);
bool hasError() const;
bool isFading() const;
bool isEmpty() const;
bool isHovered() const;
void setReferenceWidget(QWidget *widget);
@@ -72,23 +63,12 @@ protected:
bool eventFilter(QObject *obj, QEvent *event);
signals:
void hasErrorChanged();
void fadeOfLastProgressStarted();
void hoveredChanged(bool hovered);
private slots:
void slotRemoveTask();
void checkForLastProgressFading();
private:
void removeOldTasks(const QString &type, bool keepOne = false);
void removeOneOldTask();
void removeTask(FutureProgress *task);
void deleteTask(FutureProgress *task);
void reposition();
QVBoxLayout *m_layout;
QList<FutureProgress *> m_taskList;
QWidget *m_referenceWidget;
bool m_hovered;
};