Merge branch 'dev' into qt_migration

This commit is contained in:
pokamest 2023-01-08 23:00:13 +00:00
commit 167d3caa5d
47 changed files with 1061 additions and 876 deletions

View file

@ -76,6 +76,7 @@ HEADERS += \
ui/pages_logic/protocols/OtherProtocolsLogic.h \ ui/pages_logic/protocols/OtherProtocolsLogic.h \
ui/pages_logic/protocols/PageProtocolLogicBase.h \ ui/pages_logic/protocols/PageProtocolLogicBase.h \
ui/pages_logic/protocols/ShadowSocksLogic.h \ ui/pages_logic/protocols/ShadowSocksLogic.h \
ui/pages_logic/protocols/WireGuardLogic.h \
ui/property_helper.h \ ui/property_helper.h \
ui/models/servers_model.h \ ui/models/servers_model.h \
ui/uilogic.h \ ui/uilogic.h \
@ -138,6 +139,7 @@ SOURCES += \
ui/pages_logic/protocols/PageProtocolLogicBase.cpp \ ui/pages_logic/protocols/PageProtocolLogicBase.cpp \
ui/pages_logic/protocols/ShadowSocksLogic.cpp \ ui/pages_logic/protocols/ShadowSocksLogic.cpp \
ui/models/servers_model.cpp \ ui/models/servers_model.cpp \
ui/pages_logic/protocols/WireGuardLogic.cpp \
ui/uilogic.cpp \ ui/uilogic.cpp \
ui/qautostart.cpp \ ui/qautostart.cpp \
ui/models/sites_model.cpp \ ui/models/sites_model.cpp \

View file

@ -58,6 +58,12 @@ constexpr char additional_server_config[] = "additional_server_config";
// proto config keys // proto config keys
constexpr char last_config[] = "last_config"; constexpr char last_config[] = "last_config";
constexpr char isThirdPartyConfig[] = "isThirdPartyConfig";
constexpr char openvpn[] = "openvpn";
constexpr char wireguard[] = "wireguard";
} }
namespace protocols { namespace protocols {

View file

@ -63,6 +63,7 @@
<file>server_scripts/website_tor/run_container.sh</file> <file>server_scripts/website_tor/run_container.sh</file>
<file>ui/qml/main.qml</file> <file>ui/qml/main.qml</file>
<file>ui/qml/TitleBar.qml</file> <file>ui/qml/TitleBar.qml</file>
<file>ui/qml/Pages/PageBase.qml</file>
<file>ui/qml/Pages/PageAppSetting.qml</file> <file>ui/qml/Pages/PageAppSetting.qml</file>
<file>ui/qml/Pages/PageGeneralSettings.qml</file> <file>ui/qml/Pages/PageGeneralSettings.qml</file>
<file>ui/qml/Pages/PageNetworkSetting.qml</file> <file>ui/qml/Pages/PageNetworkSetting.qml</file>
@ -81,6 +82,28 @@
<file>ui/qml/Pages/PageSites.qml</file> <file>ui/qml/Pages/PageSites.qml</file>
<file>ui/qml/Pages/PageStart.qml</file> <file>ui/qml/Pages/PageStart.qml</file>
<file>ui/qml/Pages/PageVPN.qml</file> <file>ui/qml/Pages/PageVPN.qml</file>
<file>ui/qml/Pages/PageQrDecoder.qml</file>
<file>ui/qml/Pages/PageAbout.qml</file>
<file>ui/qml/Pages/PageQrDecoderIos.qml</file>
<file>ui/qml/Pages/PageViewConfig.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoCloak.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoOpenVPN.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoShadowSocks.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoSftp.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoTorWebSite.qml</file>
<file>ui/qml/Pages/Protocols/PageProtocolBase.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoWireGuard.qml</file>
<file>ui/qml/Pages/InstallSettings/InstallSettingsBase.qml</file>
<file>ui/qml/Pages/InstallSettings/SelectContainer.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoCloak.qml</file>
<file>ui/qml/Pages/Share/PageShareProtocolBase.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoOpenVPN.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoSftp.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoShadowSocks.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoTorWebSite.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoAmnezia.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoWireGuard.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoIkev2.qml</file>
<file>ui/qml/Controls/BasicButtonType.qml</file> <file>ui/qml/Controls/BasicButtonType.qml</file>
<file>ui/qml/Controls/BlueButtonType.qml</file> <file>ui/qml/Controls/BlueButtonType.qml</file>
<file>ui/qml/Controls/CheckBoxType.qml</file> <file>ui/qml/Controls/CheckBoxType.qml</file>
@ -92,57 +115,40 @@
<file>ui/qml/Controls/ShareConnectionButtonType.qml</file> <file>ui/qml/Controls/ShareConnectionButtonType.qml</file>
<file>ui/qml/Controls/ShareConnectionContent.qml</file> <file>ui/qml/Controls/ShareConnectionContent.qml</file>
<file>ui/qml/Controls/TextFieldType.qml</file> <file>ui/qml/Controls/TextFieldType.qml</file>
<file>ui/qml/Pages/PageBase.qml</file> <file>ui/qml/Controls/RichLabelType.qml</file>
<file>ui/qml/Config/GlobalConfig.qml</file> <file>ui/qml/Controls/SvgImageType.qml</file>
<file>ui/qml/Config/qmldir</file> <file>ui/qml/Controls/FlickableType.qml</file>
<file>images/background_connected.png</file> <file>ui/qml/Controls/UrlButtonType.qml</file>
<file>images/background_connected@2x.png</file> <file>ui/qml/Controls/TextAreaType.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoCloak.qml</file> <file>ui/qml/Controls/ContextMenu.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoOpenVPN.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoShadowSocks.qml</file>
<file>ui/qml/Controls/BackButton.qml</file>
<file>ui/qml/Pages/InstallSettings/InstallSettingsBase.qml</file>
<file>ui/qml/Controls/Caption.qml</file>
<file>ui/qml/Controls/Logo.qml</file>
<file>ui/qml/Pages/InstallSettings/SelectContainer.qml</file>
<file>ui/qml/Pages/Protocols/PageProtocolBase.qml</file>
<file>images/delete.png</file>
<file>ui/qml/Controls/FadeBehavior.qml</file> <file>ui/qml/Controls/FadeBehavior.qml</file>
<file>ui/qml/Controls/VisibleBehavior.qml</file> <file>ui/qml/Controls/VisibleBehavior.qml</file>
<file>ui/qml/Controls/Caption.qml</file>
<file>ui/qml/Controls/Logo.qml</file>
<file>ui/qml/Controls/BackButton.qml</file>
<file>ui/qml/Controls/ShareConnectionButtonCopyType.qml</file>
<file>ui/qml/Controls/SvgButtonType.qml</file>
<file>ui/qml/Config/GlobalConfig.qml</file>
<file>ui/qml/Config/qmldir</file>
<file>server_scripts/dns/configure_container.sh</file> <file>server_scripts/dns/configure_container.sh</file>
<file>server_scripts/dns/Dockerfile</file> <file>server_scripts/dns/Dockerfile</file>
<file>server_scripts/dns/run_container.sh</file> <file>server_scripts/dns/run_container.sh</file>
<file>server_scripts/sftp/configure_container.sh</file> <file>server_scripts/sftp/configure_container.sh</file>
<file>server_scripts/sftp/Dockerfile</file> <file>server_scripts/sftp/Dockerfile</file>
<file>server_scripts/sftp/run_container.sh</file> <file>server_scripts/sftp/run_container.sh</file>
<file>ui/qml/Pages/Protocols/PageProtoSftp.qml</file>
<file>ui/qml/Pages/Protocols/PageProtoTorWebSite.qml</file>
<file>server_scripts/ipsec/configure_container.sh</file> <file>server_scripts/ipsec/configure_container.sh</file>
<file>server_scripts/ipsec/Dockerfile</file> <file>server_scripts/ipsec/Dockerfile</file>
<file>server_scripts/ipsec/run_container.sh</file> <file>server_scripts/ipsec/run_container.sh</file>
<file>server_scripts/ipsec/start.sh</file> <file>server_scripts/ipsec/start.sh</file>
<file>ui/qml/Pages/Share/PageShareProtoCloak.qml</file>
<file>ui/qml/Pages/Share/PageShareProtocolBase.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoOpenVPN.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoSftp.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoShadowSocks.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoTorWebSite.qml</file>
<file>ui/qml/Controls/TextAreaType.qml</file>
<file>ui/qml/Controls/ContextMenu.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoAmnezia.qml</file>
<file>ui/qml/Controls/ShareConnectionButtonCopyType.qml</file>
<file>ui/qml/Pages/Share/PageShareProtoWireGuard.qml</file>
<file>server_scripts/ipsec/mobileconfig.plist</file> <file>server_scripts/ipsec/mobileconfig.plist</file>
<file>ui/qml/Pages/Share/PageShareProtoIkev2.qml</file>
<file>server_scripts/ipsec/strongswan.profile</file> <file>server_scripts/ipsec/strongswan.profile</file>
<file>images/background_connected.png</file>
<file>images/background_connected@2x.png</file>
<file>images/delete.png</file>
<file>images/animation.gif</file> <file>images/animation.gif</file>
<file>images/connected.png</file> <file>images/connected.png</file>
<file>images/disconnected.png</file> <file>images/disconnected.png</file>
<file>ui/qml/Pages/PageQrDecoder.qml</file>
<file>ui/qml/Pages/PageAbout.qml</file>
<file>ui/qml/Controls/RichLabelType.qml</file>
<file>images/svg/gpp_good_black_24dp.svg</file> <file>images/svg/gpp_good_black_24dp.svg</file>
<file>ui/qml/Controls/SvgImageType.qml</file>
<file>images/svg/gpp_maybe_black_24dp.svg</file> <file>images/svg/gpp_maybe_black_24dp.svg</file>
<file>images/svg/close_black_24dp.svg</file> <file>images/svg/close_black_24dp.svg</file>
<file>images/svg/delete_black_24dp.svg</file> <file>images/svg/delete_black_24dp.svg</file>
@ -156,9 +162,6 @@
<file>images/svg/vpn_key_black_24dp.svg</file> <file>images/svg/vpn_key_black_24dp.svg</file>
<file>images/svg/control_point_black_24dp.svg</file> <file>images/svg/control_point_black_24dp.svg</file>
<file>images/svg/settings_suggest_black_24dp.svg</file> <file>images/svg/settings_suggest_black_24dp.svg</file>
<file>ui/qml/Controls/SvgButtonType.qml</file>
<file>ui/qml/Pages/PageQrDecoderIos.qml</file>
<file>server_scripts/website_tor/Dockerfile</file> <file>server_scripts/website_tor/Dockerfile</file>
<file>ui/qml/Pages/PageViewConfig.qml</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -29,6 +29,7 @@ void ServerContainersLogic::onUpdatePage()
ProtocolsModel *p_model = qobject_cast<ProtocolsModel *>(uiLogic()->protocolsModel()); ProtocolsModel *p_model = qobject_cast<ProtocolsModel *>(uiLogic()->protocolsModel());
p_model->setSelectedServerIndex(uiLogic()->selectedServerIndex); p_model->setSelectedServerIndex(uiLogic()->selectedServerIndex);
set_isManagedServer(m_settings->haveAuthData(uiLogic()->selectedServerIndex));
emit updatePage(); emit updatePage();
} }

View file

@ -19,6 +19,8 @@ public:
Q_INVOKABLE void onPushButtonRemoveClicked(DockerContainer c); Q_INVOKABLE void onPushButtonRemoveClicked(DockerContainer c);
Q_INVOKABLE void onPushButtonContinueClicked(DockerContainer c, int port, TransportProto tp); Q_INVOKABLE void onPushButtonContinueClicked(DockerContainer c, int port, TransportProto tp);
AUTO_PROPERTY(bool, isManagedServer)
public: public:
explicit ServerContainersLogic(UiLogic *uiLogic, QObject *parent = nullptr); explicit ServerContainersLogic(UiLogic *uiLogic, QObject *parent = nullptr);
~ServerContainersLogic() = default; ~ServerContainersLogic() = default;

View file

@ -37,11 +37,17 @@ void ServerSettingsLogic::onUpdatePage()
set_pushButtonShareFullVisible(m_settings->haveAuthData(uiLogic()->selectedServerIndex)); set_pushButtonShareFullVisible(m_settings->haveAuthData(uiLogic()->selectedServerIndex));
const QJsonObject &server = m_settings->server(uiLogic()->selectedServerIndex); const QJsonObject &server = m_settings->server(uiLogic()->selectedServerIndex);
const QString &port = server.value(config_key::port).toString(); const QString &port = server.value(config_key::port).toString();
set_labelServerText(QString("%1@%2%3%4")
.arg(server.value(config_key::userName).toString()) const QString &userName = server.value(config_key::userName).toString();
.arg(server.value(config_key::hostName).toString()) const QString &hostName = server.value(config_key::hostName).toString();
QString name = QString("%1%2%3%4%5")
.arg(userName)
.arg(userName.isEmpty() ? "" : "@")
.arg(hostName)
.arg(port.isEmpty() ? "" : ":") .arg(port.isEmpty() ? "" : ":")
.arg(port)); .arg(port);
set_labelServerText(name);
set_lineEditDescriptionText(server.value(config_key::description).toString()); set_lineEditDescriptionText(server.value(config_key::description).toString());
DockerContainer selectedContainer = m_settings->defaultContainer(uiLogic()->selectedServerIndex); DockerContainer selectedContainer = m_settings->defaultContainer(uiLogic()->selectedServerIndex);

View file

@ -15,6 +15,36 @@
#include "platforms/android/android_controller.h" #include "platforms/android/android_controller.h"
#endif #endif
namespace {
enum class ConfigTypes {
Amnezia,
OpenVpn,
WireGuard
};
ConfigTypes checkConfigFormat(const QString &config)
{
const QString openVpnConfigPatternCli = "client";
const QString openVpnConfigPatternProto1 = "proto tcp";
const QString openVpnConfigPatternProto2 = "proto udp";
const QString openVpnConfigPatternDriver1 = "dev tun";
const QString openVpnConfigPatternDriver2 = "dev tap";
const QString wireguardConfigPatternSectionInterface = "[Interface]";
const QString wireguardConfigPatternSectionPeer = "[Peer]";
if (config.contains(openVpnConfigPatternCli) &&
(config.contains(openVpnConfigPatternProto1) || config.contains(openVpnConfigPatternProto2)) &&
(config.contains(openVpnConfigPatternDriver1) || config.contains(openVpnConfigPatternDriver2))) {
return ConfigTypes::OpenVpn;
} else if (config.contains(wireguardConfigPatternSectionInterface) &&
config.contains(wireguardConfigPatternSectionPeer))
return ConfigTypes::WireGuard;
return ConfigTypes::Amnezia;
}
}
StartPageLogic::StartPageLogic(UiLogic *logic, QObject *parent): StartPageLogic::StartPageLogic(UiLogic *logic, QObject *parent):
PageLogicBase(logic, parent), PageLogicBase(logic, parent),
m_pushButtonConnectEnabled{true}, m_pushButtonConnectEnabled{true},
@ -135,16 +165,23 @@ void StartPageLogic::onPushButtonImport()
void StartPageLogic::onPushButtonImportOpenFile() void StartPageLogic::onPushButtonImportOpenFile()
{ {
QString fileName = QFileDialog::getOpenFileName(Q_NULLPTR, tr("Open profile"), QString fileName = QFileDialog::getOpenFileName(Q_NULLPTR, tr("Open config file"),
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), tr("*.vpn")); QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.vpn *.ovpn *.conf");
if (fileName.isEmpty()) return; if (fileName.isEmpty()) return;
QFile file(fileName); QFile file(fileName);
file.open(QIODevice::ReadOnly); file.open(QIODevice::ReadOnly);
QByteArray data = file.readAll(); QByteArray data = file.readAll();
auto configFormat = checkConfigFormat(QString(data));
if (configFormat == ConfigTypes::OpenVpn) {
importConnectionFromOpenVpnConfig(QString(data));
} else if (configFormat == ConfigTypes::WireGuard) {
importConnectionFromWireguardConfig(QString(data));
} else {
importConnectionFromCode(QString(data)); importConnectionFromCode(QString(data));
} }
}
bool StartPageLogic::importConnection(const QJsonObject &profile) bool StartPageLogic::importConnection(const QJsonObject &profile)
{ {
@ -201,3 +238,90 @@ bool StartPageLogic::importConnectionFromQr(const QByteArray &data)
return false; return false;
} }
bool StartPageLogic::importConnectionFromOpenVpnConfig(const QString &config)
{
QJsonObject openVpnConfig;
openVpnConfig[config_key::config] = config;
QJsonObject lastConfig;
lastConfig[config_key::last_config] = QString(QJsonDocument(openVpnConfig).toJson());
lastConfig[config_key::isThirdPartyConfig] = true;
QJsonObject containers;
containers.insert(config_key::container, QJsonValue("amnezia-openvpn"));
containers.insert(config_key::openvpn, QJsonValue(lastConfig));
QJsonArray arr;
arr.push_back(containers);
QString hostName;
const static QRegularExpression hostNameRegExp("remote (.*) [0-9]*");
QRegularExpressionMatch hostNameMatch = hostNameRegExp.match(config);
if (hostNameMatch.hasMatch()) {
hostName = hostNameMatch.captured(1);
}
QJsonObject o;
o[config_key::containers] = arr;
o[config_key::defaultContainer] = "amnezia-openvpn";
o[config_key::description] = m_settings->nextAvailableServerName();
const static QRegularExpression dnsRegExp("dhcp-option DNS (\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b)");
QRegularExpressionMatchIterator dnsMatch = dnsRegExp.globalMatch(config);
if (dnsMatch.hasNext()) {
o[config_key::dns1] = dnsMatch.next().captured(1);
}
if (dnsMatch.hasNext()) {
o[config_key::dns2] = dnsMatch.next().captured(1);
}
o[config_key::hostName] = hostName;
return importConnection(o);
}
bool StartPageLogic::importConnectionFromWireguardConfig(const QString &config)
{
QJsonObject lastConfig;
lastConfig[config_key::config] = config;
const static QRegularExpression hostNameAndPortRegExp("Endpoint = (.*):([0-9]*)");
QRegularExpressionMatch hostNameAndPortMatch = hostNameAndPortRegExp.match(config);
QString hostName;
QString port;
if (hostNameAndPortMatch.hasMatch()) {
hostName = hostNameAndPortMatch.captured(1);
port = hostNameAndPortMatch.captured(2);
}
QJsonObject wireguardConfig;
wireguardConfig[config_key::last_config] = QString(QJsonDocument(lastConfig).toJson());
wireguardConfig[config_key::isThirdPartyConfig] = true;
wireguardConfig[config_key::port] = port;
wireguardConfig[config_key::transport_proto] = "udp";
QJsonObject containers;
containers.insert(config_key::container, QJsonValue("amnezia-wireguard"));
containers.insert(config_key::wireguard, QJsonValue(wireguardConfig));
QJsonArray arr;
arr.push_back(containers);
QJsonObject o;
o[config_key::containers] = arr;
o[config_key::defaultContainer] = "amnezia-wireguard";
o[config_key::description] = m_settings->nextAvailableServerName();
const static QRegularExpression dnsRegExp("DNS = (\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b).*(\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b)");
QRegularExpressionMatch dnsMatch = dnsRegExp.match(config);
if (dnsMatch.hasMatch()) {
o[config_key::dns1] = dnsMatch.captured(1);
o[config_key::dns2] = dnsMatch.captured(2);
}
o[config_key::hostName] = hostName;
return importConnection(o);
}

View file

@ -34,6 +34,8 @@ public:
bool importConnection(const QJsonObject &profile); bool importConnection(const QJsonObject &profile);
bool importConnectionFromCode(QString code); bool importConnectionFromCode(QString code);
bool importConnectionFromQr(const QByteArray &data); bool importConnectionFromQr(const QByteArray &data);
bool importConnectionFromOpenVpnConfig(const QString &config);
bool importConnectionFromWireguardConfig(const QString &config);
public: public:
explicit StartPageLogic(UiLogic *uiLogic, QObject *parent = nullptr); explicit StartPageLogic(UiLogic *uiLogic, QObject *parent = nullptr);

View file

@ -13,6 +13,8 @@ void ViewConfigLogic::onUpdatePage()
{ {
set_configText(QJsonDocument(configJson()).toJson()); set_configText(QJsonDocument(configJson()).toJson());
auto s = configJson()[config_key::isThirdPartyConfig].toBool();
m_openVpnLastConfigs = m_openVpnMalStrings = m_openVpnLastConfigs = m_openVpnMalStrings =
"<style> \ "<style> \
div { line-height: 0.5; } \ div { line-height: 0.5; } \
@ -24,15 +26,28 @@ void ViewConfigLogic::onUpdatePage()
const QJsonArray &containers = configJson()[config_key::containers].toArray(); const QJsonArray &containers = configJson()[config_key::containers].toArray();
int i = 0; int i = 0;
for (const QJsonValue &v: containers) { for (const QJsonValue &v: containers) {
QString cfg_json = v.toObject()[ProtocolProps::protoToString(Proto::OpenVpn)] auto containerName = v.toObject()[config_key::container].toString();
QJsonObject containerConfig = v.toObject()[containerName.replace("amnezia-", "")].toObject();
if (containerConfig[config_key::isThirdPartyConfig].toBool()) {
auto lastConfig = containerConfig.value(config_key::last_config).toString();
auto lastConfigJson = QJsonDocument::fromJson(lastConfig.toUtf8()).object();
QStringList lines = lastConfigJson.value(config_key::config).toString().replace("\r", "").split("\n");
QString lastConfigText;
for (const QString &l: lines) {
lastConfigText.append(l + "\n");
}
set_configText(lastConfigText);
}
if (v.toObject()[config_key::container].toString() == "amnezia-openvpn") {
QString lastConfig = v.toObject()[ProtocolProps::protoToString(Proto::OpenVpn)]
.toObject()[config_key::last_config].toString(); .toObject()[config_key::last_config].toString();
QString openvpn_cfg = QJsonDocument::fromJson(cfg_json.toUtf8()).object()[config_key::config] QString lastConfigJson = QJsonDocument::fromJson(lastConfig.toUtf8()).object()[config_key::config]
.toString(); .toString();
openvpn_cfg.replace("\r", ""); QStringList lines = lastConfigJson.replace("\r", "").split("\n");
QStringList lines = openvpn_cfg.split("\n");
for (const QString &l: lines) { for (const QString &l: lines) {
i++; i++;
QRegularExpressionMatch match = m_re.match(l); QRegularExpressionMatch match = m_re.match(l);
@ -49,6 +64,7 @@ void ViewConfigLogic::onUpdatePage()
} }
} }
} }
}
emit openVpnLastConfigsChanged(m_openVpnLastConfigs); emit openVpnLastConfigsChanged(m_openVpnLastConfigs);
emit openVpnMalStringsChanged(m_openVpnMalStrings); emit openVpnMalStringsChanged(m_openVpnMalStrings);

View file

@ -87,6 +87,17 @@ void OpenVpnLogic::updateProtocolPage(const QJsonObject &openvpnConfig, DockerCo
toString(protocols::openvpn::defaultPort)); toString(protocols::openvpn::defaultPort));
set_lineEditPortEnabled(container == DockerContainer::OpenVpn); set_lineEditPortEnabled(container == DockerContainer::OpenVpn);
auto lastConfig = openvpnConfig.value(config_key::last_config).toString();
auto lastConfigJson = QJsonDocument::fromJson(lastConfig.toUtf8()).object();
QStringList lines = lastConfigJson.value(config_key::config).toString().replace("\r", "").split("\n");
QString openVpnLastConfigText;
for (const QString &l: lines) {
openVpnLastConfigText.append(l + "\n");
}
set_openVpnLastConfigText(openVpnLastConfigText);
set_isThirdPartyConfig(openvpnConfig.value(config_key::isThirdPartyConfig).isBool());
} }
void OpenVpnLogic::onPushButtonProtoOpenVpnSaveClicked() void OpenVpnLogic::onPushButtonProtoOpenVpnSaveClicked()

View file

@ -35,6 +35,9 @@ class OpenVpnLogic : public PageProtocolLogicBase
AUTO_PROPERTY(int, progressBarResetValue) AUTO_PROPERTY(int, progressBarResetValue)
AUTO_PROPERTY(int, progressBarResetMaximium) AUTO_PROPERTY(int, progressBarResetMaximium)
AUTO_PROPERTY(QString, openVpnLastConfigText)
AUTO_PROPERTY(bool, isThirdPartyConfig)
public: public:
Q_INVOKABLE void onPushButtonProtoOpenVpnSaveClicked(); Q_INVOKABLE void onPushButtonProtoOpenVpnSaveClicked();

View file

@ -0,0 +1,30 @@
#include "WireGuardLogic.h"
#include "core/servercontroller.h"
#include <functional>
#include "../../uilogic.h"
using namespace amnezia;
using namespace PageEnumNS;
WireGuardLogic::WireGuardLogic(UiLogic *logic, QObject *parent):
PageProtocolLogicBase(logic, parent)
{
}
void WireGuardLogic::updateProtocolPage(const QJsonObject &wireGuardConfig, DockerContainer container, bool haveAuthData)
{
qDebug() << "WireGuardLogic::updateProtocolPage";
auto lastConfigJsonDoc = QJsonDocument::fromJson(wireGuardConfig.value(config_key::last_config).toString().toUtf8());
auto lastConfigJson = lastConfigJsonDoc.object();
QString wireGuardLastConfigText;
QStringList lines = lastConfigJson.value(config_key::config).toString().replace("\r", "").split("\n");
for (const QString &l: lines) {
wireGuardLastConfigText.append(l + "\n");
}
set_wireGuardLastConfigText(wireGuardLastConfigText);
set_isThirdPartyConfig(wireGuardConfig.value(config_key::isThirdPartyConfig).toBool());
}

View file

@ -0,0 +1,26 @@
#ifndef WIREGUARDLOGIC_H
#define WIREGUARDLOGIC_H
#include "PageProtocolLogicBase.h"
class UiLogic;
class WireGuardLogic : public PageProtocolLogicBase
{
Q_OBJECT
AUTO_PROPERTY(QString, wireGuardLastConfigText)
AUTO_PROPERTY(bool, isThirdPartyConfig)
public:
explicit WireGuardLogic(UiLogic *uiLogic, QObject *parent = nullptr);
~WireGuardLogic() = default;
void updateProtocolPage(const QJsonObject &wireGuardConfig, DockerContainer container, bool haveAuthData) override;
private:
UiLogic *m_uiLogic;
};
#endif // WIREGUARDLOGIC_H

View file

@ -8,6 +8,8 @@ Item {
readonly property int screenWidth: 380 readonly property int screenWidth: 380
readonly property int screenHeight: 640 readonly property int screenHeight: 640
readonly property int defaultMargin: 20
function isMobile() { function isMobile() {
if (Qt.platform.os == "android" || if (Qt.platform.os == "android" ||
Qt.platform.os == "ios") { Qt.platform.os == "ios") {

View file

@ -1,11 +1,12 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import "../Config"
BasicButtonType { BasicButtonType {
id: root id: root
width: parent.width - 80 width: parent.width - 2 * GC.defaultMargin
height: 40 implicitHeight: 40
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent

View file

@ -0,0 +1,26 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import "../Config"
Flickable {
id: fl
clip: true
width: parent.width
anchors.topMargin: GC.defaultMargin
anchors.bottom: parent.bottom
anchors.bottomMargin: GC.defaultMargin
anchors.left: root.left
anchors.leftMargin: GC.defaultMargin
anchors.right: root.right
anchors.rightMargin: 1
Keys.onUpPressed: scrollBar.decrease()
Keys.onDownPressed: scrollBar.increase()
ScrollBar.vertical: ScrollBar {
id: scrollBar
policy: fl.height >= fl.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
}
}

View file

@ -1,9 +1,9 @@
import QtQuick import QtQuick
import "../Config"
Text { Text {
id: root id: root
x: 40 width: parent.width - 2 * GC.defaultMargin
width: parent.width
anchors.topMargin: 10 anchors.topMargin: 10
font.family: "Lato" font.family: "Lato"

View file

@ -1,19 +1,20 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import Qt.labs.platform import Qt.labs.platform
import "../Config"
TextField { TextField {
id: root id: root
property bool error: false property bool error: false
width: parent.width - 80 width: parent.width - 2 * GC.defaultMargin
height: 40 height: 40
anchors.topMargin: 5 anchors.topMargin: 5
selectByMouse: true selectByMouse: true
selectionColor: "darkgray" selectionColor: "darkgray"
font.pixelSize: 16 font.pixelSize: 16
color: "#333333" color: "#333333"
background: Rectangle { background: Rectangle {
implicitWidth: 200 implicitWidth: 200
implicitHeight: 40 implicitHeight: 40

View file

@ -0,0 +1,25 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
BasicButtonType {
property alias label: lbl
id: root
antialiasing: true
height: 21
background: Item {}
contentItem: Text {
id: lbl
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 18
font.underline: true
text: root.text
color: "#3045ee"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}

View file

@ -48,8 +48,7 @@ Drawer {
} }
Flickable { FlickableType {
clip: true
anchors.fill: parent anchors.fill: parent
contentHeight: col.height contentHeight: col.height

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Application Settings") text: qsTr("Application Settings")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: logo.top anchors.bottom: logo.top
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
CheckBoxType { CheckBoxType {
visible: !GC.isMobile() visible: !GC.isMobile()
@ -79,7 +71,6 @@ PageBase {
BlueButtonType { BlueButtonType {
visible: !GC.isMobile() visible: !GC.isMobile()
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Check for updates") text: qsTr("Check for updates")
onClicked: { onClicked: {
Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest") Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest")
@ -98,7 +89,6 @@ PageBase {
} }
BlueButtonType { BlueButtonType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Open logs folder") text: qsTr("Open logs folder")
onClicked: { onClicked: {
AppSettingsLogic.onPushButtonOpenLogsClicked() AppSettingsLogic.onPushButtonOpenLogsClicked()
@ -108,7 +98,6 @@ PageBase {
BlueButtonType { BlueButtonType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 10 Layout.topMargin: 10
Layout.preferredHeight: 41
text: qsTr("Export logs") text: qsTr("Export logs")
onClicked: { onClicked: {
AppSettingsLogic.onPushButtonExportLogsClicked() AppSettingsLogic.onPushButtonExportLogsClicked()
@ -118,7 +107,6 @@ PageBase {
BlueButtonType { BlueButtonType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 10 Layout.topMargin: 10
Layout.preferredHeight: 41
property string start_text: qsTr("Clear logs") property string start_text: qsTr("Clear logs")
property string end_text: qsTr("Cleared") property string end_text: qsTr("Cleared")

View file

@ -17,8 +17,4 @@ Item {
onActivated: pageActive = true onActivated: pageActive = true
onDeactivated: pageActive = false onDeactivated: pageActive = false
// width: GC.screenWidth
// height: GC.screenHeight
} }

View file

@ -16,20 +16,12 @@ PageBase {
z: -1 z: -1
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: back.bottom anchors.top: back.bottom
anchors.topMargin: 0 anchors.topMargin: 0
anchors.bottom: root.bottom
anchors.bottomMargin: 10 anchors.bottomMargin: 10
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -38,6 +30,7 @@ PageBase {
anchors.topMargin: 10 anchors.topMargin: 10
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin
spacing: 15 spacing: 15

View file

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0 import PageEnum 1.0
import "./" import "./"
import "../Controls" import "../Controls"
@ -18,11 +19,21 @@ PageBase {
text: qsTr("DNS Servers") text: qsTr("DNS Servers")
} }
CheckBoxType { FlickableType {
id: cb_amnezia_dns id: fl
anchors.top: caption.bottom anchors.top: caption.bottom
x: 30 contentHeight: content.height
width: parent.width - 60
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
CheckBoxType {
Layout.preferredWidth: parent.width
text: qsTr("Use AmneziaDNS service (recommended)") text: qsTr("Use AmneziaDNS service (recommended)")
checked: NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked checked: NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked
onCheckedChanged: { onCheckedChanged: {
@ -33,29 +44,19 @@ PageBase {
} }
LabelType { LabelType {
id: lb_amnezia_dns Layout.preferredWidth: parent.width
x: 30
anchors.top: cb_amnezia_dns.bottom
width: parent.width - 60
text: qsTr("Use AmneziaDNS container on your server, when it installed.\n text: qsTr("Use AmneziaDNS container on your server, when it installed.\n
Your AmneziaDNS server available only when it installed and VPN connected, it has internal IP address 172.29.172.254\n Your AmneziaDNS server available only when it installed and VPN connected, it has internal IP address 172.29.172.254\n
If AmneziaDNS service is not installed on the same server, or this option is unchecked, the following DNS servers will be used:") If AmneziaDNS service is not installed on the same server, or this option is unchecked, the following DNS servers will be used:")
} }
LabelType { LabelType {
id: l1 Layout.topMargin: 15
x: 30
anchors.top: lb_amnezia_dns.bottom
width: parent.width - 30
height: 21
text: qsTr("Primary DNS server") text: qsTr("Primary DNS server")
} }
TextFieldType { TextFieldType {
id: dns1
x: 30
anchors.top: l1.bottom
width: parent.width - 90
height: 40 height: 40
implicitWidth: parent.width
text: NetworkSettingsLogic.lineEditDns1Text text: NetworkSettingsLogic.lineEditDns1Text
onEditingFinished: { onEditingFinished: {
NetworkSettingsLogic.lineEditDns1Text = text NetworkSettingsLogic.lineEditDns1Text = text
@ -66,13 +67,12 @@ If AmneziaDNS service is not installed on the same server, or this option is unc
regularExpression: NetworkSettingsLogic.ipAddressRegex regularExpression: NetworkSettingsLogic.ipAddressRegex
} }
} }
SvgButtonType {
id: resetDNS1 UrlButtonType {
anchors. left: dns1.right text: qsTr("Reset to default")
anchors.leftMargin: 10 label.horizontalAlignment: Text.AlignLeft
anchors.verticalCenter: dns1.verticalCenter label.verticalAlignment: Text.AlignTop
width: 24 label.font.pixelSize: 14
height: 24
icon.source: "qrc:/images/svg/refresh_black_24dp.svg" icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
onClicked: { onClicked: {
NetworkSettingsLogic.onPushButtonResetDns1Clicked() NetworkSettingsLogic.onPushButtonResetDns1Clicked()
@ -81,20 +81,11 @@ If AmneziaDNS service is not installed on the same server, or this option is unc
} }
LabelType { LabelType {
id: l2
x: 30
anchors.top: dns1.bottom
anchors.topMargin: 20
width: parent.width - 60
height: 21
text: qsTr("Secondary DNS server") text: qsTr("Secondary DNS server")
} }
TextFieldType { TextFieldType {
id: dns2
x: 30
anchors.top: l2.bottom
width: parent.width - 90
height: 40 height: 40
implicitWidth: parent.width
text: NetworkSettingsLogic.lineEditDns2Text text: NetworkSettingsLogic.lineEditDns2Text
onEditingFinished: { onEditingFinished: {
NetworkSettingsLogic.lineEditDns2Text = text NetworkSettingsLogic.lineEditDns2Text = text
@ -105,21 +96,18 @@ If AmneziaDNS service is not installed on the same server, or this option is unc
regularExpression: NetworkSettingsLogic.ipAddressRegex regularExpression: NetworkSettingsLogic.ipAddressRegex
} }
} }
SvgButtonType {
id: resetDNS2 UrlButtonType {
anchors. left: dns2.right text: qsTr("Reset to default")
anchors.leftMargin: 10 label.horizontalAlignment: Text.AlignLeft
anchors.verticalCenter: dns2.verticalCenter label.verticalAlignment: Text.AlignTop
width: 24 label.font.pixelSize: 14
height: 24
icon.source: "qrc:/images/svg/refresh_black_24dp.svg" icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
onClicked: { onClicked: {
NetworkSettingsLogic.onPushButtonResetDns2Clicked() NetworkSettingsLogic.onPushButtonResetDns2Clicked()
UiLogic.onUpdateAllPages() UiLogic.onUpdateAllPages()
} }
} }
}
Logo {
anchors.bottom: parent.bottom
} }
} }

View file

@ -8,7 +8,6 @@ import "../Config"
PageBase { PageBase {
id: root id: root
page: PageEnum.NewServer page: PageEnum.NewServer
//logic: {}
BackButton { BackButton {
id: back_from_new_server id: back_from_new_server
@ -22,15 +21,15 @@ PageBase {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: qsTr("If you want easily configure your server just run Wizard") text: qsTr("If you want easily configure your server just run Wizard")
width: parent.width - 80 anchors.horizontalCenter: parent.horizontalCenter
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 30 anchors.topMargin: 30
} }
BlueButtonType { BlueButtonType {
id: pushButtonWizard id: pushButtonWizard
text: qsTr("Run Setup Wizard") text: qsTr("Run Setup Wizard")
anchors.top: labelWizard.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: labelWizard.bottom
anchors.topMargin: 10 anchors.topMargin: 10
onClicked: { onClicked: {
UiLogic.goToPage(PageEnum.Wizard); UiLogic.goToPage(PageEnum.Wizard);
@ -41,14 +40,13 @@ PageBase {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: qsTr("Press configure manually to choose VPN protocols you want to install") text: qsTr("Press configure manually to choose VPN protocols you want to install")
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 80
anchors.top: pushButtonWizard.bottom anchors.top: pushButtonWizard.bottom
anchors.topMargin: 40 anchors.topMargin: 40
} }
BlueButtonType { BlueButtonType {
text: qsTr("Configure VPN protocols manually") text: qsTr("Configure")
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: labelManual.bottom anchors.top: labelManual.bottom
anchors.topMargin: 10 anchors.topMargin: 10

View file

@ -32,6 +32,7 @@ PageBase {
BackButton { BackButton {
id: back id: back
onClicked: tb_c.currentIndex = -1
} }
Caption { Caption {
id: caption id: caption
@ -174,11 +175,7 @@ PageBase {
} }
} }
FlickableType {
Flickable {
visible: container_selector.selectedIndex <= 0 visible: container_selector.selectedIndex <= 0
clip: true clip: true
width: parent.width width: parent.width
@ -224,7 +221,6 @@ PageBase {
ListView { ListView {
id: tb_c id: tb_c
x: 10
width: parent.width - 10 width: parent.width - 10
height: tb_c.contentItem.height height: tb_c.contentItem.height
currentIndex: -1 currentIndex: -1
@ -293,7 +289,7 @@ PageBase {
ImageButtonType { ImageButtonType {
id: button_remove id: button_remove
visible: index === tb_c.currentIndex visible: (index === tb_c.currentIndex) && ServerContainersLogic.isManagedServer
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
checkable: true checkable: true
icon.source: "qrc:/images/delete.png" icon.source: "qrc:/images/delete.png"
@ -320,7 +316,7 @@ PageBase {
ImageButtonType { ImageButtonType {
id: button_share id: button_share
visible: index === tb_c.currentIndex visible: (index === tb_c.currentIndex) && ServerContainersLogic.isManagedServer
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
icon.source: "qrc:/images/share.png" icon.source: "qrc:/images/share.png"
implicitWidth: 30 implicitWidth: 30
@ -431,7 +427,7 @@ PageBase {
width: parent.width - 40 width: parent.width - 40
height: 40 height: 40
text: qsTr("Install new protocols container") text: qsTr("Install new service")
font.pixelSize: 16 font.pixelSize: 16
onClicked: container_selector.visible ? container_selector.close() : container_selector.open() onClicked: container_selector.visible ? container_selector.close() : container_selector.open()

View file

@ -35,10 +35,10 @@ PageBase {
ListView { ListView {
id: listWidget_servers id: listWidget_servers
x: 20 x: GC.defaultMargin
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 15 anchors.topMargin: 15
width: parent.width width: parent.width - GC.defaultMargin - 1
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: 20 anchors.bottomMargin: 20
model: ServerListLogic.serverListModel model: ServerListLogic.serverListModel
@ -49,7 +49,7 @@ PageBase {
clip: true clip: true
delegate: Item { delegate: Item {
height: 60 height: 60
width: root.width - 40 width: listWidget_servers.width - 15
MouseArea { MouseArea {
id: ms id: ms
anchors.fill: parent anchors.fill: parent
@ -96,14 +96,14 @@ PageBase {
id: label_address id: label_address
x: 20 x: 20
y: 40 y: 40
width: 141 width: listWidget_servers.width - 100
height: 16 height: 16
text: address text: address
} }
Text { Text {
x: 10 x: 10
y: 10 y: 10
width: 181 width: listWidget_servers.width - 100
height: 21 height: 21
font.family: "Lato" font.family: "Lato"
font.styleName: "normal" font.styleName: "normal"
@ -177,5 +177,9 @@ PageBase {
} }
} }
} }
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
}
} }
} }

View file

@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0 import PageEnum 1.0
import "./" import "./"
import "../Controls" import "../Controls"
@ -16,32 +17,34 @@ PageBase {
id: back id: back
} }
Caption { Caption {
id: caption
text: qsTr("Server settings") text: qsTr("Server settings")
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: logo.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
anchors.horizontalCenter: parent.horizontalCenter Layout.fillWidth: true
y: 150
width: 341
height: 31
font.pixelSize: 20 font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: ServerSettingsLogic.labelCurrentVpnProtocolText text: ServerSettingsLogic.labelCurrentVpnProtocolText
} }
// LabelType {
// anchors.horizontalCenter: parent.horizontalCenter
// y: 120
// width: 341
// height: 31
// font.pixelSize: 20
// horizontalAlignment: Text.AlignHCenter
// text: ServerSettingsLogic.labelServerText
// }
TextFieldType { TextFieldType {
anchors.horizontalCenter: parent.horizontalCenter Layout.fillWidth: true
y: 120
width: 341
height: 31
font.pixelSize: 20 font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: ServerSettingsLogic.labelServerText text: ServerSettingsLogic.labelServerText
@ -50,71 +53,30 @@ PageBase {
} }
LabelType { LabelType {
anchors.horizontalCenter: parent.horizontalCenter Layout.fillWidth: true
y: 530
width: 301
height: 41
text: ServerSettingsLogic.labelWaitInfoText text: ServerSettingsLogic.labelWaitInfoText
visible: ServerSettingsLogic.labelWaitInfoVisible visible: ServerSettingsLogic.labelWaitInfoVisible
} }
TextFieldType { TextFieldType {
anchors.horizontalCenter: parent.horizontalCenter Layout.fillWidth: true
y: 80
width: 251
height: 31
text: ServerSettingsLogic.lineEditDescriptionText text: ServerSettingsLogic.lineEditDescriptionText
onEditingFinished: { onEditingFinished: {
ServerSettingsLogic.lineEditDescriptionText = text ServerSettingsLogic.lineEditDescriptionText = text
ServerSettingsLogic.onLineEditDescriptionEditingFinished() ServerSettingsLogic.onLineEditDescriptionEditingFinished()
} }
} }
BlueButtonType { BlueButtonType {
anchors.horizontalCenter: parent.horizontalCenter
y: 410
width: parent.width - 40
height: 40
text: ServerSettingsLogic.pushButtonClearText
visible: ServerSettingsLogic.pushButtonClearVisible
onClicked: {
ServerSettingsLogic.onPushButtonClearServer()
}
}
BlueButtonType {
anchors.horizontalCenter: parent.horizontalCenter
y: 350
width: parent.width - 40
height: 40
text: ServerSettingsLogic.pushButtonClearClientCacheText
visible: ServerSettingsLogic.pushButtonClearClientCacheVisible
onClicked: {
ServerSettingsLogic.onPushButtonClearClientCacheClicked()
}
}
BlueButtonType {
anchors.horizontalCenter: parent.horizontalCenter
y: 470
width: parent.width - 40
height: 40
text: qsTr("Forget this server")
onClicked: {
ServerSettingsLogic.onPushButtonForgetServer()
}
}
BlueButtonType {
anchors.horizontalCenter: parent.horizontalCenter
y: 210
width: parent.width - 40
height: 40
text: qsTr("Protocols and Services") text: qsTr("Protocols and Services")
Layout.topMargin: 20
Layout.fillWidth: true
onClicked: { onClicked: {
UiLogic.goToPage(PageEnum.ServerContainers) UiLogic.goToPage(PageEnum.ServerContainers)
} }
} }
BlueButtonType { BlueButtonType {
anchors.horizontalCenter: parent.horizontalCenter Layout.fillWidth: true
y: 260 Layout.topMargin: 10
width: parent.width - 40
height: 40
text: qsTr("Share Server (FULL ACCESS)") text: qsTr("Share Server (FULL ACCESS)")
visible: ServerSettingsLogic.pushButtonShareFullVisible visible: ServerSettingsLogic.pushButtonShareFullVisible
onClicked: { onClicked: {
@ -122,7 +84,39 @@ PageBase {
} }
} }
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 60
text: ServerSettingsLogic.pushButtonClearText
visible: ServerSettingsLogic.pushButtonClearVisible
onClicked: {
ServerSettingsLogic.onPushButtonClearServer()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: ServerSettingsLogic.pushButtonClearClientCacheText
visible: ServerSettingsLogic.pushButtonClearClientCacheVisible
onClicked: {
ServerSettingsLogic.onPushButtonClearClientCacheClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: qsTr("Forget this server")
onClicked: {
ServerSettingsLogic.onPushButtonForgetServer()
}
}
}
}
Logo { Logo {
id : logo
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
} }
} }

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup your server to use VPN") text: qsTr("Setup your server to use VPN")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20 anchors.bottom: next_button.top
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
RadioButtonType { RadioButtonType {
id: radioButton_setup_wizard_high id: radioButton_setup_wizard_high
@ -93,11 +85,15 @@ OpenVPN over ShadowSocks profile will be installed.\n")
text: qsTr("I want to improve my privacy on the internet. text: qsTr("I want to improve my privacy on the internet.
OpenVPN profile will be installed.\n") OpenVPN profile will be installed.\n")
} }
}
}
BlueButtonType { BlueButtonType {
Layout.fillWidth: true id: next_button
Layout.preferredHeight: 41 anchors.bottom: parent.bottom
anchors.bottomMargin: GC.defaultMargin
x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Next") text: qsTr("Next")
onClicked: { onClicked: {
if (radioButton_setup_wizard_high.checked) { if (radioButton_setup_wizard_high.checked) {
@ -110,5 +106,3 @@ OpenVPN profile will be installed.\n")
} }
} }
} }
}
}

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup Wizard") text: qsTr("Setup Wizard")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20 anchors.bottom: next_button.top
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
Layout.fillWidth: true Layout.fillWidth: true
@ -83,11 +75,15 @@ You SHOULD set this website address to some foreign website which is not blocked
This protocol support exporting connection profiles to mobile devices by exporting ShadowSocks and Cloak configs (you should launch the 3rd party open source VPN client - ShadowSocks VPN and install Cloak plugin).") This protocol support exporting connection profiles to mobile devices by exporting ShadowSocks and Cloak configs (you should launch the 3rd party open source VPN client - ShadowSocks VPN and install Cloak plugin).")
} }
}
}
BlueButtonType { BlueButtonType {
id: next_button id: next_button
Layout.fillWidth: true anchors.bottom: parent.bottom
Layout.topMargin: 15 anchors.bottomMargin: GC.defaultMargin
Layout.preferredHeight: 41 x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Next") text: qsTr("Next")
onClicked: { onClicked: {
let domain = website_masking.text; let domain = website_masking.text;
@ -97,8 +93,4 @@ This protocol support exporting connection profiles to mobile devices by exporti
UiLogic.goToPage(PageEnum.WizardVpnMode, false) UiLogic.goToPage(PageEnum.WizardVpnMode, false)
} }
} }
}
}
} }

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup Wizard") text: qsTr("Setup Wizard")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20 anchors.bottom: next_button.top
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
Layout.fillWidth: true Layout.fillWidth: true
@ -56,16 +48,18 @@ We recommend not to use messaging applications for sending the connection profil
text: qsTr('OpenVPN profile will be installed') text: qsTr('OpenVPN profile will be installed')
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
}
}
BlueButtonType { BlueButtonType {
id: next_button id: next_button
Layout.fillWidth: true anchors.bottom: parent.bottom
Layout.topMargin: 15 anchors.bottomMargin: GC.defaultMargin
Layout.preferredHeight: 41 x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Start configuring") text: qsTr("Start configuring")
onClicked: { onClicked: {
WizardLogic.onPushButtonLowFinishClicked() WizardLogic.onPushButtonLowFinishClicked()
} }
} }
} }
}
}

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup Wizard") text: qsTr("Setup Wizard")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20 anchors.bottom: next_button.top
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
Layout.fillWidth: true Layout.fillWidth: true
@ -51,16 +43,18 @@ PageBase {
Layout.topMargin: 15 Layout.topMargin: 15
text: qsTr('OpenVPN over ShadowSocks profile will be installed') text: qsTr('OpenVPN over ShadowSocks profile will be installed')
} }
}
}
BlueButtonType { BlueButtonType {
id: next_button id: next_button
Layout.fillWidth: true anchors.bottom: parent.bottom
Layout.topMargin: 15 anchors.bottomMargin: GC.defaultMargin
Layout.preferredHeight: 41 x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Next") text: qsTr("Next")
onClicked: { onClicked: {
UiLogic.goToPage(PageEnum.WizardVpnMode, false) UiLogic.goToPage(PageEnum.WizardVpnMode, false)
} }
} }
} }
}
}

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup Wizard") text: qsTr("Setup Wizard")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20 anchors.bottom: vpn_mode_finish.top
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
Layout.fillWidth: true Layout.fillWidth: true
@ -56,17 +48,18 @@ You can enable VPN mode "For selected sites" and add blocked sites you need to v
WizardLogic.checkBoxVpnModeChecked = checked WizardLogic.checkBoxVpnModeChecked = checked
} }
} }
}
}
BlueButtonType { BlueButtonType {
id: vpn_mode_finish id: vpn_mode_finish
Layout.fillWidth: true anchors.bottom: parent.bottom
Layout.topMargin: 15 anchors.bottomMargin: GC.defaultMargin
Layout.preferredHeight: 41 x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Start configuring") text: qsTr("Start configuring")
onClicked: { onClicked: {
WizardLogic.onPushButtonVpnModeFinishClicked() WizardLogic.onPushButtonVpnModeFinishClicked()
} }
} }
} }
}
}

View file

@ -27,12 +27,11 @@ PageBase {
} }
Flickable { FlickableType {
clip: true clip: true
width: parent.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.bottom: root.bottom
contentHeight: col.height contentHeight: col.height
boundsBehavior: Flickable.StopAtBounds
Column { Column {
id: col id: col
@ -54,7 +53,6 @@ PageBase {
ShareConnectionContent { ShareConnectionContent {
x: 10
text: qsTr("Share for Amnezia") text: qsTr("Share for Amnezia")
height: 40 height: 40
width: tb_c.width - 10 width: tb_c.width - 10
@ -63,7 +61,6 @@ PageBase {
ListView { ListView {
id: tb_c id: tb_c
x: 10
width: parent.width - 10 width: parent.width - 10
height: tb_c.contentItem.height height: tb_c.contentItem.height
currentIndex: -1 currentIndex: -1

View file

@ -46,12 +46,12 @@ PageBase {
BasicButtonType { BasicButtonType {
id: start_switch_page id: start_switch_page
width: parent.width - 2 * GC.defaultMargin
implicitHeight: 40
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: logo.top anchors.bottom: logo.top
anchors.bottomMargin: 10 anchors.bottomMargin: 10
width: parent.width - 80
height: 40
anchors.topMargin: 20 anchors.topMargin: 20
text: qsTr("Set up your own server") text: qsTr("Set up your own server")
@ -88,7 +88,6 @@ PageBase {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
antialiasing: true antialiasing: true
} }
Item { Item {
@ -104,6 +103,7 @@ PageBase {
id: label_connection_code id: label_connection_code
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 20 anchors.topMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Connection code") text: qsTr("Connection code")
} }
TextFieldType { TextFieldType {
@ -303,7 +303,8 @@ PageBase {
} }
enabled: StartPageLogic.pushButtonConnectEnabled enabled: StartPageLogic.pushButtonConnectEnabled
} }
BasicButtonType {
UrlButtonType {
id: new_sever_connect_key id: new_sever_connect_key
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: new_sever_connect.bottom anchors.top: new_sever_connect.bottom
@ -311,21 +312,8 @@ PageBase {
width: 281 width: 281
height: 21 height: 21
text: qsTr("Connect using SSH key") text: qsTr("Connect using SSH key")
background: Item {
anchors.fill: parent
}
contentItem: Text { label.font.pixelSize: 16
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#15CDCB";
text: new_sever_connect_key.text
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
antialiasing: true
checkable: true checkable: true
checked: StartPageLogic.pushButtonConnectKeyChecked checked: StartPageLogic.pushButtonConnectKeyChecked
onCheckedChanged: { onCheckedChanged: {

View file

@ -30,27 +30,12 @@ PageBase {
font.pixelSize: 12 font.pixelSize: 12
} }
BasicButtonType { UrlButtonType {
y: 10 y: 10
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: 21 height: 21
background: Item {} label.color: "#D4D4D4"
label.text: qsTr("Donate")
contentItem: Text {
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 18
font.underline: true
text: qsTr("Donate")
color: "#D4D4D4"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
onClicked: { onClicked: {
UiLogic.goToPage(PageEnum.About) UiLogic.goToPage(PageEnum.About)

View file

@ -20,20 +20,10 @@ PageBase {
text: qsTr("Check config") text: qsTr("Check config")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -41,6 +31,7 @@ PageBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
TextAreaType { TextAreaType {
id: ta_config id: ta_config
@ -124,7 +115,7 @@ AmneziaVPN detected this profile may contain malicious scripts. Please, carefull
BasicButtonType { BasicButtonType {
Layout.preferredWidth: (content.width - parent.spacing) /2 Layout.preferredWidth: (content.width - parent.spacing) /2
Layout.preferredHeight: 41 Layout.preferredHeight: 40
font.pixelSize: btn_import.font.pixelSize font.pixelSize: btn_import.font.pixelSize
text: qsTr("Cancel") text: qsTr("Cancel")
onClicked: { onClicked: {
@ -135,7 +126,6 @@ AmneziaVPN detected this profile may contain malicious scripts. Please, carefull
BlueButtonType { BlueButtonType {
id: btn_import id: btn_import
Layout.preferredWidth: (content.width - parent.spacing) /2 Layout.preferredWidth: (content.width - parent.spacing) /2
Layout.preferredHeight: 41
text: qsTr("Import config") text: qsTr("Import config")
onClicked: { onClicked: {
logic.importConfig() logic.importConfig()

View file

@ -19,28 +19,21 @@ PageProtocolBase {
text: qsTr("OpenVPN Settings") text: qsTr("OpenVPN Settings")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
enabled: logic.pageEnabled
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin - 1
ColumnLayout {
visible: !logic.isThirdPartyConfig
enabled: logic.pageEnabled
LabelType { LabelType {
id: lb_subnet id: lb_subnet
@ -67,7 +60,7 @@ PageProtocolBase {
} }
Rectangle { Rectangle {
id: rect_proto id: rect_proto
implicitWidth: root.width - 60 implicitWidth: parent.width
height: 71 height: 71
border.width: 1 border.width: 1
border.color: "lightgray" border.color: "lightgray"
@ -81,7 +74,7 @@ PageProtocolBase {
enabled: logic.radioButtonTcpEnabled enabled: logic.radioButtonTcpEnabled
checked: logic.radioButtonTcpChecked checked: logic.radioButtonTcpChecked
onCheckedChanged: { onCheckedChanged: {
UiLogic.radioButtonTcpChecked = checked logic.radioButtonTcpChecked = checked
} }
} }
RadioButtonType { RadioButtonType {
@ -400,6 +393,24 @@ PageProtocolBase {
} }
ColumnLayout {
visible: logic.isThirdPartyConfig
TextAreaType {
id: ta_config
Layout.topMargin: 5
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.leftMargin: 1
Layout.rightMargin: 1
Layout.preferredHeight: fl.height - 70
flickableDirection: Flickable.AutoFlickIfNeeded
textArea.readOnly: true
textArea.text: logic.openVpnLastConfigText
}
}
}
} }
} }

View file

@ -0,0 +1,60 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.15
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageProtocolBase {
id: root
protocol: ProtocolEnum.WireGuard
logic: UiLogic.protocolLogic(protocol)
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("WireGuard Settings")
}
Flickable {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
TextAreaType {
id: ta_config
Layout.topMargin: 5
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.leftMargin: 1
Layout.rightMargin: 1
Layout.preferredHeight: fl.height - 70
flickableDirection: Flickable.AutoFlickIfNeeded
textArea.readOnly: true
textArea.text: logic.wireGuardLastConfigText
}
}
}
}

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share for Amnezia") text: qsTr("Share for Amnezia")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height + 20 contentHeight: content.height + 20
clip: true
Behavior on contentY{ Behavior on contentY{
NumberAnimation { NumberAnimation {
@ -46,6 +36,7 @@ PageShareProtocolBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
Text { Text {
id: lb_desc id: lb_desc

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share Cloak Settings") text: qsTr("Share Cloak Settings")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -39,7 +29,7 @@ PageShareProtocolBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
id: lb_desc id: lb_desc

View file

@ -42,20 +42,10 @@ PageShareProtocolBase {
visible: false visible: false
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -63,6 +53,7 @@ PageShareProtocolBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
// LabelType { // LabelType {
// id: lb_desc // id: lb_desc

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share OpenVPN Settings") text: qsTr("Share OpenVPN Settings")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -39,7 +29,7 @@ PageShareProtocolBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
id: lb_desc id: lb_desc

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share ShadowSocks Settings") text: qsTr("Share ShadowSocks Settings")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -39,6 +29,7 @@ PageShareProtocolBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
id: lb_desc id: lb_desc

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share WireGuard Settings") text: qsTr("Share WireGuard Settings")
} }
Flickable { FlickableType {
id: fl id: fl
width: root.width
anchors.top: caption.bottom anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height contentHeight: content.height
clip: true
ColumnLayout { ColumnLayout {
id: content id: content
@ -39,6 +29,7 @@ PageShareProtocolBase {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 15
LabelType { LabelType {
id: lb_desc id: lb_desc

View file

@ -72,7 +72,7 @@
#include "pages_logic/protocols/OpenVpnLogic.h" #include "pages_logic/protocols/OpenVpnLogic.h"
#include "pages_logic/protocols/ShadowSocksLogic.h" #include "pages_logic/protocols/ShadowSocksLogic.h"
#include "pages_logic/protocols/OtherProtocolsLogic.h" #include "pages_logic/protocols/OtherProtocolsLogic.h"
#include "pages_logic/protocols/WireGuardLogic.h"
using namespace amnezia; using namespace amnezia;
using namespace PageEnumNS; using namespace PageEnumNS;
@ -95,7 +95,7 @@ UiLogic::UiLogic(std::shared_ptr<Settings> settings, std::shared_ptr<VpnConfigur
m_protocolLogicMap.insert(Proto::OpenVpn, new OpenVpnLogic(this)); m_protocolLogicMap.insert(Proto::OpenVpn, new OpenVpnLogic(this));
m_protocolLogicMap.insert(Proto::ShadowSocks, new ShadowSocksLogic(this)); m_protocolLogicMap.insert(Proto::ShadowSocks, new ShadowSocksLogic(this));
m_protocolLogicMap.insert(Proto::Cloak, new CloakLogic(this)); m_protocolLogicMap.insert(Proto::Cloak, new CloakLogic(this));
//m_protocolLogicMap->insert(Proto::WireGuard, new WireguardLogic(this)); m_protocolLogicMap.insert(Proto::WireGuard, new WireGuardLogic(this));
m_protocolLogicMap.insert(Proto::Dns, new OtherProtocolsLogic(this)); m_protocolLogicMap.insert(Proto::Dns, new OtherProtocolsLogic(this));
m_protocolLogicMap.insert(Proto::Sftp, new OtherProtocolsLogic(this)); m_protocolLogicMap.insert(Proto::Sftp, new OtherProtocolsLogic(this));