change: set abort button to "Skip" when downloading game files

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2026-02-10 22:42:19 +05:00
parent 31971b2746
commit f59e5b2df9
No known key found for this signature in database
GPG key ID: B77C34313AEE1FFF
4 changed files with 10 additions and 0 deletions

View file

@ -81,6 +81,7 @@ void InstanceCreationTask::executeTask()
if (!m_abort) {
setAbortable(true);
setAbortButtonText(tr("Skip"));
qDebug() << "Downloading game files";
auto updateTasks = m_instance->createUpdateTask();

View file

@ -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);

View file

@ -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.

View file

@ -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);