Qt: Fix delay in progress dialog opening

Applies to updater, verify, etc.
This commit is contained in:
Stenzek 2025-01-04 16:59:31 +10:00
parent 920f25427e
commit 076f4a6293
No known key found for this signature in database
5 changed files with 12 additions and 5 deletions

View File

@ -533,6 +533,7 @@ void AutoUpdaterDialog::downloadUpdateClicked()
progress.SetStatusText(tr("Downloading %1...").arg(m_latest_sha).toUtf8().constData());
progress.GetDialog().setWindowIcon(windowIcon());
progress.SetCancellable(true);
progress.MakeVisible();
m_http->CreateRequest(
m_download_url.toStdString(),

View File

@ -492,6 +492,7 @@ void GameSummaryWidget::onComputeHashClicked()
QtModalProgressCallback progress_callback(this);
progress_callback.SetCancellable(true);
progress_callback.SetProgressRange(image->GetTrackCount());
progress_callback.MakeVisible();
std::vector<CDImageHasher::Hash> track_hashes;
track_hashes.reserve(image->GetTrackCount());

View File

@ -292,6 +292,7 @@ std::optional<bool> QtHost::DownloadFile(QWidget* parent, const QString& title,
progress.GetDialog().setWindowTitle(title);
progress.GetDialog().setWindowIcon(GetAppIcon());
progress.SetCancellable(true);
progress.MakeVisible();
http->CreateRequest(
std::move(url),

View File

@ -97,11 +97,13 @@ void QtModalProgressCallback::checkForDelayedShow()
return;
if (m_show_timer.GetTimeSeconds() >= m_show_delay)
{
m_dialog.setRange(0, m_progress_range);
m_dialog.setValue(m_progress_value);
m_dialog.show();
}
MakeVisible();
}
void QtModalProgressCallback::MakeVisible()
{
m_dialog.setRange(0, m_progress_range);
m_dialog.setValue(m_progress_value);
m_dialog.show();
}
// NOTE: We deliberately don't set the thread parent, because otherwise we can't move it.

View File

@ -31,6 +31,8 @@ public:
bool ModalConfirmation(const std::string_view message) override;
void ModalInformation(const std::string_view message) override;
void MakeVisible();
private Q_SLOTS:
void dialogCancelled();