diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-04-09 15:10:49 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-01 10:48:00 -0700 |
commit | 733619ca741336ba9999af43f4eddd9371462325 (patch) | |
tree | af382762e6435c4cc4ff9a74aa1ebea84f4ac5fa /launcher/tasks | |
parent | 9f9c829bc5db1c5a643e709d701b929af8194deb (diff) | |
download | PrismLauncher-733619ca741336ba9999af43f4eddd9371462325.tar.gz PrismLauncher-733619ca741336ba9999af43f4eddd9371462325.tar.bz2 PrismLauncher-733619ca741336ba9999af43f4eddd9371462325.zip |
feat: estimate remining time on downloads
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/tasks')
-rw-r--r-- | launcher/tasks/ConcurrentTask.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/launcher/tasks/ConcurrentTask.cpp b/launcher/tasks/ConcurrentTask.cpp index 37435739..dbb4d94d 100644 --- a/launcher/tasks/ConcurrentTask.cpp +++ b/launcher/tasks/ConcurrentTask.cpp @@ -197,6 +197,10 @@ void ConcurrentTask::subTaskStatus(Task::Ptr task, const QString& msg) task_progress->state = TaskStepState::Running; emit stepProgress(*task_progress.get()); + + if (totalSize() == 1) { + setStatus(msg); + } } void ConcurrentTask::subTaskDetails(Task::Ptr task, const QString& msg) @@ -206,6 +210,10 @@ void ConcurrentTask::subTaskDetails(Task::Ptr task, const QString& msg) task_progress->state = TaskStepState::Running; emit stepProgress(*task_progress.get()); + + if (totalSize() == 1) { + setDetails(msg); + } } void ConcurrentTask::subTaskProgress(Task::Ptr task, qint64 current, qint64 total) @@ -222,6 +230,10 @@ void ConcurrentTask::subTaskProgress(Task::Ptr task, qint64 current, qint64 tota emit stepProgress(*task_progress.get()); updateStepProgress(*task_progress.get(), Operation::CHANGED); updateState(); + + if (totalSize() == 1) { + setProgress(task_progress->current, task_progress->total); + } } void ConcurrentTask::subTaskStepProgress(Task::Ptr task, TaskStepProgress const& task_progress) |