mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-08 04:25:37 +00:00
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.SetStatusText(tr("Downloading %1...").arg(m_latest_sha).toUtf8().constData());
|
||||||
progress.GetDialog().setWindowIcon(windowIcon());
|
progress.GetDialog().setWindowIcon(windowIcon());
|
||||||
progress.SetCancellable(true);
|
progress.SetCancellable(true);
|
||||||
|
progress.MakeVisible();
|
||||||
|
|
||||||
m_http->CreateRequest(
|
m_http->CreateRequest(
|
||||||
m_download_url.toStdString(),
|
m_download_url.toStdString(),
|
||||||
|
@ -492,6 +492,7 @@ void GameSummaryWidget::onComputeHashClicked()
|
|||||||
QtModalProgressCallback progress_callback(this);
|
QtModalProgressCallback progress_callback(this);
|
||||||
progress_callback.SetCancellable(true);
|
progress_callback.SetCancellable(true);
|
||||||
progress_callback.SetProgressRange(image->GetTrackCount());
|
progress_callback.SetProgressRange(image->GetTrackCount());
|
||||||
|
progress_callback.MakeVisible();
|
||||||
|
|
||||||
std::vector<CDImageHasher::Hash> track_hashes;
|
std::vector<CDImageHasher::Hash> track_hashes;
|
||||||
track_hashes.reserve(image->GetTrackCount());
|
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().setWindowTitle(title);
|
||||||
progress.GetDialog().setWindowIcon(GetAppIcon());
|
progress.GetDialog().setWindowIcon(GetAppIcon());
|
||||||
progress.SetCancellable(true);
|
progress.SetCancellable(true);
|
||||||
|
progress.MakeVisible();
|
||||||
|
|
||||||
http->CreateRequest(
|
http->CreateRequest(
|
||||||
std::move(url),
|
std::move(url),
|
||||||
|
@ -97,11 +97,13 @@ void QtModalProgressCallback::checkForDelayedShow()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_show_timer.GetTimeSeconds() >= m_show_delay)
|
if (m_show_timer.GetTimeSeconds() >= m_show_delay)
|
||||||
{
|
MakeVisible();
|
||||||
m_dialog.setRange(0, m_progress_range);
|
}
|
||||||
m_dialog.setValue(m_progress_value);
|
void QtModalProgressCallback::MakeVisible()
|
||||||
m_dialog.show();
|
{
|
||||||
}
|
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.
|
// 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;
|
bool ModalConfirmation(const std::string_view message) override;
|
||||||
void ModalInformation(const std::string_view message) override;
|
void ModalInformation(const std::string_view message) override;
|
||||||
|
|
||||||
|
void MakeVisible();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void dialogCancelled();
|
void dialogCancelled();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user