From f59e5b2df98bce27ab69c2a4e2b291b0693c7e08 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Tue, 10 Feb 2026 22:42:19 +0500 Subject: [PATCH] change: set abort button to "Skip" when downloading game files Signed-off-by: Octol1ttle --- launcher/InstanceCreationTask.cpp | 1 + launcher/InstanceList.cpp | 1 + launcher/tasks/Task.h | 7 +++++++ launcher/ui/dialogs/ProgressDialog.cpp | 1 + 4 files changed, 10 insertions(+) diff --git a/launcher/InstanceCreationTask.cpp b/launcher/InstanceCreationTask.cpp index accf5cca6..1f0cc99c8 100644 --- a/launcher/InstanceCreationTask.cpp +++ b/launcher/InstanceCreationTask.cpp @@ -81,6 +81,7 @@ void InstanceCreationTask::executeTask() if (!m_abort) { setAbortable(true); + setAbortButtonText(tr("Skip")); qDebug() << "Downloading game files"; auto updateTasks = m_instance->createUpdateTask(); diff --git a/launcher/InstanceList.cpp b/launcher/InstanceList.cpp index 6e84111f2..2bab7f635 100644 --- a/launcher/InstanceList.cpp +++ b/launcher/InstanceList.cpp @@ -923,6 +923,7 @@ class InstanceStaging : public Task { connect(child, &Task::failed, this, &InstanceStaging::childFailed); connect(child, &Task::aborted, this, &InstanceStaging::childAborted); connect(child, &Task::abortStatusChanged, this, &InstanceStaging::setAbortable); + connect(child, &Task::abortButtonTextChanged, this, &InstanceStaging::setAbortButtonText); connect(child, &Task::status, this, &InstanceStaging::setStatus); connect(child, &Task::details, this, &InstanceStaging::setDetails); connect(child, &Task::progress, this, &InstanceStaging::setProgress); diff --git a/launcher/tasks/Task.h b/launcher/tasks/Task.h index 6e7645338..94fb57783 100644 --- a/launcher/tasks/Task.h +++ b/launcher/tasks/Task.h @@ -154,6 +154,8 @@ class Task : public QObject, public QRunnable { //! Emitted when the canAbort() status has changed. */ void abortStatusChanged(bool can_abort); + void abortButtonTextChanged(QString text); + public slots: // QRunnable's interface void run() override { start(); } @@ -174,6 +176,11 @@ class Task : public QObject, public QRunnable { emit abortStatusChanged(can_abort); } + void setAbortButtonText(QString text) + { + emit abortButtonTextChanged(text); + } + protected: //! The task subclass must implement this method. This method is called to start to run the task. //! The task is not finished when this method returns. the subclass must manually call emitSucceeded() or emitFailed() instead. diff --git a/launcher/ui/dialogs/ProgressDialog.cpp b/launcher/ui/dialogs/ProgressDialog.cpp index aa2f67bdb..6aa0b4bdf 100644 --- a/launcher/ui/dialogs/ProgressDialog.cpp +++ b/launcher/ui/dialogs/ProgressDialog.cpp @@ -152,6 +152,7 @@ int ProgressDialog::execWithTask(Task* task) this->m_taskConnections.push_back(connect(task, &Task::progress, this, &ProgressDialog::changeProgress)); this->m_taskConnections.push_back(connect(task, &Task::aborted, this, &ProgressDialog::hide)); this->m_taskConnections.push_back(connect(task, &Task::abortStatusChanged, ui->skipButton, &QPushButton::setEnabled)); + this->m_taskConnections.push_back(connect(task, &Task::abortButtonTextChanged, ui->skipButton, &QPushButton::setText)); m_is_multi_step = task->isMultiStep(); ui->taskProgressScrollArea->setHidden(!m_is_multi_step);