Qt: Fix delay in progress dialog opening
Applies to updater, verify, etc.
This commit is contained in:
parent
920f25427e
commit
076f4a6293
|
@ -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(),
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -97,11 +97,13 @@ void QtModalProgressCallback::checkForDelayedShow()
|
|||
return;
|
||||
|
||||
if (m_show_timer.GetTimeSeconds() >= m_show_delay)
|
||||
{
|
||||
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.
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue