Merge pull request #27 from flowln/ftb_install_improve

This commit is contained in:
Sefa Eyeoglu
2022-10-19 13:51:35 +02:00
committed by GitHub
10 changed files with 129 additions and 114 deletions

View File

@ -139,6 +139,10 @@ NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, const QString
void NewInstanceDialog::reject()
{
APPLICATION->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
// This is just so that the pages get the close() call and can react to it, if needed.
m_container->prepareToClose();
QDialog::reject();
}
@ -146,6 +150,10 @@ void NewInstanceDialog::accept()
{
APPLICATION->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
importIconNow();
// This is just so that the pages get the close() call and can react to it, if needed.
m_container->prepareToClose();
QDialog::accept();
}

View File

@ -25,6 +25,7 @@ ProgressDialog::ProgressDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Pr
{
ui->setupUi(this);
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
setAttribute(Qt::WidgetAttribute::WA_QuitOnClose, true);
setSkipButton(false);
changeProgress(0, 100);
}
@ -67,7 +68,7 @@ int ProgressDialog::execWithTask(Task* task)
return QDialog::DialogCode::Accepted;
}
QDialog::DialogCode result;
QDialog::DialogCode result {};
if (handleImmediateResult(result)) {
return result;
}
@ -80,7 +81,7 @@ int ProgressDialog::execWithTask(Task* task)
connect(task, &Task::stepStatus, this, &ProgressDialog::changeStatus);
connect(task, &Task::progress, this, &ProgressDialog::changeProgress);
connect(task, &Task::aborted, [this] { QDialog::reject(); });
connect(task, &Task::aborted, this, &ProgressDialog::hide);
connect(task, &Task::abortStatusChanged, ui->skipButton, &QPushButton::setEnabled);
m_is_multi_step = task->isMultiStep();