diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-31 00:31:29 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-31 00:31:29 +0200 |
| commit | 926267faa059082865fc3a1d62d3090645267e37 (patch) | |
| tree | ef1daf7ea519dd2bc7c9ff4ccb64b5b3a734b50b /src/installationmanager.cpp | |
| parent | 0b3e3ab59085701e85881571126a95b1880c20fb (diff) | |
Fix issue with progress dialog disapearing too soon during installation.
Diffstat (limited to 'src/installationmanager.cpp')
| -rw-r--r-- | src/installationmanager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index 6159115b..79f5ee91 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -130,6 +130,7 @@ bool InstallationManager::extractFiles(QDir extractPath) { m_InstallationProgress = new QProgressDialog(m_ParentWidget); ON_BLOCK_EXIT([this]() { + m_InstallationProgress->cancel(); m_InstallationProgress->hide(); m_InstallationProgress->deleteLater(); m_InstallationProgress = nullptr; @@ -140,6 +141,7 @@ bool InstallationManager::extractFiles(QDir extractPath) m_InstallationProgress->setWindowTitle(tr("Extracting files")); m_InstallationProgress->setWindowModality(Qt::WindowModal); m_InstallationProgress->setFixedSize(600, 100); + m_InstallationProgress->setAutoReset(false); m_InstallationProgress->show(); // unpack only the files we need for the installer @@ -155,7 +157,7 @@ bool InstallationManager::extractFiles(QDir extractPath) if (m_Progress != m_InstallationProgress->value()) m_InstallationProgress->setValue(m_Progress); QCoreApplication::processEvents(); - } while (!future.isFinished() || m_InstallationProgress->isVisible()); + } while (!future.isFinished()); if (!future.result()) { if (m_ArchiveHandler->getLastError() == Archive::ERROR_EXTRACT_CANCELLED) { if (!m_ErrorMessage.isEmpty()) { @@ -434,6 +436,13 @@ IPluginInstaller::EInstallResult InstallationManager::doInstall(GuessedValue<QSt m_ProgressFile = QString(); }); + // Turn off auto-reset otherwize the progress dialog is reset before the end. This + // is kind of annoying because updateProgress consider percentage of progression + // through the archive (pack), while we are waiting for extracting archive entries, so + // the percentage of in updateProgress is not really related to the percentage of files + // extracted... + m_InstallationProgress->setAutoReset(false); + m_InstallationProgress->setWindowFlags( m_InstallationProgress->windowFlags() & (~Qt::WindowContextHelpButtonHint)); m_InstallationProgress->setWindowModality(Qt::WindowModal); |
