Small improvement in Update dialog.

This commit is contained in:
LoRd_MuldeR 2017-12-08 22:43:54 +01:00
parent 2f38af371e
commit 6a60b6a5cf

View File

@ -486,12 +486,30 @@ void UpdateDialog::testKnownHosts(void)
connect(testThread, SIGNAL(terminated()), &loop, SLOT(quit())); connect(testThread, SIGNAL(terminated()), &loop, SLOT(quit()));
testThread->start(); 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()) while(testThread->isRunning())
{ {
QTimer::singleShot(5000, &loop, SLOT(quit())); QTimer::singleShot(8000, &loop, SLOT(quit()));
loop.exec(QEventLoop::ExcludeUserInputEvents); 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); MUTILS_DELETE(testThread);
logButtonClicked(); logButtonClicked();
} }