2019-02-07 07:45:06 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
|
2021-08-16 13:28:41 +02:00
|
|
|
#include <json11.hpp>
|
2019-02-07 07:45:06 +01:00
|
|
|
#include "auth-oauth.hpp"
|
|
|
|
|
2019-09-04 01:08:48 +02:00
|
|
|
class BrowserDock;
|
2019-02-07 07:45:06 +01:00
|
|
|
|
|
|
|
class TwitchAuth : public OAuthStreamKey {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
friend class TwitchLogin;
|
|
|
|
|
|
|
|
bool uiLoaded = false;
|
|
|
|
|
|
|
|
std::string name;
|
2021-12-03 19:45:54 +01:00
|
|
|
std::string uuid;
|
2019-02-07 07:45:06 +01:00
|
|
|
|
|
|
|
virtual bool RetryLogin() override;
|
|
|
|
|
|
|
|
virtual void SaveInternal() override;
|
|
|
|
virtual bool LoadInternal() override;
|
|
|
|
|
2021-08-16 13:28:41 +02:00
|
|
|
bool MakeApiRequest(const char *path, json11::Json &json_out);
|
2019-02-07 07:45:06 +01:00
|
|
|
bool GetChannelInfo();
|
|
|
|
|
|
|
|
virtual void LoadUI() override;
|
|
|
|
|
|
|
|
public:
|
|
|
|
TwitchAuth(const Def &d);
|
2022-10-21 16:53:06 +02:00
|
|
|
~TwitchAuth();
|
2019-02-07 07:45:06 +01:00
|
|
|
|
2021-06-27 14:01:50 +02:00
|
|
|
static std::shared_ptr<Auth> Login(QWidget *parent,
|
|
|
|
const std::string &service_name);
|
2019-02-07 07:45:06 +01:00
|
|
|
|
|
|
|
QTimer uiLoadTimer;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void TryLoadSecondaryUIPanes();
|
|
|
|
void LoadSecondaryUIPanes();
|
|
|
|
};
|