summaryrefslogtreecommitdiff
path: root/src/nxmaccessmanager.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-07-07 19:00:34 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-07-10 20:45:37 -0400
commitd9003f9e5407396fdd552c5df3d0be76ab9a16a3 (patch)
treed5f1234c658eea92be83b53f681b0e950b719910 /src/nxmaccessmanager.h
parent89d0528a002a3cd7f0db47b2db53bdaf0e9c494d (diff)
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
Diffstat (limited to 'src/nxmaccessmanager.h')
-rw-r--r--src/nxmaccessmanager.h12
1 files changed, 9 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>.
#include <QNetworkReply>
#include <QProgressDialog>
#include <QElapsedTimer>
+#include <QDialogButtonBox>
#include <set>
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<QDialog> m_dialogHolder;
- QDialog* m_dialog;
QProgressBar* m_bar;
+ QDialogButtonBox* m_buttons;
QTimer* m_timer;
QElapsedTimer m_elapsed;