aboutsummaryrefslogtreecommitdiff
path: root/launcher/tasks/SequentialTask.cpp
diff options
context:
space:
mode:
authorflow <thiagodonato300@gmail.com>2022-04-13 19:23:12 -0300
committerflow <flowlnlnln@gmail.com>2022-05-23 14:42:27 -0300
commiteaa5ce446765ef4305a1462d68e278b0797966ee (patch)
tree21971ff5569306e6d7a246b69808c2eefe98ae83 /launcher/tasks/SequentialTask.cpp
parentc86c719e1a09be2dc25ffd26278076566672e3b5 (diff)
downloadPrismLauncher-eaa5ce446765ef4305a1462d68e278b0797966ee.tar.gz
PrismLauncher-eaa5ce446765ef4305a1462d68e278b0797966ee.tar.bz2
PrismLauncher-eaa5ce446765ef4305a1462d68e278b0797966ee.zip
feat(ui): adapt SequentialTask to nested SequentialTasks
Diffstat (limited to 'launcher/tasks/SequentialTask.cpp')
-rw-r--r--launcher/tasks/SequentialTask.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/launcher/tasks/SequentialTask.cpp b/launcher/tasks/SequentialTask.cpp
index 1573e476..2d50c299 100644
--- a/launcher/tasks/SequentialTask.cpp
+++ b/launcher/tasks/SequentialTask.cpp
@@ -53,12 +53,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();
}
@@ -68,7 +74,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)
{