From d9003f9e5407396fdd552c5df3d0be76ab9a16a3 Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Sun, 7 Jul 2019 19:00:34 -0400
Subject: made ValidationProgressDialog a QDialog to handle close events allow
hiding dialog and make it appear again if needed don't use an event loop in
validated(), it causes all sorts of problems because it can be reentrant if
another logged in action is done while the dialog is visible
---
src/nxmaccessmanager.h | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
(limited to 'src/nxmaccessmanager.h')
diff --git a/src/nxmaccessmanager.h b/src/nxmaccessmanager.h
index b20cb6e8..4467ea8d 100644
--- a/src/nxmaccessmanager.h
+++ b/src/nxmaccessmanager.h
@@ -26,11 +26,12 @@ along with Mod Organizer. If not, see .
#include
#include
#include
+#include
#include
namespace MOBase { class IPluginGame; }
-class ValidationProgressDialog : QObject
+class ValidationProgressDialog : private QDialog
{
Q_OBJECT;
@@ -38,14 +39,19 @@ public:
ValidationProgressDialog(std::chrono::seconds timeout);
void setParentWidget(QWidget* w);
+
void start();
void stop();
+ using QDialog::show;
+
+protected:
+ void closeEvent(QCloseEvent* e) override;
+
private:
std::chrono::seconds m_timeout;
- std::unique_ptr m_dialogHolder;
- QDialog* m_dialog;
QProgressBar* m_bar;
+ QDialogButtonBox* m_buttons;
QTimer* m_timer;
QElapsedTimer m_elapsed;
--
cgit v1.3.1