mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
change: set abort button to "Skip" when downloading game files
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
31971b2746
commit
f59e5b2df9
4 changed files with 10 additions and 0 deletions
|
|
@ -81,6 +81,7 @@ void InstanceCreationTask::executeTask()
|
|||
|
||||
if (!m_abort) {
|
||||
setAbortable(true);
|
||||
setAbortButtonText(tr("Skip"));
|
||||
qDebug() << "Downloading game files";
|
||||
|
||||
auto updateTasks = m_instance->createUpdateTask();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue