configurator/Configurator.h
Bernhard Rosenkränzer 32af5c8e93 Service selection dialog
2024-09-03 15:40:08 +02:00

28 lines
734 B
C++

#pragma once
#include <QApplication>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <dialogs/FederatedLogin.h>
#include <lib/Service.h>
class Configurator:public QApplication {
Q_OBJECT
public:
Configurator(int &argc, char **&argv);
QNetworkAccessManager &nam() { return _nam; }
QString baseUrl() const { return "https://dashboard." + _loginDialog->domain(); }
QByteArray download(QUrl const &url);
void waitForDownload(QNetworkReply *r) const;
Services const &services() const { return _services; }
protected Q_SLOTS:
void loginRequested();
private:
QNetworkAccessManager _nam;
FederatedLogin * _loginDialog;
Services _services;
};
#define app static_cast<Configurator*>(Configurator::instance())