From abfa1114bc228cf7d3a12fa0ac21a9e08bce4439 Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 5 Oct 2019 17:22:40 +0200 Subject: [PATCH] Add progress_dialog::SignalFailure() Turns the taskbar progress bar red, commonly used on Windows in cases like this to signal failure. --- rpcs3/rpcs3qt/progress_dialog.cpp | 8 ++++++++ rpcs3/rpcs3qt/progress_dialog.h | 1 + 2 files changed, 9 insertions(+) diff --git a/rpcs3/rpcs3qt/progress_dialog.cpp b/rpcs3/rpcs3qt/progress_dialog.cpp index 8481cba75a..120765927b 100644 --- a/rpcs3/rpcs3qt/progress_dialog.cpp +++ b/rpcs3/rpcs3qt/progress_dialog.cpp @@ -44,6 +44,14 @@ void progress_dialog::SetValue(int progress) QProgressDialog::setValue(value); } +void progress_dialog::SignalFailure() +{ +#ifdef _WIN32 + m_tb_progress->stop(); +#endif + // TODO: Implement an equivalent for Linux, if possible +} + #ifdef HAVE_QTDBUS void progress_dialog::UpdateProgress(int progress, bool disable) { diff --git a/rpcs3/rpcs3qt/progress_dialog.h b/rpcs3/rpcs3qt/progress_dialog.h index e11e8f55bb..395c9fc7b7 100644 --- a/rpcs3/rpcs3qt/progress_dialog.h +++ b/rpcs3/rpcs3qt/progress_dialog.h @@ -20,6 +20,7 @@ public: progress_dialog(const QString &windowTitle, const QString &labelText, const QString &cancelButtonText, int minimum, int maximum, QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags()); ~progress_dialog(); void SetValue(int progress); + void SignalFailure(); private: #ifdef _WIN32