diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-11 02:31:59 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-11 02:31:59 -0400 |
| commit | ad29525e982f83343dbd70e17b914e0a30adb662 (patch) | |
| tree | 09ee6531679787412b3e16bcdbbe6156a20f9a8c /src/settingsdialog.h | |
| parent | 5e5681709ab878f3aa6cf1344af44e8ae9544987 (diff) | |
moved NexusSSOLogin to nxmaccessmanager
added logs for manual key validation, will need to rewrite a few things
Diffstat (limited to 'src/settingsdialog.h')
| -rw-r--r-- | src/settingsdialog.h | 52 |
1 files changed, 2 insertions, 50 deletions
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 <http://www.gnu.org/licenses/>. #define SETTINGSDIALOG_H #include "tutorabledialog.h" +#include "nxmaccessmanager.h" #include <iplugin.h> -#include <QComboBox> -#include <QDialog> -#include <QWebSocket> #include <QListWidgetItem> -#include <QTimer> 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<void (QString)> keyChanged; - std::function<void (States, QString)> 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 |
