39 lines
869 B
C++
39 lines
869 B
C++
// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <stdexcept>
|
|
#include <memory>
|
|
|
|
#include <QString>
|
|
#include <QUrl>
|
|
#include <QGuiApplication>
|
|
#include <QQmlApplicationEngine>
|
|
#include <QQmlContext>
|
|
|
|
#include "models/magpie.h"
|
|
#include "API/api.h"
|
|
|
|
class Root : public QGuiApplication {
|
|
Q_OBJECT
|
|
public:
|
|
Root(const QUrl& root, int& argc, char* argv[]);
|
|
~Root();
|
|
bool notify(QObject* receiver, QEvent* e) override;
|
|
|
|
private slots:
|
|
void onObjectCreated(QObject* obj, const QUrl& objUrl);
|
|
void onAPIAddressChanged(const QUrl& url);
|
|
void onStoreTokens(const QString& access, const QString& renew);
|
|
|
|
private:
|
|
QUrl root;
|
|
QQmlApplicationEngine engine;
|
|
QQmlContext* context;
|
|
Models::Magpie magpie;
|
|
std::shared_ptr<API> api;
|
|
|
|
};
|