mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
moved protocol config generation to VpnConfigirationsController (#665)
Moved protocol config generation to VpnConfigurationsController
This commit is contained in:
+2
-19
@@ -11,7 +11,6 @@
|
||||
#include "core/defs.h"
|
||||
#include "settings.h"
|
||||
|
||||
|
||||
#ifdef AMNEZIA_DESKTOP
|
||||
#include "core/ipcclient.h"
|
||||
#endif
|
||||
@@ -20,9 +19,6 @@
|
||||
#include "protocols/android_vpnprotocol.h"
|
||||
#endif
|
||||
|
||||
class VpnConfigurator;
|
||||
class ServerController;
|
||||
|
||||
using namespace amnezia;
|
||||
|
||||
class VpnConnection : public QObject
|
||||
@@ -30,24 +26,13 @@ class VpnConnection : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit VpnConnection(std::shared_ptr<Settings> settings,
|
||||
std::shared_ptr<VpnConfigurator> configurator, QObject* parent = nullptr);
|
||||
explicit VpnConnection(std::shared_ptr<Settings> settings, QObject* parent = nullptr);
|
||||
~VpnConnection() override;
|
||||
|
||||
static QString bytesPerSecToText(quint64 bytes);
|
||||
|
||||
ErrorCode lastError() const;
|
||||
|
||||
static QMap<Proto, QString> getLastVpnConfig(const QJsonObject &containerConfig);
|
||||
QString createVpnConfigurationForProto(int serverIndex,
|
||||
const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig, Proto proto,
|
||||
ErrorCode *errorCode = nullptr);
|
||||
|
||||
QJsonObject createVpnConfiguration(int serverIndex,
|
||||
const ServerCredentials &credentials, DockerContainer container,
|
||||
const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr);
|
||||
|
||||
|
||||
bool isConnected() const;
|
||||
bool isDisconnected() const;
|
||||
|
||||
@@ -63,7 +48,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void connectToVpn(int serverIndex,
|
||||
const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig);
|
||||
const ServerCredentials &credentials, DockerContainer container, const QJsonObject &vpnConfiguration);
|
||||
|
||||
void disconnectFromVpn();
|
||||
|
||||
@@ -88,8 +73,6 @@ protected:
|
||||
|
||||
private:
|
||||
std::shared_ptr<Settings> m_settings;
|
||||
std::shared_ptr<VpnConfigurator> m_configurator;
|
||||
|
||||
QJsonObject m_vpnConfiguration;
|
||||
QJsonObject m_routeMode;
|
||||
QString m_remoteAddress;
|
||||
|
||||
Reference in New Issue
Block a user