mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
49 lines
1.5 KiB
C++
49 lines
1.5 KiB
C++
|
|
#ifndef APPSPLITTUNNELINGUICONTROLLER_H
|
||
|
|
#define APPSPLITTUNNELINGUICONTROLLER_H
|
||
|
|
|
||
|
|
#include <QObject>
|
||
|
|
#include <QVector>
|
||
|
|
|
||
|
|
#include "core/controllers/appSplitTunnelingController.h"
|
||
|
|
#include "core/utils/errorCodes.h"
|
||
|
|
#include "core/utils/routeModes.h"
|
||
|
|
#include "core/utils/commonStructs.h"
|
||
|
|
#include "ui/models/appSplitTunnelingModel.h"
|
||
|
|
|
||
|
|
class AppSplitTunnelingUiController : public QObject
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
Q_PROPERTY(int routeMode READ getRouteMode WRITE setRouteMode NOTIFY routeModeChanged)
|
||
|
|
Q_PROPERTY(bool isSplitTunnelingEnabled READ isSplitTunnelingEnabled NOTIFY isSplitTunnelingEnabledChanged)
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit AppSplitTunnelingUiController(AppSplitTunnelingController* appSplitTunnelingController,
|
||
|
|
AppSplitTunnelingModel* appSplitTunnelingModel,
|
||
|
|
QObject *parent = nullptr);
|
||
|
|
|
||
|
|
public slots:
|
||
|
|
void addApp(const QString &appPath);
|
||
|
|
void addApps(QVector<QPair<QString, QString>> apps);
|
||
|
|
void removeApp(const int index);
|
||
|
|
void toggleSplitTunneling(bool enabled);
|
||
|
|
void setRouteMode(int routeMode);
|
||
|
|
|
||
|
|
int getRouteMode() const;
|
||
|
|
bool isSplitTunnelingEnabled() const;
|
||
|
|
|
||
|
|
void updateModel();
|
||
|
|
|
||
|
|
signals:
|
||
|
|
void routeModeChanged();
|
||
|
|
void isSplitTunnelingEnabledChanged();
|
||
|
|
void errorOccurred(const QString &errorMessage);
|
||
|
|
void finished(const QString &message);
|
||
|
|
|
||
|
|
private:
|
||
|
|
AppSplitTunnelingController* m_appSplitTunnelingController;
|
||
|
|
AppSplitTunnelingModel* m_appSplitTunnelingModel;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // APPSPLITTUNNELINGUICONTROLLER_H
|