From 4c5e3da2334a1d0c474148be8881b46d6ca6d3fa Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Mon, 17 Aug 2020 05:06:26 -0400
Subject: moved nexus api stuff to GlobalSettings pass a pointer to Settings
around for things that can be called without settings, when creating the
first instance added dummy plugin list, mod list and iorganizer to initialize
plugins without an instance moved PluginContainer into the core filter, had
nothing to do with the plugins list NexusInterface is now created manually
instead of being a static singleton because it needs to know if the settings
are available
---
src/nxmaccessmanager.h | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
(limited to 'src/nxmaccessmanager.h')
diff --git a/src/nxmaccessmanager.h b/src/nxmaccessmanager.h
index 6a45d880..60100467 100644
--- a/src/nxmaccessmanager.h
+++ b/src/nxmaccessmanager.h
@@ -33,6 +33,7 @@ along with Mod Organizer. If not, see .
namespace MOBase { class IPluginGame; }
namespace Ui { class ValidationProgressDialog; }
class NXMAccessManager;
+class Settings;
class NexusSSOLogin
{
@@ -146,7 +147,7 @@ public:
std::function finished;
std::function attemptFinished;
- NexusKeyValidator(NXMAccessManager& am);
+ NexusKeyValidator(Settings* s, NXMAccessManager& am);
~NexusKeyValidator();
void start(const QString& key, Behaviour b);
@@ -157,11 +158,13 @@ public:
const ValidationAttempt* currentAttempt() const;
private:
+ Settings* m_settings;
NXMAccessManager& m_manager;
QString m_key;
std::vector> m_attempts;
void createAttempts(const std::vector& timeouts);
+ std::vector getTimeouts() const;
bool nextTry();
void onAttemptSuccess(const ValidationAttempt& a, const APIUserAccount& u);
@@ -178,7 +181,7 @@ class ValidationProgressDialog : public QDialog
Q_OBJECT;
public:
- ValidationProgressDialog(NexusKeyValidator& v);
+ ValidationProgressDialog(Settings* s, NexusKeyValidator& v);
void setParentWidget(QWidget* w);
@@ -191,6 +194,7 @@ protected:
private:
std::unique_ptr ui;
+ Settings* m_settings;
NexusKeyValidator& m_validator;
QTimer* m_updateTimer;
bool m_first;
@@ -209,7 +213,7 @@ class NXMAccessManager : public QNetworkAccessManager
{
Q_OBJECT
public:
- NXMAccessManager(QObject *parent, const QString &moVersion);
+ NXMAccessManager(QObject *parent, Settings* s, const QString &moVersion);
void setTopLevelWidget(QWidget* w);
@@ -264,6 +268,7 @@ private:
};
QWidget* m_TopLevel;
+ Settings* m_Settings;
mutable std::unique_ptr m_ProgressDialog;
QString m_MOVersion;
NexusKeyValidator m_validator;
--
cgit v1.3.1