From ad29525e982f83343dbd70e17b914e0a30adb662 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Thu, 11 Jul 2019 02:31:59 -0400 Subject: moved NexusSSOLogin to nxmaccessmanager added logs for manual key validation, will need to rewrite a few things --- src/settingsdialog.h | 52 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 50 deletions(-) (limited to 'src/settingsdialog.h') diff --git a/src/settingsdialog.h b/src/settingsdialog.h index aee447d7..507214dd 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -21,12 +21,9 @@ along with Mod Organizer. If not, see . #define SETTINGSDIALOG_H #include "tutorabledialog.h" +#include "nxmaccessmanager.h" #include -#include -#include -#include #include -#include class PluginContainer; class Settings; @@ -35,51 +32,6 @@ namespace Ui { class SettingsDialog; } -class NexusSSOLogin -{ -public: - enum States - { - Idle, - ConnectingToSSO, - WaitingForToken, - WaitingForBrowser, - Finished, - Timeout, - ClosedByRemote, - Cancelled, - Error - }; - - std::function keyChanged; - std::function stateChanged; - - NexusSSOLogin(); - - void start(); - void cancel(); - - bool isActive() const; - -private: - QWebSocket m_socket; - QString m_guid; - bool m_keyReceived; - QString m_token; - bool m_active; - QTimer m_timeout; - - void setState(States s, const QString& error={}); - - void close(); - void abort(); - - void onConnected(); - void onMessage(const QString& s); - void onDisconnected(); - void onError(QAbstractSocket::SocketError e); - void onTimeout(); -}; /** * dialog used to change settings for Mod Organizer. On top of the @@ -197,9 +149,9 @@ private: void updateNexusButtons(); void fetchNexusApiKey(); - void testApiKey(); void onKeyChanged(const QString& key); void onStateChanged(NexusSSOLogin::States s, const QString& e); + void onManualKeyValidation(bool success, const QString& e); }; #endif // SETTINGSDIALOG_H -- cgit v1.3.1