feat: add details signal to Task

feat: add details to mod pack downloading
feat: add logging rule sloading form `ligging.ini at data path root
feat: add `launcher.task` `launcher.task.net` and `launcher.task.net.[down|up]load` logging categories
fix: add new subtask progress to the end of the lay out not the beginning (cuts down on flickering)

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers
2023-03-31 19:25:01 -07:00
parent f1028fa66d
commit b6452215c1
26 changed files with 249 additions and 95 deletions

View File

@ -42,6 +42,8 @@
#include "QObjectPtr.h"
Q_DECLARE_LOGGING_CATEGORY(taskLogC)
enum class TaskStepState {
Waiting,
Running,
@ -100,12 +102,13 @@ class Task : public QObject, public QRunnable {
auto getState() const -> State { return m_state; }
QString getStatus() { return m_status; }
QString getDetails() { return m_details; }
qint64 getProgress() { return m_progress; }
qint64 getTotalProgress() { return m_progressTotal; }
virtual auto getStepProgress() const -> TaskStepProgressList { return {}; }
virtual auto getDetails() const -> QString { return ""; }
QUuid getUid() { return m_uid; }
@ -123,6 +126,7 @@ class Task : public QObject, public QRunnable {
void aborted();
void failed(QString reason);
void status(QString status);
void details(QString details);
void stepProgress(TaskStepProgressList task_progress); //
/** Emitted when the canAbort() status has changed.
@ -150,6 +154,7 @@ class Task : public QObject, public QRunnable {
public slots:
void setStatus(const QString& status);
void setDetails(const QString& details);
void setProgress(qint64 current, qint64 total);
protected:
@ -157,6 +162,7 @@ class Task : public QObject, public QRunnable {
QStringList m_Warnings;
QString m_failReason = "";
QString m_status;
QString m_details;
int m_progress = 0;
int m_progressTotal = 100;