summaryrefslogtreecommitdiffstats
path: root/application/widgets/ProgressWidget.h
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2015-05-28 19:38:29 +0200
committerPetr Mrázek <peterix@gmail.com>2015-06-06 21:23:05 +0200
commit3a8b238052163952831fb5924b2483a375e86ebd (patch)
treeab120b4fac3a5345a20e7a09e1e7477e67d9ed6f /application/widgets/ProgressWidget.h
parent161dc66c2c8d5f973ee69dab36c3969a7efd7495 (diff)
downloadMultiMC-3a8b238052163952831fb5924b2483a375e86ebd.tar
MultiMC-3a8b238052163952831fb5924b2483a375e86ebd.tar.gz
MultiMC-3a8b238052163952831fb5924b2483a375e86ebd.tar.lz
MultiMC-3a8b238052163952831fb5924b2483a375e86ebd.tar.xz
MultiMC-3a8b238052163952831fb5924b2483a375e86ebd.zip
NOISSUE Various changes from multiauth that are unrelated to it
Diffstat (limited to 'application/widgets/ProgressWidget.h')
-rw-r--r--application/widgets/ProgressWidget.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/application/widgets/ProgressWidget.h b/application/widgets/ProgressWidget.h
new file mode 100644
index 00000000..08d8a157
--- /dev/null
+++ b/application/widgets/ProgressWidget.h
@@ -0,0 +1,32 @@
+// Licensed under the Apache-2.0 license. See README.md for details.
+
+#pragma once
+
+#include <QWidget>
+#include <memory>
+
+class Task;
+class QProgressBar;
+class QLabel;
+
+class ProgressWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit ProgressWidget(QWidget *parent = nullptr);
+
+public slots:
+ void start(std::shared_ptr<Task> task);
+ bool exec(std::shared_ptr<Task> task);
+
+private slots:
+ void handleTaskFinish();
+ void handleTaskStatus(const QString &status);
+ void handleTaskProgress(qint64 current, qint64 total);
+ void taskDestroyed();
+
+private:
+ QLabel *m_label;
+ QProgressBar *m_bar;
+ std::shared_ptr<Task> m_task;
+};