From d47d30c8dc4ddf2a6bd84162dedb159559cfeacc Mon Sep 17 00:00:00 2001 From: Victor Tran Date: Wed, 5 Dec 2018 01:56:15 +1100 Subject: New flag to update an app --- installer/mainwindow.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'installer/mainwindow.cpp') diff --git a/installer/mainwindow.cpp b/installer/mainwindow.cpp index a739455..e66e273 100644 --- a/installer/mainwindow.cpp +++ b/installer/mainwindow.cpp @@ -152,7 +152,11 @@ void MainWindow::getInstallerMetadata() { ui->licenseLabel->setVisible(false); } - ui->stack->setCurrentIndex(2); + if (autoProgress) { + ui->installButton->click(); + } else { + ui->stack->setCurrentIndex(2); + } }); connect(reply, QOverload::of(&QNetworkReply::error), [=](QNetworkReply::NetworkError code) { ui->metadataErrorLabel->setText(tr("Couldn't retrieve metadata")); @@ -288,7 +292,13 @@ void MainWindow::on_installButton_clicked() installDone = true; this->setWindowFlag(Qt::WindowCloseButtonHint, true); this->show(); - ui->stack->setCurrentIndex(5); + + if (autoProgress) { + ui->openCheckbox->setChecked(true); + ui->finishButton->click(); + } else { + ui->stack->setCurrentIndex(5); + } taskbarButton->progress()->setVisible(false); } else if (parts.at(0) == "ALERT") { @@ -440,3 +450,7 @@ void MainWindow::on_licenseLabel_linkActivated(const QString &link) { licenseWidget->show(link, this->licenses.value(link)); } + +void MainWindow::setAutoProgress(bool autoProgress) { + this->autoProgress = autoProgress; +} -- cgit v1.2.3