mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
* feat: Add msi quite installer * chore: update code for new wix * feat: add cpack wix installer * feat: add gihub workflow for msi * chore: fix deploy script * chore: add wix logs * chore: fix msi build * chore: fix msi build * chore: add wix exts log * chore: add cpackwixpatch for registering the service * chore: fix build script * chore: fix wix fragment * feat: add closing app with reinstalling * chore: update version for test * chore: fix build script * feat: added cli commands --connect and --import (#1967) * fix: delete unused file and disable rollback after unsuccessful service start in msi installer * fix: Add deps to msi * fix: msi deps * feat: added os signal handler * fix: incorrect import at the empty client start (#2024) * chore: add force quit for os signal handler * feat: os signal handler improvements * fix: fixed --connection command --------- Co-authored-by: Mykola Baibuz <mykola.baibuz@gmail.com> Co-authored-by: aiamnezia <ai@amnezia.org> Co-authored-by: Mitternacht822 <sb@amnezia.org>
77 lines
1.8 KiB
C++
77 lines
1.8 KiB
C++
#ifndef AMNEZIA_APPLICATION_H
|
|
#define AMNEZIA_APPLICATION_H
|
|
|
|
#include <QCommandLineParser>
|
|
#include <QNetworkAccessManager>
|
|
#include <QQmlApplicationEngine>
|
|
#include <QQmlContext>
|
|
#include <QThread>
|
|
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
|
#include <QGuiApplication>
|
|
#else
|
|
#include <QApplication>
|
|
#endif
|
|
#include <QClipboard>
|
|
|
|
#include "core/controllers/coreController.h"
|
|
#include "settings.h"
|
|
#include "vpnconnection.h"
|
|
|
|
#define amnApp (static_cast<AmneziaApplication *>(QCoreApplication::instance()))
|
|
|
|
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
|
#define AMNEZIA_BASE_CLASS QGuiApplication
|
|
#else
|
|
#define AMNEZIA_BASE_CLASS QApplication
|
|
#endif
|
|
|
|
class AmneziaApplication : public AMNEZIA_BASE_CLASS
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
AmneziaApplication(int &argc, char *argv[]);
|
|
virtual ~AmneziaApplication();
|
|
|
|
void init();
|
|
void registerTypes();
|
|
void loadFonts();
|
|
bool parseCommands();
|
|
|
|
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) && !defined(MACOS_NE)
|
|
void startLocalServer();
|
|
#endif
|
|
|
|
QQmlApplicationEngine *qmlEngine() const;
|
|
QNetworkAccessManager *networkManager();
|
|
QClipboard *getClipboard();
|
|
|
|
public slots:
|
|
void forceQuit();
|
|
|
|
private:
|
|
static bool m_forceQuit;
|
|
QQmlApplicationEngine *m_engine {};
|
|
std::shared_ptr<Settings> m_settings;
|
|
|
|
QScopedPointer<CoreController> m_coreController;
|
|
|
|
QSharedPointer<ContainerProps> m_containerProps;
|
|
QSharedPointer<ProtocolProps> m_protocolProps;
|
|
|
|
QCommandLineParser m_parser;
|
|
|
|
QCommandLineOption m_optAutostart;
|
|
QCommandLineOption m_optCleanup;
|
|
QCommandLineOption m_optConnect;
|
|
QCommandLineOption m_optImport;
|
|
|
|
QSharedPointer<VpnConnection> m_vpnConnection;
|
|
QThread m_vpnConnectionThread;
|
|
|
|
QNetworkAccessManager *m_nam;
|
|
protected:
|
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
|
};
|
|
|
|
#endif // AMNEZIA_APPLICATION_H
|