diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-06-04 13:23:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-04 13:23:38 +0200 |
commit | 1ab00ca8b260e4ff33c4bc1ed5d0167e210de64f (patch) | |
tree | b72770d610fa6dee00f131a4bbef7c69869d9b21 /launcher/tasks | |
parent | cf4949b4f5a29757b3dd24cdca3a010f10e6dadb (diff) | |
parent | 5a1de15332bcfbeafff7d0c678d7286ca85cfe18 (diff) | |
download | PrismLauncher-1ab00ca8b260e4ff33c4bc1ed5d0167e210de64f.tar.gz PrismLauncher-1ab00ca8b260e4ff33c4bc1ed5d0167e210de64f.tar.bz2 PrismLauncher-1ab00ca8b260e4ff33c4bc1ed5d0167e210de64f.zip |
Merge pull request #426 from flowln/mod_perma
Add on-disk mod metadata information
Diffstat (limited to 'launcher/tasks')
-rw-r--r-- | launcher/tasks/SequentialTask.cpp | 10 | ||||
-rw-r--r-- | launcher/tasks/SequentialTask.h | 9 | ||||
-rw-r--r-- | launcher/tasks/Task.h | 1 |
3 files changed, 12 insertions, 8 deletions
diff --git a/launcher/tasks/SequentialTask.cpp b/launcher/tasks/SequentialTask.cpp index ee57cac1..7f03ad2e 100644 --- a/launcher/tasks/SequentialTask.cpp +++ b/launcher/tasks/SequentialTask.cpp @@ -64,12 +64,18 @@ void SequentialTask::startNext() return; } Task::Ptr next = m_queue[m_currentIndex]; + connect(next.get(), SIGNAL(failed(QString)), this, SLOT(subTaskFailed(QString))); + connect(next.get(), SIGNAL(succeeded()), this, SLOT(startNext())); + connect(next.get(), SIGNAL(status(QString)), this, SLOT(subTaskStatus(QString))); + connect(next.get(), SIGNAL(stepStatus(QString)), this, SLOT(subTaskStatus(QString))); + connect(next.get(), SIGNAL(progress(qint64, qint64)), this, SLOT(subTaskProgress(qint64, qint64))); - connect(next.get(), SIGNAL(succeeded()), this, SLOT(startNext())); setStatus(tr("Executing task %1 out of %2").arg(m_currentIndex + 1).arg(m_queue.size())); + setStepStatus(next->isMultiStep() ? next->getStepStatus() : next->getStatus()); + next->start(); } @@ -79,7 +85,7 @@ void SequentialTask::subTaskFailed(const QString& msg) } void SequentialTask::subTaskStatus(const QString& msg) { - setStepStatus(m_queue[m_currentIndex]->getStatus()); + setStepStatus(msg); } void SequentialTask::subTaskProgress(qint64 current, qint64 total) { diff --git a/launcher/tasks/SequentialTask.h b/launcher/tasks/SequentialTask.h index 5b3c0111..e10cb6f7 100644 --- a/launcher/tasks/SequentialTask.h +++ b/launcher/tasks/SequentialTask.h @@ -32,13 +32,10 @@ slots: void subTaskStatus(const QString &msg); void subTaskProgress(qint64 current, qint64 total); -signals: - void stepStatus(QString status); +protected: + void setStepStatus(QString status) { m_step_status = status; emit stepStatus(status); }; -private: - void setStepStatus(QString status) { m_step_status = status; }; - -private: +protected: QString m_name; QString m_step_status; diff --git a/launcher/tasks/Task.h b/launcher/tasks/Task.h index f7765c3d..aafaf68c 100644 --- a/launcher/tasks/Task.h +++ b/launcher/tasks/Task.h @@ -92,6 +92,7 @@ class Task : public QObject { void aborted(); void failed(QString reason); void status(QString status); + void stepStatus(QString status); public slots: virtual void start(); |