From 6a60b6a5cf3f859b6830858e48fce67cd866eb70 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Fri, 8 Dec 2017 22:43:54 +0100 Subject: [PATCH] Small improvement in Update dialog. --- src/Dialog_Update.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Dialog_Update.cpp b/src/Dialog_Update.cpp index a3f1a16f..0d3f3ebc 100644 --- a/src/Dialog_Update.cpp +++ b/src/Dialog_Update.cpp @@ -486,12 +486,30 @@ void UpdateDialog::testKnownHosts(void) connect(testThread, SIGNAL(terminated()), &loop, SLOT(quit())); testThread->start(); + + ui->progressBar->setMaximum(0); + ui->progressBar->setMinimum(0); + + bool status[4]; + status[0] = ui->closeButton ->isEnabled(); ui->closeButton ->setEnabled(false); + status[1] = ui->installButton->isEnabled(); ui->installButton->setEnabled(false); + status[2] = ui->retryButton ->isEnabled(); ui->retryButton ->setEnabled(false); + status[3] = ui->logButton ->isEnabled(); ui->logButton ->setEnabled(false); + while(testThread->isRunning()) { - QTimer::singleShot(5000, &loop, SLOT(quit())); + QTimer::singleShot(8000, &loop, SLOT(quit())); loop.exec(QEventLoop::ExcludeUserInputEvents); } + ui->progressBar->setMaximum(m_thread.isNull() ? 100 : m_thread->getMaximumProgress()); + ui->progressBar->setValue(ui->progressBar->maximum()); + + ui->closeButton ->setEnabled(status[0]); + ui->installButton->setEnabled(status[1]); + ui->retryButton ->setEnabled(status[2]); + ui->logButton ->setEnabled(status[3]); + MUTILS_DELETE(testThread); logButtonClicked(); }