aboutsummaryrefslogtreecommitdiff
path: root/launcher/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/tasks')
-rw-r--r--launcher/tasks/SequentialTask.cpp10
-rw-r--r--launcher/tasks/SequentialTask.h9
-rw-r--r--launcher/tasks/Task.h1
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();