2019-03-01 09:05:16 +01:00
|
|
|
/* This program is free software. It comes without any warranty, to
|
|
|
|
* the extent permitted by applicable law. You can redistribute it
|
|
|
|
* and/or modify it under the terms of the Do What The Fuck You Want
|
|
|
|
* To Public License, Version 2, as published by Sam Hocevar. See
|
|
|
|
* http://www.wtfpl.net/ for more details. */
|
|
|
|
|
|
|
|
#ifndef GUI_LOGIN_H
|
|
|
|
#define GUI_LOGIN_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "globals.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QWebEngineCookieStore>
|
|
|
|
#include <iostream>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class GuiLogin : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GuiLogin();
|
|
|
|
virtual ~GuiLogin();
|
|
|
|
|
|
|
|
void Login();
|
2019-04-22 16:39:10 +02:00
|
|
|
void Login(const std::string& username, const std::string& password);
|
2019-03-01 09:05:16 +01:00
|
|
|
std::string getCode();
|
|
|
|
std::vector<std::string> getCookies();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QWebEngineCookieStore *cookiestore;
|
|
|
|
std::vector<std::string> cookies;
|
|
|
|
std::string auth_code;
|
2019-04-22 16:39:10 +02:00
|
|
|
std::string login_username;
|
|
|
|
std::string login_password;
|
2019-03-01 09:05:16 +01:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void loadFinished(bool success);
|
|
|
|
void cookieAdded(const QNetworkCookie &cookie);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GUI_LOGIN_H
|