mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d26d6d1fb | |||
| 169f11d9c7 | |||
| 816dc3af95 | |||
| b802863de5 | |||
| 8dc2a4b76c | |||
| beb1c6dbf2 | |||
| 3eb06916c7 | |||
| 30d0f84a4f | |||
| 251f2aa5db | |||
| 16d92ddb7c |
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
||||||
|
|
||||||
set(PROJECT AmneziaVPN)
|
set(PROJECT AmneziaVPN)
|
||||||
set(AMNEZIAVPN_VERSION 4.8.9.2)
|
set(AMNEZIAVPN_VERSION 4.8.10.0)
|
||||||
|
|
||||||
project(${PROJECT} VERSION ${AMNEZIAVPN_VERSION}
|
project(${PROJECT} VERSION ${AMNEZIAVPN_VERSION}
|
||||||
DESCRIPTION "AmneziaVPN"
|
DESCRIPTION "AmneziaVPN"
|
||||||
@@ -12,7 +12,7 @@ string(TIMESTAMP CURRENT_DATE "%Y-%m-%d")
|
|||||||
set(RELEASE_DATE "${CURRENT_DATE}")
|
set(RELEASE_DATE "${CURRENT_DATE}")
|
||||||
|
|
||||||
set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
|
set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
|
||||||
set(APP_ANDROID_VERSION_CODE 2092)
|
set(APP_ANDROID_VERSION_CODE 2093)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
set(MZ_PLATFORM_NAME "linux")
|
set(MZ_PLATFORM_NAME "linux")
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ void CoreController::initSignalHandlers()
|
|||||||
|
|
||||||
void CoreController::initNotificationHandler()
|
void CoreController::initNotificationHandler()
|
||||||
{
|
{
|
||||||
#ifndef Q_OS_ANDROID
|
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||||
m_notificationHandler.reset(NotificationHandler::create(nullptr));
|
m_notificationHandler.reset(NotificationHandler::create(nullptr));
|
||||||
|
|
||||||
connect(m_vpnConnection.get(), &VpnConnection::connectionStateChanged, m_notificationHandler.get(),
|
connect(m_vpnConnection.get(), &VpnConnection::connectionStateChanged, m_notificationHandler.get(),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
#ifndef Q_OS_ANDROID
|
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||||
#include "ui/systemtray_notificationhandler.h"
|
#include "ui/systemtray_notificationhandler.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
#include "ui/models/services/socks5ProxyConfigModel.h"
|
#include "ui/models/services/socks5ProxyConfigModel.h"
|
||||||
#include "ui/models/sites_model.h"
|
#include "ui/models/sites_model.h"
|
||||||
|
|
||||||
#ifndef Q_OS_ANDROID
|
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||||
#include "ui/notificationhandler.h"
|
#include "ui/notificationhandler.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ private:
|
|||||||
QSharedPointer<VpnConnection> m_vpnConnection;
|
QSharedPointer<VpnConnection> m_vpnConnection;
|
||||||
QSharedPointer<QTranslator> m_translator;
|
QSharedPointer<QTranslator> m_translator;
|
||||||
|
|
||||||
#ifndef Q_OS_ANDROID
|
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||||
QScopedPointer<NotificationHandler> m_notificationHandler;
|
QScopedPointer<NotificationHandler> m_notificationHandler;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ ErrorCode GatewayController::get(const QString &endpoint, QByteArray &responseBo
|
|||||||
request.setTransferTimeout(m_requestTimeoutMsecs);
|
request.setTransferTimeout(m_requestTimeoutMsecs);
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
|
|
||||||
request.setUrl(QString(endpoint).arg(m_gatewayEndpoint));
|
request.setUrl(QString(endpoint).arg(m_proxyUrl.isEmpty() ? m_gatewayEndpoint : m_proxyUrl));
|
||||||
|
|
||||||
// bypass killSwitch exceptions for API-gateway
|
// bypass killSwitch exceptions for API-gateway
|
||||||
#ifdef AMNEZIA_DESKTOP
|
#ifdef AMNEZIA_DESKTOP
|
||||||
@@ -123,7 +123,7 @@ ErrorCode GatewayController::post(const QString &endpoint, const QJsonObject api
|
|||||||
request.setTransferTimeout(m_requestTimeoutMsecs);
|
request.setTransferTimeout(m_requestTimeoutMsecs);
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
|
|
||||||
request.setUrl(endpoint.arg(m_gatewayEndpoint));
|
request.setUrl(endpoint.arg(m_proxyUrl.isEmpty() ? m_gatewayEndpoint : m_proxyUrl));
|
||||||
|
|
||||||
// bypass killSwitch exceptions for API-gateway
|
// bypass killSwitch exceptions for API-gateway
|
||||||
#ifdef AMNEZIA_DESKTOP
|
#ifdef AMNEZIA_DESKTOP
|
||||||
@@ -344,11 +344,14 @@ void GatewayController::bypassProxy(const QString &endpoint, QNetworkReply *repl
|
|||||||
std::mt19937 generator(randomDevice());
|
std::mt19937 generator(randomDevice());
|
||||||
std::shuffle(proxyUrls.begin(), proxyUrls.end(), generator);
|
std::shuffle(proxyUrls.begin(), proxyUrls.end(), generator);
|
||||||
|
|
||||||
QEventLoop wait;
|
|
||||||
QList<QSslError> sslErrors;
|
|
||||||
QByteArray responseBody;
|
QByteArray responseBody;
|
||||||
|
|
||||||
for (const QString &proxyUrl : proxyUrls) {
|
auto bypassFunction = [this](const QString &endpoint, const QString &proxyUrl, QNetworkReply *reply,
|
||||||
|
std::function<QNetworkReply *(const QString &url)> requestFunction,
|
||||||
|
std::function<bool(QNetworkReply * reply, const QList<QSslError> &sslErrors)> replyProcessingFunction) {
|
||||||
|
QEventLoop wait;
|
||||||
|
QList<QSslError> sslErrors;
|
||||||
|
|
||||||
qDebug() << "go to the next proxy endpoint";
|
qDebug() << "go to the next proxy endpoint";
|
||||||
reply->deleteLater(); // delete the previous reply
|
reply->deleteLater(); // delete the previous reply
|
||||||
reply = requestFunction(endpoint.arg(proxyUrl));
|
reply = requestFunction(endpoint.arg(proxyUrl));
|
||||||
@@ -358,6 +361,50 @@ void GatewayController::bypassProxy(const QString &endpoint, QNetworkReply *repl
|
|||||||
wait.exec();
|
wait.exec();
|
||||||
|
|
||||||
if (replyProcessingFunction(reply, sslErrors)) {
|
if (replyProcessingFunction(reply, sslErrors)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (m_proxyUrl.isEmpty()) {
|
||||||
|
QNetworkRequest request;
|
||||||
|
request.setTransferTimeout(1000);
|
||||||
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
|
|
||||||
|
QEventLoop wait;
|
||||||
|
QList<QSslError> sslErrors;
|
||||||
|
QNetworkReply *reply;
|
||||||
|
|
||||||
|
for (const QString &proxyUrl : proxyUrls) {
|
||||||
|
request.setUrl(proxyUrl + "lmbd-health");
|
||||||
|
reply = amnApp->networkManager()->get(request);
|
||||||
|
|
||||||
|
connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit);
|
||||||
|
connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList<QSslError> &errors) { sslErrors = errors; });
|
||||||
|
wait.exec();
|
||||||
|
|
||||||
|
if (reply->error() == QNetworkReply::NetworkError::NoError) {
|
||||||
|
reply->deleteLater();
|
||||||
|
|
||||||
|
m_proxyUrl = proxyUrl;
|
||||||
|
if (!m_proxyUrl.isEmpty()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
reply->deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_proxyUrl.isEmpty()) {
|
||||||
|
if (bypassFunction(endpoint, m_proxyUrl, reply, requestFunction, replyProcessingFunction)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const QString &proxyUrl : proxyUrls) {
|
||||||
|
if (bypassFunction(endpoint, proxyUrl, reply, requestFunction, replyProcessingFunction)) {
|
||||||
|
m_proxyUrl = proxyUrl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ private:
|
|||||||
QString m_gatewayEndpoint;
|
QString m_gatewayEndpoint;
|
||||||
bool m_isDevEnvironment = false;
|
bool m_isDevEnvironment = false;
|
||||||
bool m_isStrictKillSwitchEnabled = false;
|
bool m_isStrictKillSwitchEnabled = false;
|
||||||
|
|
||||||
|
inline static QString m_proxyUrl;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GATEWAYCONTROLLER_H
|
#endif // GATEWAYCONTROLLER_H
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ QString InterfaceConfig::toWgConf(const QMap<QString, QString>& extra) const {
|
|||||||
out << "MTU = " << m_deviceMTU << "\n";
|
out << "MTU = " << m_deviceMTU << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_primaryDnsServer.isNull()) {
|
if (!m_primaryDnsServer.isEmpty()) {
|
||||||
QStringList dnsServers;
|
QStringList dnsServers;
|
||||||
dnsServers.append(m_primaryDnsServer);
|
dnsServers.append(m_primaryDnsServer);
|
||||||
if (!m_secondaryDnsServer.isNull()) {
|
if (!m_secondaryDnsServer.isEmpty()) {
|
||||||
dnsServers.append(m_secondaryDnsServer);
|
dnsServers.append(m_secondaryDnsServer);
|
||||||
}
|
}
|
||||||
// If the DNS is not the Gateway, it's a user defined DNS
|
// If the DNS is not the Gateway, it's a user defined DNS
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ Ikev2Protocol::Ikev2Protocol(const QJsonObject &configuration, QObject* parent)
|
|||||||
Ikev2Protocol::~Ikev2Protocol()
|
Ikev2Protocol::~Ikev2Protocol()
|
||||||
{
|
{
|
||||||
qDebug() << "IpsecProtocol::~IpsecProtocol()";
|
qDebug() << "IpsecProtocol::~IpsecProtocol()";
|
||||||
disconnect_vpn();
|
|
||||||
Ikev2Protocol::stop();
|
Ikev2Protocol::stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +37,7 @@ void Ikev2Protocol::stop()
|
|||||||
{
|
{
|
||||||
setConnectionState(Vpn::ConnectionState::Disconnecting);
|
setConnectionState(Vpn::ConnectionState::Disconnecting);
|
||||||
{
|
{
|
||||||
if (! disconnect_vpn() ){
|
if (!disconnect_vpn()){
|
||||||
qDebug()<<"We don't disconnect";
|
qDebug()<<"We don't disconnect";
|
||||||
setConnectionState(Vpn::ConnectionState::Error);
|
setConnectionState(Vpn::ConnectionState::Error);
|
||||||
}
|
}
|
||||||
@@ -311,7 +310,9 @@ bool Ikev2Protocol::connect_to_vpn(const QString & vpn_name){
|
|||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
bool Ikev2Protocol::disconnect_vpn(){
|
bool Ikev2Protocol::disconnect_vpn(){
|
||||||
if ( hRasConn != nullptr ){
|
if ( hRasConn != nullptr ){
|
||||||
if ( RasHangUp(hRasConn) != ERROR_SUCCESS)
|
auto ret = RasHangUp(hRasConn);
|
||||||
|
qDebug() << "RasHangUp " << ret;
|
||||||
|
if (ret != ERROR_SUCCESS)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QThread::msleep(3000);
|
QThread::msleep(3000);
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ void ListViewFocusController::previousDelegate()
|
|||||||
case Section::Default: {
|
case Section::Default: {
|
||||||
if (hasFooter()) {
|
if (hasFooter()) {
|
||||||
m_currentSection = Section::Footer;
|
m_currentSection = Section::Footer;
|
||||||
|
viewAtCurrentIndex();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
@@ -127,9 +128,11 @@ void ListViewFocusController::previousDelegate()
|
|||||||
case Section::Delegate: {
|
case Section::Delegate: {
|
||||||
if (m_delegateIndex > 0) {
|
if (m_delegateIndex > 0) {
|
||||||
setDelegateIndex(m_delegateIndex - 1);
|
setDelegateIndex(m_delegateIndex - 1);
|
||||||
|
viewAtCurrentIndex();
|
||||||
break;
|
break;
|
||||||
} else if (hasHeader()) {
|
} else if (hasHeader()) {
|
||||||
m_currentSection = Section::Header;
|
m_currentSection = Section::Header;
|
||||||
|
viewAtCurrentIndex();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
@@ -137,6 +140,7 @@ void ListViewFocusController::previousDelegate()
|
|||||||
case Section::Header: {
|
case Section::Header: {
|
||||||
m_isReturnNeeded = true;
|
m_isReturnNeeded = true;
|
||||||
m_currentSection = Section::Default;
|
m_currentSection = Section::Default;
|
||||||
|
viewAtCurrentIndex();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -275,7 +279,7 @@ bool ListViewFocusController::isFirstFocusItemInListView() const
|
|||||||
return isFirstFocusItemInDelegate() && (m_delegateIndex == 0) && !hasHeader();
|
return isFirstFocusItemInDelegate() && (m_delegateIndex == 0) && !hasHeader();
|
||||||
}
|
}
|
||||||
case Section::Header: {
|
case Section::Header: {
|
||||||
isFirstFocusItemInDelegate();
|
return isFirstFocusItemInDelegate();
|
||||||
}
|
}
|
||||||
case Section::Default: {
|
case Section::Default: {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -191,14 +191,14 @@ QJsonObject AwgConfigModel::getConfig()
|
|||||||
jsonConfig[config_key::junkPacketCount] = m_clientProtocolConfig[config_key::junkPacketCount];
|
jsonConfig[config_key::junkPacketCount] = m_clientProtocolConfig[config_key::junkPacketCount];
|
||||||
jsonConfig[config_key::junkPacketMinSize] = m_clientProtocolConfig[config_key::junkPacketMinSize];
|
jsonConfig[config_key::junkPacketMinSize] = m_clientProtocolConfig[config_key::junkPacketMinSize];
|
||||||
jsonConfig[config_key::junkPacketMaxSize] = m_clientProtocolConfig[config_key::junkPacketMaxSize];
|
jsonConfig[config_key::junkPacketMaxSize] = m_clientProtocolConfig[config_key::junkPacketMaxSize];
|
||||||
jsonConfig[config_key::specialJunk1] = m_clientProtocolConfig[config_key::specialJunk1];
|
jsonConfig[config_key::specialJunk1] = m_clientProtocolConfig[config_key::specialJunk1].toString().trimmed();
|
||||||
jsonConfig[config_key::specialJunk2] = m_clientProtocolConfig[config_key::specialJunk2];
|
jsonConfig[config_key::specialJunk2] = m_clientProtocolConfig[config_key::specialJunk2].toString().trimmed();
|
||||||
jsonConfig[config_key::specialJunk3] = m_clientProtocolConfig[config_key::specialJunk3];
|
jsonConfig[config_key::specialJunk3] = m_clientProtocolConfig[config_key::specialJunk3].toString().trimmed();
|
||||||
jsonConfig[config_key::specialJunk4] = m_clientProtocolConfig[config_key::specialJunk4];
|
jsonConfig[config_key::specialJunk4] = m_clientProtocolConfig[config_key::specialJunk4].toString().trimmed();
|
||||||
jsonConfig[config_key::specialJunk5] = m_clientProtocolConfig[config_key::specialJunk5];
|
jsonConfig[config_key::specialJunk5] = m_clientProtocolConfig[config_key::specialJunk5].toString().trimmed();
|
||||||
jsonConfig[config_key::controlledJunk1] = m_clientProtocolConfig[config_key::controlledJunk1];
|
jsonConfig[config_key::controlledJunk1] = m_clientProtocolConfig[config_key::controlledJunk1].toString().trimmed();
|
||||||
jsonConfig[config_key::controlledJunk2] = m_clientProtocolConfig[config_key::controlledJunk2];
|
jsonConfig[config_key::controlledJunk2] = m_clientProtocolConfig[config_key::controlledJunk2].toString().trimmed();
|
||||||
jsonConfig[config_key::controlledJunk3] = m_clientProtocolConfig[config_key::controlledJunk3];
|
jsonConfig[config_key::controlledJunk3] = m_clientProtocolConfig[config_key::controlledJunk3].toString().trimmed();
|
||||||
jsonConfig[config_key::specialHandshakeTimeout] = m_clientProtocolConfig[config_key::specialHandshakeTimeout];
|
jsonConfig[config_key::specialHandshakeTimeout] = m_clientProtocolConfig[config_key::specialHandshakeTimeout];
|
||||||
|
|
||||||
m_serverProtocolConfig[config_key::last_config] = QString(QJsonDocument(jsonConfig).toJson());
|
m_serverProtocolConfig[config_key::last_config] = QString(QJsonDocument(jsonConfig).toJson());
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ Switch {
|
|||||||
function handleSwitch(event) {
|
function handleSwitch(event) {
|
||||||
if (!event.isAutoRepeat) {
|
if (!event.isAutoRepeat) {
|
||||||
root.checked = !root.checked
|
root.checked = !root.checked
|
||||||
root.checkedChanged()
|
root.toggled()
|
||||||
}
|
}
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ PageType {
|
|||||||
ListViewType {
|
ListViewType {
|
||||||
id: listView
|
id: listView
|
||||||
|
|
||||||
anchors.top: backButtonLayout.bottom
|
anchors.top: backButton.bottom
|
||||||
anchors.bottom: saveButton.top
|
anchors.bottom: saveButton.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ PageType {
|
|||||||
ListViewType {
|
ListViewType {
|
||||||
id: listView
|
id: listView
|
||||||
|
|
||||||
anchors.top: backButtonLayout.bottom
|
anchors.top: backButton.bottom
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|||||||
@@ -17,85 +17,65 @@ import "../Components"
|
|||||||
PageType {
|
PageType {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: backButtonLayout
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
anchors.topMargin: 20
|
|
||||||
|
|
||||||
BackButtonType {
|
BackButtonType {
|
||||||
id: backButton
|
id: backButton
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FlickableType {
|
|
||||||
id: fl
|
|
||||||
anchors.top: backButtonLayout.bottom
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
contentHeight: content.implicitHeight
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: content
|
|
||||||
|
|
||||||
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.topMargin: 20
|
||||||
|
|
||||||
|
onActiveFocusChanged: {
|
||||||
|
if(backButton.enabled && backButton.activeFocus) {
|
||||||
|
listView.positionViewAtBeginning()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ListViewType {
|
||||||
|
id: listView
|
||||||
|
|
||||||
|
anchors.top: backButton.bottom
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.left: parent.left
|
||||||
|
|
||||||
enabled: ServersModel.isProcessedServerHasWriteAccess()
|
enabled: ServersModel.isProcessedServerHasWriteAccess()
|
||||||
|
|
||||||
ListView {
|
header: ColumnLayout {
|
||||||
id: listview
|
width: listView.width
|
||||||
|
|
||||||
width: parent.width
|
BaseHeaderType {
|
||||||
height: listview.contentItem.height
|
id: header
|
||||||
|
|
||||||
clip: true
|
Layout.fillWidth: true
|
||||||
interactive: false
|
Layout.rightMargin: 16
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
|
||||||
|
headerText: qsTr("OpenVPN Settings")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
model: OpenVpnConfigModel
|
model: OpenVpnConfigModel
|
||||||
|
|
||||||
delegate: Item {
|
delegate: ColumnLayout {
|
||||||
id: delegateItem
|
width: listView.width
|
||||||
|
|
||||||
property alias vpnAddressSubnetTextField: vpnAddressSubnetTextField
|
|
||||||
property bool isEnabled: ServersModel.isProcessedServerHasWriteAccess()
|
|
||||||
|
|
||||||
implicitWidth: listview.width
|
|
||||||
implicitHeight: col.implicitHeight
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: col
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
anchors.leftMargin: 16
|
|
||||||
anchors.rightMargin: 16
|
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
BaseHeaderType {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
headerText: qsTr("OpenVPN settings")
|
|
||||||
}
|
|
||||||
|
|
||||||
TextFieldWithHeaderType {
|
TextFieldWithHeaderType {
|
||||||
id: vpnAddressSubnetTextField
|
id: vpnAddressSubnetTextField
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 32
|
Layout.topMargin: 32
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
enabled: delegateItem.isEnabled
|
enabled: listView.enabled
|
||||||
|
|
||||||
headerText: qsTr("VPN address subnet")
|
headerText: qsTr("VPN address subnet")
|
||||||
textField.text: subnetAddress
|
textField.text: subnetAddress
|
||||||
|
|
||||||
parentFlickable: fl
|
|
||||||
|
|
||||||
textField.onEditingFinished: {
|
textField.onEditingFinished: {
|
||||||
if (textField.text !== subnetAddress) {
|
if (textField.text !== subnetAddress) {
|
||||||
subnetAddress = textField.text
|
subnetAddress = textField.text
|
||||||
@@ -108,6 +88,8 @@ PageType {
|
|||||||
ParagraphTextType {
|
ParagraphTextType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 32
|
Layout.topMargin: 32
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
text: qsTr("Network protocol")
|
text: qsTr("Network protocol")
|
||||||
}
|
}
|
||||||
@@ -116,6 +98,9 @@ PageType {
|
|||||||
id: transportProtoSelector
|
id: transportProtoSelector
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 16
|
Layout.topMargin: 16
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
rootWidth: root.width
|
rootWidth: root.width
|
||||||
|
|
||||||
enabled: isTransportProtoEditable
|
enabled: isTransportProtoEditable
|
||||||
@@ -138,9 +123,10 @@ PageType {
|
|||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 40
|
Layout.topMargin: 40
|
||||||
parentFlickable: fl
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
enabled: delegateItem.isEnabled
|
enabled: listView.enabled
|
||||||
|
|
||||||
headerText: qsTr("Port")
|
headerText: qsTr("Port")
|
||||||
textField.text: port
|
textField.text: port
|
||||||
@@ -161,12 +147,13 @@ PageType {
|
|||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
parentFlickable: fl
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
text: qsTr("Auto-negotiate encryption")
|
text: qsTr("Auto-negotiate encryption")
|
||||||
checked: autoNegotiateEncryprion
|
checked: autoNegotiateEncryprion
|
||||||
|
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (checked !== autoNegotiateEncryprion) {
|
if (checked !== autoNegotiateEncryprion) {
|
||||||
autoNegotiateEncryprion = checked
|
autoNegotiateEncryprion = checked
|
||||||
}
|
}
|
||||||
@@ -177,6 +164,8 @@ PageType {
|
|||||||
id: hashDropDown
|
id: hashDropDown
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
enabled: !autoNegotiateEncryprionSwitcher.checked
|
enabled: !autoNegotiateEncryprionSwitcher.checked
|
||||||
|
|
||||||
@@ -225,6 +214,8 @@ PageType {
|
|||||||
id: cipherDropDown
|
id: cipherDropDown
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 16
|
Layout.topMargin: 16
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
enabled: !autoNegotiateEncryprionSwitcher.checked
|
enabled: !autoNegotiateEncryprionSwitcher.checked
|
||||||
|
|
||||||
@@ -273,25 +264,18 @@ PageType {
|
|||||||
id: contentRect
|
id: contentRect
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 32
|
Layout.topMargin: 32
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
Layout.preferredHeight: checkboxLayout.implicitHeight
|
Layout.preferredHeight: checkboxLayout.implicitHeight
|
||||||
color: AmneziaStyle.color.onyxBlack
|
color: AmneziaStyle.color.onyxBlack
|
||||||
radius: 16
|
radius: 16
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: tlsAuthCheckBox
|
|
||||||
enabled: !GC.isMobile()
|
|
||||||
|
|
||||||
function onFocusChanged() {
|
|
||||||
if (tlsAuthCheckBox.activeFocus) {
|
|
||||||
fl.ensureVisible(contentRect)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: checkboxLayout
|
id: checkboxLayout
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
CheckBoxType {
|
CheckBoxType {
|
||||||
id: tlsAuthCheckBox
|
id: tlsAuthCheckBox
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -329,13 +313,14 @@ PageType {
|
|||||||
id: additionalClientCommandsSwitcher
|
id: additionalClientCommandsSwitcher
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 32
|
Layout.topMargin: 32
|
||||||
parentFlickable: fl
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
checked: additionalClientCommands !== ""
|
checked: additionalClientCommands !== ""
|
||||||
|
|
||||||
text: qsTr("Additional client configuration commands")
|
text: qsTr("Additional client configuration commands")
|
||||||
|
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (!checked) {
|
if (!checked) {
|
||||||
additionalClientCommands = ""
|
additionalClientCommands = ""
|
||||||
}
|
}
|
||||||
@@ -346,11 +331,11 @@ PageType {
|
|||||||
id: additionalClientCommandsTextArea
|
id: additionalClientCommandsTextArea
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 16
|
Layout.topMargin: 16
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
visible: additionalClientCommandsSwitcher.checked
|
visible: additionalClientCommandsSwitcher.checked
|
||||||
|
|
||||||
parentFlickable: fl
|
|
||||||
|
|
||||||
textAreaText: additionalClientCommands
|
textAreaText: additionalClientCommands
|
||||||
placeholderText: qsTr("Commands:")
|
placeholderText: qsTr("Commands:")
|
||||||
|
|
||||||
@@ -365,13 +350,14 @@ PageType {
|
|||||||
id: additionalServerCommandsSwitcher
|
id: additionalServerCommandsSwitcher
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 16
|
Layout.topMargin: 16
|
||||||
parentFlickable: fl
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
checked: additionalServerCommands !== ""
|
checked: additionalServerCommands !== ""
|
||||||
|
|
||||||
text: qsTr("Additional server configuration commands")
|
text: qsTr("Additional server configuration commands")
|
||||||
|
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (!checked) {
|
if (!checked) {
|
||||||
additionalServerCommands = ""
|
additionalServerCommands = ""
|
||||||
}
|
}
|
||||||
@@ -382,12 +368,14 @@ PageType {
|
|||||||
id: additionalServerCommandsTextArea
|
id: additionalServerCommandsTextArea
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 16
|
Layout.topMargin: 16
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
visible: additionalServerCommandsSwitcher.checked
|
visible: additionalServerCommandsSwitcher.checked
|
||||||
|
|
||||||
textAreaText: additionalServerCommands
|
textAreaText: additionalServerCommands
|
||||||
placeholderText: qsTr("Commands:")
|
placeholderText: qsTr("Commands:")
|
||||||
parentFlickable: fl
|
|
||||||
textArea.onEditingFinished: {
|
textArea.onEditingFinished: {
|
||||||
if (additionalServerCommands !== textAreaText) {
|
if (additionalServerCommands !== textAreaText) {
|
||||||
additionalServerCommands = textAreaText
|
additionalServerCommands = textAreaText
|
||||||
@@ -401,12 +389,13 @@ PageType {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
Layout.bottomMargin: 24
|
Layout.bottomMargin: 24
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
enabled: vpnAddressSubnetTextField.errorText === "" &&
|
enabled: vpnAddressSubnetTextField.errorText === "" &&
|
||||||
portTextField.errorText === ""
|
portTextField.errorText === ""
|
||||||
|
|
||||||
text: qsTr("Save")
|
text: qsTr("Save")
|
||||||
parentFlickable: fl
|
|
||||||
|
|
||||||
onClicked: function() {
|
onClicked: function() {
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
@@ -438,7 +427,4 @@ PageType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,8 +66,6 @@ PageType {
|
|||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
enabled: delegateItem.isEnabled
|
|
||||||
|
|
||||||
headerText: qsTr("VPN address subnet")
|
headerText: qsTr("VPN address subnet")
|
||||||
textField.text: subnetAddress
|
textField.text: subnetAddress
|
||||||
|
|
||||||
@@ -87,8 +85,6 @@ PageType {
|
|||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
enabled: delegateItem.isEnabled
|
|
||||||
|
|
||||||
headerText: qsTr("Port")
|
headerText: qsTr("Port")
|
||||||
textField.text: port
|
textField.text: port
|
||||||
textField.maximumLength: 5
|
textField.maximumLength: 5
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ PageType {
|
|||||||
|
|
||||||
LabelWithButtonType {
|
LabelWithButtonType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
|
||||||
Layout.rightMargin: 16
|
|
||||||
|
|
||||||
visible: isVisible
|
visible: isVisible
|
||||||
|
|
||||||
@@ -68,8 +66,6 @@ PageType {
|
|||||||
|
|
||||||
visible: GC.isDesktop()
|
visible: GC.isDesktop()
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
|
||||||
Layout.rightMargin: 16
|
|
||||||
|
|
||||||
text: qsTr("Close application")
|
text: qsTr("Close application")
|
||||||
leftImageSource: "qrc:/images/controls/x-circle.svg"
|
leftImageSource: "qrc:/images/controls/x-circle.svg"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ PageType {
|
|||||||
text: qsTr("Allow application screenshots")
|
text: qsTr("Allow application screenshots")
|
||||||
|
|
||||||
checked: SettingsController.isScreenshotsEnabled()
|
checked: SettingsController.isScreenshotsEnabled()
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (checked !== SettingsController.isScreenshotsEnabled()) {
|
if (checked !== SettingsController.isScreenshotsEnabled()) {
|
||||||
SettingsController.toggleScreenshotsEnabled(checked)
|
SettingsController.toggleScreenshotsEnabled(checked)
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ PageType {
|
|||||||
descriptionText: qsTr("Launch the application every time the device is starts")
|
descriptionText: qsTr("Launch the application every time the device is starts")
|
||||||
|
|
||||||
checked: SettingsController.isAutoStartEnabled()
|
checked: SettingsController.isAutoStartEnabled()
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (checked !== SettingsController.isAutoStartEnabled()) {
|
if (checked !== SettingsController.isAutoStartEnabled()) {
|
||||||
SettingsController.toggleAutoStart(checked)
|
SettingsController.toggleAutoStart(checked)
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ PageType {
|
|||||||
descriptionText: qsTr("Connect to VPN on app start")
|
descriptionText: qsTr("Connect to VPN on app start")
|
||||||
|
|
||||||
checked: SettingsController.isAutoConnectEnabled()
|
checked: SettingsController.isAutoConnectEnabled()
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (checked !== SettingsController.isAutoConnectEnabled()) {
|
if (checked !== SettingsController.isAutoConnectEnabled()) {
|
||||||
SettingsController.toggleAutoConnect(checked)
|
SettingsController.toggleAutoConnect(checked)
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ PageType {
|
|||||||
opacity: enabled ? 1.0 : 0.5
|
opacity: enabled ? 1.0 : 0.5
|
||||||
|
|
||||||
checked: SettingsController.isStartMinimizedEnabled()
|
checked: SettingsController.isStartMinimizedEnabled()
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (checked !== SettingsController.isStartMinimizedEnabled()) {
|
if (checked !== SettingsController.isStartMinimizedEnabled()) {
|
||||||
SettingsController.toggleStartMinimized(checked)
|
SettingsController.toggleStartMinimized(checked)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ PageType {
|
|||||||
descriptionText: qsTr("If AmneziaDNS is installed on the server")
|
descriptionText: qsTr("If AmneziaDNS is installed on the server")
|
||||||
|
|
||||||
checked: SettingsController.isAmneziaDnsEnabled()
|
checked: SettingsController.isAmneziaDnsEnabled()
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (checked !== SettingsController.isAmneziaDnsEnabled()) {
|
if (checked !== SettingsController.isAmneziaDnsEnabled()) {
|
||||||
SettingsController.toggleAmneziaDns(checked)
|
SettingsController.toggleAmneziaDns(checked)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,13 @@ PageType {
|
|||||||
|
|
||||||
text: qsTr("If AmneziaDNS is not used or installed")
|
text: qsTr("If AmneziaDNS is not used or installed")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
model: 1 // fake model to force the ListView to be created without a model
|
||||||
|
|
||||||
|
delegate: ColumnLayout {
|
||||||
|
width: listView.width
|
||||||
|
spacing: 16
|
||||||
|
|
||||||
TextFieldWithHeaderType {
|
TextFieldWithHeaderType {
|
||||||
id: primaryDns
|
id: primaryDns
|
||||||
@@ -96,13 +103,6 @@ PageType {
|
|||||||
regularExpression: InstallController.ipAddressRegExp()
|
regularExpression: InstallController.ipAddressRegExp()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
model: 1 // fake model to force the ListView to be created without a model
|
|
||||||
spacing: 16
|
|
||||||
|
|
||||||
delegate: ColumnLayout {
|
|
||||||
width: listView.width
|
|
||||||
|
|
||||||
BasicButtonType {
|
BasicButtonType {
|
||||||
id: restoreDefaultButton
|
id: restoreDefaultButton
|
||||||
@@ -139,10 +139,6 @@ PageType {
|
|||||||
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
footer: ColumnLayout {
|
|
||||||
width: listView.width
|
|
||||||
|
|
||||||
BasicButtonType {
|
BasicButtonType {
|
||||||
id: saveButton
|
id: saveButton
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ PageType {
|
|||||||
|
|
||||||
checked: SettingsController.isLoggingEnabled
|
checked: SettingsController.isLoggingEnabled
|
||||||
|
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (checked !== SettingsController.isLoggingEnabled) {
|
if (checked !== SettingsController.isLoggingEnabled) {
|
||||||
SettingsController.isLoggingEnabled = checked
|
SettingsController.isLoggingEnabled = checked
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ PageType {
|
|||||||
|
|
||||||
signal lastItemTabClickedSignal()
|
signal lastItemTabClickedSignal()
|
||||||
|
|
||||||
|
property bool isServerWithWriteAccess: ServersModel.isProcessedServerHasWriteAccess()
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: InstallController
|
target: InstallController
|
||||||
|
|
||||||
@@ -59,15 +61,13 @@ PageType {
|
|||||||
target: ServersModel
|
target: ServersModel
|
||||||
|
|
||||||
function onProcessedServerIndexChanged() {
|
function onProcessedServerIndexChanged() {
|
||||||
listView.isServerWithWriteAccess = ServersModel.isProcessedServerHasWriteAccess()
|
root.isServerWithWriteAccess = ServersModel.isProcessedServerHasWriteAccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListViewType {
|
ListViewType {
|
||||||
id: listView
|
id: listView
|
||||||
|
|
||||||
property bool isServerWithWriteAccess: ServersModel.isProcessedServerHasWriteAccess()
|
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
model: serverActions
|
model: serverActions
|
||||||
@@ -107,7 +107,7 @@ PageType {
|
|||||||
QtObject {
|
QtObject {
|
||||||
id: check
|
id: check
|
||||||
|
|
||||||
property bool isVisible: true
|
property bool isVisible: root.isServerWithWriteAccess
|
||||||
readonly property string title: qsTr("Check the server for previously installed Amnezia services")
|
readonly property string title: qsTr("Check the server for previously installed Amnezia services")
|
||||||
readonly property string description: qsTr("Add them to the application if they were not displayed")
|
readonly property string description: qsTr("Add them to the application if they were not displayed")
|
||||||
readonly property var tColor: AmneziaStyle.color.paleGray
|
readonly property var tColor: AmneziaStyle.color.paleGray
|
||||||
@@ -121,7 +121,7 @@ PageType {
|
|||||||
QtObject {
|
QtObject {
|
||||||
id: reboot
|
id: reboot
|
||||||
|
|
||||||
property bool isVisible: true
|
property bool isVisible: root.isServerWithWriteAccess
|
||||||
readonly property string title: qsTr("Reboot server")
|
readonly property string title: qsTr("Reboot server")
|
||||||
readonly property string description: ""
|
readonly property string description: ""
|
||||||
readonly property var tColor: AmneziaStyle.color.vibrantRed
|
readonly property var tColor: AmneziaStyle.color.vibrantRed
|
||||||
@@ -181,7 +181,7 @@ PageType {
|
|||||||
QtObject {
|
QtObject {
|
||||||
id: clear
|
id: clear
|
||||||
|
|
||||||
property bool isVisible: true
|
property bool isVisible: root.isServerWithWriteAccess
|
||||||
readonly property string title: qsTr("Clear server from Amnezia software")
|
readonly property string title: qsTr("Clear server from Amnezia software")
|
||||||
readonly property string description: ""
|
readonly property string description: ""
|
||||||
readonly property var tColor: AmneziaStyle.color.vibrantRed
|
readonly property var tColor: AmneziaStyle.color.vibrantRed
|
||||||
@@ -240,7 +240,7 @@ PageType {
|
|||||||
QtObject {
|
QtObject {
|
||||||
id: switch_to_premium
|
id: switch_to_premium
|
||||||
|
|
||||||
property bool isVisible: ServersModel.getProcessedServerData("isServerFromTelegramApi")
|
property bool isVisible: ServersModel.getProcessedServerData("isServerFromTelegramApi") && ServersModel.processedServerIsPremium
|
||||||
readonly property string title: qsTr("Switch to the new Amnezia Premium subscription")
|
readonly property string title: qsTr("Switch to the new Amnezia Premium subscription")
|
||||||
readonly property string description: ""
|
readonly property string description: ""
|
||||||
readonly property var tColor: AmneziaStyle.color.vibrantRed
|
readonly property var tColor: AmneziaStyle.color.vibrantRed
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ PageType {
|
|||||||
|
|
||||||
visible: PageController.isStartPageVisible()
|
visible: PageController.isStartPageVisible()
|
||||||
checked: SettingsController.isLoggingEnabled
|
checked: SettingsController.isLoggingEnabled
|
||||||
onCheckedChanged: {
|
onToggled: function() {
|
||||||
if (checked !== SettingsController.isLoggingEnabled) {
|
if (checked !== SettingsController.isLoggingEnabled) {
|
||||||
SettingsController.isLoggingEnabled = checked
|
SettingsController.isLoggingEnabled = checked
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,10 +161,4 @@ PageType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShareConnectionDrawer {
|
|
||||||
id: shareConnectionDrawer
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ void IpcProcessTun2Socks::start()
|
|||||||
QString XrayConStr = "socks5://127.0.0.1:10808";
|
QString XrayConStr = "socks5://127.0.0.1:10808";
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
QStringList arguments({"-device", "tun://tun2", "-proxy", XrayConStr, "-tun-post-up",
|
QStringList arguments({"-device", "tun://tun2?guid={081A8A84-8D12-4DF5-B8C4-396D5B0053E4}", "-proxy", XrayConStr, "-tun-post-up",
|
||||||
QString("cmd /c netsh interface ip set address name=\"tun2\" static %1 255.255.255.255")
|
QString("cmd /c netsh interface ip set address name=\"tun2\" static %1 255.255.255.255")
|
||||||
.arg(amnezia::protocols::xray::defaultLocalAddr)});
|
.arg(amnezia::protocols::xray::defaultLocalAddr)});
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user