Compare commits

...

17 Commits

Author SHA1 Message Date
vladimir.kuznetsov
59bccb1188 Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into bugfix/split-tunneling 2023-10-22 20:00:39 +05:00
pokamest
cd8fc007ac Merge pull request #392 from amnezia-vpn/bugfix/existing-awg-container
added getting awg parameters when adding an already installed awg container
2023-10-22 07:49:34 -07:00
vladimir.kuznetsov
7cfb38307e removed re-processing of server config for awg 2023-10-22 18:04:34 +05:00
vladimir.kuznetsov
994aa32745 added getting awg parameters when adding an already installed awg container 2023-10-22 17:31:13 +05:00
pokamest
0bb4dd9442 Text and translations fixes 2023-10-21 18:32:30 +01:00
pokamest
7a54dc15da Update amneziavpn_ru.ts 2023-10-21 16:33:21 +01:00
pokamest
e16a1100d8 Update amneziavpn_ru.ts 2023-10-21 16:20:57 +01:00
pokamest
99214e22e3 Fix docs url 2023-10-21 16:05:09 +01:00
pokamest
c77d35a2ed Merge pull request #390 from amnezia-vpn/revert-370-feature/custom_drawer_component
Revert "added new drawer2type for replacing drawertype"
2023-10-21 06:21:07 -07:00
pokamest
d98fdbdc5c Revert "added new drawer2type for replacing drawertype" 2023-10-21 14:17:45 +01:00
vladimir.kuznetsov
fcf6bb43b7 Merge branch 'bugfix/split-tunneling' of github.com:amnezia-vpn/amnezia-client into bugfix/split-tunneling 2023-10-18 12:18:46 +05:00
vladimir.kuznetsov
f5f72f87a6 fixed switcher status display for page split site tunneling 2023-10-18 12:17:24 +05:00
vladimir.kuznetsov
3340451245 Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into bugfix/split-tunneling 2023-10-18 11:55:24 +05:00
vladimir.kuznetsov
9cf5590371 disabled split site tunneling for awg 2023-10-16 15:17:09 +05:00
vladimir.kuznetsov
2a4a01a4be removed split site tunneling page blocking when switcher is turned off 2023-10-16 13:28:37 +05:00
vladimir.kuznetsov
24637a1693 Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into HEAD 2023-10-15 21:08:45 +05:00
vladimir.kuznetsov
7bd1340190 fixed display of sites on page split tunneling 2023-10-15 20:41:49 +05:00
39 changed files with 503 additions and 763 deletions

View File

@@ -139,7 +139,8 @@ void AmneziaApplication::init()
&ConnectionController::openConnection);
connect(m_notificationHandler.get(), &NotificationHandler::disconnectRequested, m_connectionController.get(),
&ConnectionController::closeConnection);
connect(this, &AmneziaApplication::translationsUpdated, m_notificationHandler.get(), &NotificationHandler::onTranslationsUpdated);
connect(this, &AmneziaApplication::translationsUpdated, m_notificationHandler.get(),
&NotificationHandler::onTranslationsUpdated);
m_engine->load(url);
m_systemController->setQmlRoot(m_engine->rootObjects().value(0));
@@ -226,14 +227,13 @@ void AmneziaApplication::loadTranslator()
updateTranslator(locale);
}
void AmneziaApplication::updateTranslator(const QLocale &locale)
{
if (!m_translator->isEmpty()) {
QCoreApplication::removeTranslator(m_translator.get());
}
QString strFileName = QString(":/translations/amneziavpn")+QLatin1String("_")+locale.name()+".qm";
QString strFileName = QString(":/translations/amneziavpn") + QLatin1String("_") + locale.name() + ".qm";
if (m_translator->load(strFileName)) {
if (QCoreApplication::installTranslator(m_translator.get())) {
m_settings->setAppLanguage(locale);
@@ -297,11 +297,13 @@ void AmneziaApplication::initModels()
m_sitesModel.reset(new SitesModel(m_settings, this));
m_engine->rootContext()->setContextProperty("SitesModel", m_sitesModel.get());
connect(m_containersModel.get(), &ContainersModel::defaultContainerChanged, this, [this]() {
if (m_containersModel->getDefaultContainer() == DockerContainer::WireGuard
&& m_sitesModel->getRouteMode() != Settings::RouteMode::VpnAllSites) {
m_sitesModel->setRouteMode(Settings::RouteMode::VpnAllSites);
if ((m_containersModel->getDefaultContainer() == DockerContainer::WireGuard
|| m_containersModel->getDefaultContainer() == DockerContainer::Awg)
&& m_sitesModel->isSplitTunnelingEnabled()) {
m_sitesModel->toggleSplitTunneling(false);
emit m_pageController->showNotificationMessage(
tr("Split tunneling for WireGuard is not implemented, the option was disabled"));
tr("Split tunneling for %1 is not implemented, the option was disabled")
.arg(ContainerProps::containerHumanNames().value(m_containersModel->getDefaultContainer())));
}
});
@@ -337,7 +339,8 @@ void AmneziaApplication::initControllers()
m_connectionController.reset(new ConnectionController(m_serversModel, m_containersModel, m_vpnConnection));
m_engine->rootContext()->setContextProperty("ConnectionController", m_connectionController.get());
connect(this, &AmneziaApplication::translationsUpdated, m_connectionController.get(), &ConnectionController::onTranslationsUpdated);
connect(this, &AmneziaApplication::translationsUpdated, m_connectionController.get(),
&ConnectionController::onTranslationsUpdated);
m_pageController.reset(new PageController(m_serversModel, m_settings));
m_engine->rootContext()->setContextProperty("PageController", m_pageController.get());

View File

@@ -17,43 +17,31 @@ QString AwgConfigurator::genAwgConfig(const ServerCredentials &credentials,
QString config = WireguardConfigurator::genWireguardConfig(credentials, container, containerConfig, errorCode);
QJsonObject jsonConfig = QJsonDocument::fromJson(config.toUtf8()).object();
QString awgConfig = jsonConfig.value(config_key::config).toString();
ServerController serverController(m_settings);
QString serverConfig = serverController.getTextFileFromContainer(container, credentials, protocols::awg::serverConfigPath, errorCode);
QMap<QString, QString> serverConfigMap;
auto serverConfigLines = serverConfig.split("\n");
for (auto &line : serverConfigLines) {
QMap<QString, QString> configMap;
auto configLines = awgConfig.split("\n");
for (auto &line : configLines) {
auto trimmedLine = line.trimmed();
if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) {
continue;
} else {
QStringList parts = trimmedLine.split(" = ");
if (parts.count() == 2) {
serverConfigMap.insert(parts[0].trimmed(), parts[1].trimmed());
configMap.insert(parts[0].trimmed(), parts[1].trimmed());
}
}
}
config.replace("$JUNK_PACKET_COUNT", serverConfigMap.value(config_key::junkPacketCount));
config.replace("$JUNK_PACKET_MIN_SIZE", serverConfigMap.value(config_key::junkPacketMinSize));
config.replace("$JUNK_PACKET_MAX_SIZE", serverConfigMap.value(config_key::junkPacketMaxSize));
config.replace("$INIT_PACKET_JUNK_SIZE", serverConfigMap.value(config_key::initPacketJunkSize));
config.replace("$RESPONSE_PACKET_JUNK_SIZE", serverConfigMap.value(config_key::responsePacketJunkSize));
config.replace("$INIT_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::initPacketMagicHeader));
config.replace("$RESPONSE_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::responsePacketMagicHeader));
config.replace("$UNDERLOAD_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::underloadPacketMagicHeader));
config.replace("$TRANSPORT_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::transportPacketMagicHeader));
jsonConfig[config_key::junkPacketCount] = serverConfigMap.value(config_key::junkPacketCount);
jsonConfig[config_key::junkPacketMinSize] = serverConfigMap.value(config_key::junkPacketMinSize);
jsonConfig[config_key::junkPacketMaxSize] = serverConfigMap.value(config_key::junkPacketMaxSize);
jsonConfig[config_key::initPacketJunkSize] = serverConfigMap.value(config_key::initPacketJunkSize);
jsonConfig[config_key::responsePacketJunkSize] = serverConfigMap.value(config_key::responsePacketJunkSize);
jsonConfig[config_key::initPacketMagicHeader] = serverConfigMap.value(config_key::initPacketMagicHeader);
jsonConfig[config_key::responsePacketMagicHeader] = serverConfigMap.value(config_key::responsePacketMagicHeader);
jsonConfig[config_key::underloadPacketMagicHeader] = serverConfigMap.value(config_key::underloadPacketMagicHeader);
jsonConfig[config_key::transportPacketMagicHeader] = serverConfigMap.value(config_key::transportPacketMagicHeader);
jsonConfig[config_key::junkPacketCount] = configMap.value(config_key::junkPacketCount);
jsonConfig[config_key::junkPacketMinSize] = configMap.value(config_key::junkPacketMinSize);
jsonConfig[config_key::junkPacketMaxSize] = configMap.value(config_key::junkPacketMaxSize);
jsonConfig[config_key::initPacketJunkSize] = configMap.value(config_key::initPacketJunkSize);
jsonConfig[config_key::responsePacketJunkSize] = configMap.value(config_key::responsePacketJunkSize);
jsonConfig[config_key::initPacketMagicHeader] = configMap.value(config_key::initPacketMagicHeader);
jsonConfig[config_key::responsePacketMagicHeader] = configMap.value(config_key::responsePacketMagicHeader);
jsonConfig[config_key::underloadPacketMagicHeader] = configMap.value(config_key::underloadPacketMagicHeader);
jsonConfig[config_key::transportPacketMagicHeader] = configMap.value(config_key::transportPacketMagicHeader);
return QJsonDocument(jsonConfig).toJson();
}

View File

@@ -834,6 +834,34 @@ ErrorCode ServerController::getAlreadyInstalledContainers(const ServerCredential
containerConfig.insert(config_key::port, port);
containerConfig.insert(config_key::transport_proto, transportProto);
if (protocol == Proto::Awg) {
QString serverConfig = getTextFileFromContainer(container, credentials, protocols::awg::serverConfigPath, &errorCode);
QMap<QString, QString> serverConfigMap;
auto serverConfigLines = serverConfig.split("\n");
for (auto &line : serverConfigLines) {
auto trimmedLine = line.trimmed();
if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) {
continue;
} else {
QStringList parts = trimmedLine.split(" = ");
if (parts.count() == 2) {
serverConfigMap.insert(parts[0].trimmed(), parts[1].trimmed());
}
}
}
containerConfig[config_key::junkPacketCount] = serverConfigMap.value(config_key::junkPacketCount);
containerConfig[config_key::junkPacketMinSize] = serverConfigMap.value(config_key::junkPacketMinSize);
containerConfig[config_key::junkPacketMaxSize] = serverConfigMap.value(config_key::junkPacketMaxSize);
containerConfig[config_key::initPacketJunkSize] = serverConfigMap.value(config_key::initPacketJunkSize);
containerConfig[config_key::responsePacketJunkSize] = serverConfigMap.value(config_key::responsePacketJunkSize);
containerConfig[config_key::initPacketMagicHeader] = serverConfigMap.value(config_key::initPacketMagicHeader);
containerConfig[config_key::responsePacketMagicHeader] = serverConfigMap.value(config_key::responsePacketMagicHeader);
containerConfig[config_key::underloadPacketMagicHeader] = serverConfigMap.value(config_key::underloadPacketMagicHeader);
containerConfig[config_key::transportPacketMagicHeader] = serverConfigMap.value(config_key::transportPacketMagicHeader);
}
config.insert(config_key::container, ContainerProps::containerToString(container));
}
config.insert(ProtocolProps::protoToString(protocol), containerConfig);

View File

@@ -216,7 +216,6 @@
<file>ui/qml/Pages2/PageServiceDnsSettings.qml</file>
<file>ui/qml/Controls2/TopCloseButtonType.qml</file>
<file>images/controls/x-circle.svg</file>
<file>ui/qml/Controls2/Drawer2Type.qml</file>
<file>ui/qml/Pages2/PageProtocolAwgSettings.qml</file>
<file>server_scripts/awg/template.conf</file>
<file>server_scripts/awg/start.sh</file>

View File

@@ -4,9 +4,13 @@
<context>
<name>AmneziaApplication</name>
<message>
<location filename="../amnezia_application.cpp" line="304"/>
<source>Split tunneling for WireGuard is not implemented, the option was disabled</source>
<translation>Раздельное туннелирование для &quot;Wireguard&quot; не реализовано,опция отключена</translation>
<translation type="vanished">Раздельное туннелирование для &quot;Wireguard&quot; не реализовано,опция отключена</translation>
</message>
<message>
<location filename="../amnezia_application.cpp" line="305"/>
<source>Split tunneling for %1 is not implemented, the option was disabled</source>
<translation>Раздельное туннелирование для %1 не реализовано, опция отключена</translation>
</message>
</context>
<context>
@@ -120,7 +124,7 @@
<message>
<location filename="../ui/qml/Components/HomeContainersListView.qml" line="58"/>
<source>Unable change protocol while there is an active connection</source>
<translation type="unfinished"></translation>
<translation>Невозможно изменить протокол при активном соединении</translation>
</message>
<message>
<location filename="../ui/qml/Components/HomeContainersListView.qml" line="69"/>
@@ -274,7 +278,7 @@ Already installed containers were found on the server. All installed containers
<message>
<location filename="../ui/qml/Pages2/PageHome.qml" line="490"/>
<source>Unable change server while there is an active connection</source>
<translation type="unfinished"></translation>
<translation>Невозможно изменить сервер при активном соединении</translation>
</message>
</context>
<context>
@@ -346,9 +350,13 @@ Already installed containers were found on the server. All installed containers
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolAwgSettings.qml" line="279"/>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<source>All users with whom you shared a connection will no longer be able to connect to it.</source>
<translation>Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<translation type="vanished">Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolAwgSettings.qml" line="280"/>
<source>Continue</source>
@@ -404,7 +412,7 @@ Already installed containers were found on the server. All installed containers
<message>
<location filename="../ui/qml/Pages2/PageProtocolOpenVpnSettings.qml" line="84"/>
<source>VPN Addresses Subnet</source>
<translation>VPN Адреса Подсеть</translation>
<translation>Подсеть для VPN</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolOpenVpnSettings.qml" line="98"/>
@@ -571,9 +579,13 @@ Already installed containers were found on the server. All installed containers
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolOpenVpnSettings.qml" line="368"/>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<source>All users with whom you shared a connection will no longer be able to connect to it.</source>
<translation>Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<translation type="vanished">Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolOpenVpnSettings.qml" line="369"/>
<source>Continue</source>
@@ -619,8 +631,12 @@ Already installed containers were found on the server. All installed containers
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolRaw.qml" line="179"/>
<source>All users with whom you shared a connection will no longer be able to connect to it.</source>
<translation>Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<translation type="unfinished">Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
<translation type="obsolete">Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolRaw.qml" line="180"/>
@@ -1132,7 +1148,7 @@ Already installed containers were found on the server. All installed containers
<message>
<location filename="../ui/qml/Pages2/PageSettingsConnection.qml" line="41"/>
<source>Connection</source>
<translation>Подключение</translation>
<translation>Соединение</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsConnection.qml" line="50"/>
@@ -1278,7 +1294,7 @@ Already installed containers were found on the server. All installed containers
<message>
<location filename="../ui/qml/Pages2/PageSettingsLogging.qml" line="127"/>
<source>Save logs to file</source>
<translation>Сохранять логи в файл</translation>
<translation>Сохранить логи в файл</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsLogging.qml" line="145"/>
@@ -1440,8 +1456,12 @@ Already installed containers were found on the server. All installed containers
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsServerProtocol.qml" line="117"/>
<source>All users with whom you shared a connection will no longer be able to connect to it.</source>
<translation>Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<translation>Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться.</translation>
<translation type="vanished">Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsServerProtocol.qml" line="118"/>
@@ -1480,75 +1500,75 @@ Already installed containers were found on the server. All installed containers
<translation>Раздельное VPN-туннелирование</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="128"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="121"/>
<source>Mode</source>
<translation>Режим</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="206"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="199"/>
<source>Remove </source>
<translation>Удалить </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="207"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="200"/>
<source>Continue</source>
<translation>Продолжить</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="208"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="201"/>
<source>Cancel</source>
<translation>Отменить</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="255"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="248"/>
<source>Site or IP</source>
<translation>Сайт или IP</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="299"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="292"/>
<source>Import/Export Sites</source>
<translation>Импорт/экспорт Сайтов</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="305"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="298"/>
<source>Import</source>
<translation>Импорт</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="317"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="310"/>
<source>Save site list</source>
<translation>Сохранить список сайтов</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="324"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="317"/>
<source>Save sites</source>
<translation>Сохранить</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="325"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="392"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="407"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="318"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="385"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="400"/>
<source>Sites files (*.json)</source>
<translation>Sites files (*.json)</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="382"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="375"/>
<source>Import a list of sites</source>
<translation>Импортировать список с сайтами</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="388"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="381"/>
<source>Replace site list</source>
<translation>Заменить список сайтов</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="391"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="406"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="384"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="399"/>
<source>Open sites file</source>
<translation>Открыть список с сайтами</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="403"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="396"/>
<source>Add imported sites to existing ones</source>
<translation>Добавить импортированные сайты к существующим</translation>
</message>
@@ -1884,9 +1904,8 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>WireGuard нативный формат</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="121"/>
<source>VPN Access</source>
<translation>VPN-Доступ</translation>
<translation type="vanished">VPN-Доступ</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="146"/>
@@ -1894,14 +1913,12 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>Соединение</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="174"/>
<source>VPN access without the ability to manage the server</source>
<translation>Доступ к VPN, без возможности управления сервером</translation>
<translation type="vanished">Доступ к VPN, без возможности управления сервером</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="175"/>
<source>Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings.</source>
<translation>Доступ к управлению сервером. Пользователь, с которым вы делитесь полным доступом к соединению, сможет добавлять и удалять ваши протоколы и службы на сервере, а также изменять настройки.</translation>
<translation type="vanished">Доступ к управлению сервером. Пользователь, с которым вы делитесь полным доступом к соединению, сможет добавлять и удалять ваши протоколы и службы на сервере, а также изменять настройки.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="190"/>
@@ -1944,11 +1961,26 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<source>For the AmneziaVPN app</source>
<translation>Для AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="121"/>
<source>Share VPN Access</source>
<translation>Поделиться VPN</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="158"/>
<source>Full access</source>
<translation>Полный доступ</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="174"/>
<source>Share VPN access without the ability to manage the server</source>
<translation>Поделиться доступом к VPN, без возможности управления сервером</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="175"/>
<source>Share access to server management. The user with whom you share full access to the server will be able to add and remove any protocols and services to the server, as well as change settings.</source>
<translation>Поделиться доступом к управлению сервером. Пользователь, с которым вы делитесь полным доступом к серверу, сможет добавлять и удалять любые протоколы и службы на сервере, а также изменять настройки.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="251"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="252"/>
@@ -2571,9 +2603,9 @@ OpenVPN обеспечивает безопасное VPN-соединение
Cloak защищает OpenVPN от обнаружения и блокировок.
Cloak может изменять метаданные пакетов. Он полностью маскирует VPN-трафик под обычный веб-трафик, а также защищает VPN от обнаружения с помощью Active Probing. Это делает ее очень устойчивой к обнаружению
Cloak может изменять метаданные пакетов. Он полностью маскирует VPN-трафик под обычный веб-трафик, а также защищает VPN от обнаружения с помощью Active Probing. Это делает его очень устойчивым к обнаружению
Сразу же после получения первого пакета данных Cloak проверяет подлинность входящего соединения. Если аутентификация не проходит, плагин маскирует сервер под поддельный сайт, и ваша VPN становится невидимой для аналитических систем.
Сразу же после получения первого пакета данных Cloak проверяет подлинность входящего соединения. Если аутентификация не проходит, плагин маскирует сервер под поддельный сайт, и ваш VPN становится невидимым для аналитических систем.
Если в вашем регионе существует экстремальный уровень цензуры в Интернете, мы советуем вам при первом подключении использовать только OpenVPN через Cloak

View File

@@ -4,9 +4,13 @@
<context>
<name>AmneziaApplication</name>
<message>
<location filename="../amnezia_application.cpp" line="304"/>
<source>Split tunneling for WireGuard is not implemented, the option was disabled</source>
<translation>WireGuard协议的VPN分离</translation>
<translation type="vanished">WireGuard协议的VPN分离</translation>
</message>
<message>
<location filename="../amnezia_application.cpp" line="305"/>
<source>Split tunneling for %1 is not implemented, the option was disabled</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -131,7 +135,7 @@
<message>
<location filename="../ui/qml/Components/HomeContainersListView.qml" line="58"/>
<source>Unable change protocol while there is an active connection</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Components/HomeContainersListView.qml" line="69"/>
@@ -380,8 +384,12 @@ Already installed containers were found on the server. All installed containers
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolAwgSettings.qml" line="279"/>
<source>All users with whom you shared a connection will no longer be able to connect to it.</source>
<translation></translation>
</message>
<message>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<translation>使</translation>
<translation type="vanished">使</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolAwgSettings.qml" line="280"/>
@@ -605,8 +613,12 @@ Already installed containers were found on the server. All installed containers
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolOpenVpnSettings.qml" line="368"/>
<source>All users with whom you shared a connection will no longer be able to connect to it.</source>
<translation></translation>
</message>
<message>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<translation>使</translation>
<translation type="vanished">使</translation>
</message>
<message>
<source>All users with whom you shared a connection will no longer be able to connect to it</source>
@@ -661,8 +673,12 @@ Already installed containers were found on the server. All installed containers
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolRaw.qml" line="179"/>
<source>All users with whom you shared a connection will no longer be able to connect to it.</source>
<translation></translation>
</message>
<message>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<translation>使</translation>
<translation type="vanished">使</translation>
</message>
<message>
<source> from server?</source>
@@ -1521,8 +1537,12 @@ And if you don&apos;t like the app, all the more support it - the donation will
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsServerProtocol.qml" line="117"/>
<source>All users with whom you shared a connection will no longer be able to connect to it.</source>
<translation></translation>
</message>
<message>
<source>All users who you shared a connection with will no longer be able to connect to it.</source>
<translation>使</translation>
<translation type="vanished">使</translation>
</message>
<message>
<source> from server?</source>
@@ -1586,75 +1606,75 @@ And if you don&apos;t like the app, all the more support it - the donation will
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="128"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="121"/>
<source>Mode</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="206"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="199"/>
<source>Remove </source>
<translation> </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="207"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="200"/>
<source>Continue</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="208"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="201"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="255"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="248"/>
<source>Site or IP</source>
<translation>IP地址</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="299"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="292"/>
<source>Import/Export Sites</source>
<translation>/</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="305"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="298"/>
<source>Import</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="317"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="310"/>
<source>Save site list</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="324"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="317"/>
<source>Save sites</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="325"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="392"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="407"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="318"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="385"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="400"/>
<source>Sites files (*.json)</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="382"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="375"/>
<source>Import a list of sites</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="388"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="381"/>
<source>Replace site list</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="391"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="406"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="384"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="399"/>
<source>Open sites file</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="403"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="396"/>
<source>Add imported sites to existing ones</source>
<translation></translation>
</message>
@@ -2006,8 +2026,22 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="121"/>
<source>Share VPN Access</source>
<translation> VPN 访</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="174"/>
<source>Share VPN access without the ability to manage the server</source>
<translation> VPN 访</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="175"/>
<source>Share access to server management. The user with whom you share full access to the server will be able to add and remove any protocols and services to the server, as well as change settings.</source>
<translation>访访</translation>
</message>
<message>
<source>VPN Access</source>
<translation>访VPN</translation>
<translation type="vanished">访VPN</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="146"/>
@@ -2020,14 +2054,12 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>访</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="174"/>
<source>VPN access without the ability to manage the server</source>
<translation>访VPN</translation>
<translation type="vanished">访VPN</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="175"/>
<source>Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings.</source>
<translation>访VPN外</translation>
<translation type="vanished">访VPN外</translation>
</message>
<message>
<source>Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings.</source>

View File

@@ -117,8 +117,9 @@ QString ContainersModel::getDefaultContainerName()
return ContainerProps::containerHumanNames().value(m_defaultContainerIndex);
}
void ContainersModel::setDefaultContainer(DockerContainer container)
void ContainersModel::setDefaultContainer(int index)
{
auto container = static_cast<DockerContainer>(index);
m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container);
m_defaultContainerIndex = container;
emit defaultContainerChanged();

View File

@@ -46,7 +46,7 @@ public:
public slots:
DockerContainer getDefaultContainer();
QString getDefaultContainerName();
void setDefaultContainer(DockerContainer container);
void setDefaultContainer(int index);
void setCurrentlyProcessedServerIndex(const int index);

View File

@@ -3,7 +3,14 @@
SitesModel::SitesModel(std::shared_ptr<Settings> settings, QObject *parent)
: QAbstractListModel(parent), m_settings(settings)
{
m_currentRouteMode = m_settings->routeMode();
auto routeMode = m_settings->routeMode();
if (routeMode == Settings::RouteMode::VpnAllSites) {
m_isSplitTunnelingEnabled = false;
m_currentRouteMode = Settings::RouteMode::VpnOnlyForwardSites;
} else {
m_isSplitTunnelingEnabled = true;
m_currentRouteMode = routeMode;
}
fillSites();
}
@@ -93,6 +100,21 @@ void SitesModel::setRouteMode(int routeMode)
emit routeModeChanged();
}
bool SitesModel::isSplitTunnelingEnabled()
{
return m_isSplitTunnelingEnabled;
}
void SitesModel::toggleSplitTunneling(bool enabled)
{
if (enabled) {
setRouteMode(m_currentRouteMode);
} else {
m_settings->setRouteMode(Settings::RouteMode::VpnAllSites);
}
m_isSplitTunnelingEnabled = enabled;
}
QVector<QPair<QString, QString> > SitesModel::getCurrentSites()
{
return m_sites;

View File

@@ -31,6 +31,9 @@ public slots:
int getRouteMode();
void setRouteMode(int routeMode);
bool isSplitTunnelingEnabled();
void toggleSplitTunneling(bool enabled);
QVector<QPair<QString, QString>> getCurrentSites();
signals:
@@ -44,6 +47,7 @@ private:
std::shared_ptr<Settings> m_settings;
bool m_isSplitTunnelingEnabled;
Settings::RouteMode m_currentRouteMode;
QVector<QPair<QString, QString>> m_sites;

View File

@@ -8,16 +8,13 @@ import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
Drawer2Type {
DrawerType {
id: root
width: parent.width
height: parent.height
contentHeight: parent.height * 0.4375
height: parent.height * 0.4375
ColumnLayout {
parent: root.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right

View File

@@ -63,7 +63,7 @@ ListView {
isDefault = true
menuContent.currentIndex = index
containersDropDown.menu.close()
containersDropDown.menuVisible = false
} else {
if (!isSupported && isInstalled) {
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))

View File

@@ -5,7 +5,7 @@ import QtQuick.Layouts
import "../Controls2"
import "../Controls2/TextTypes"
Drawer2Type {
DrawerType {
id: root
property string headerText
@@ -15,14 +15,12 @@ Drawer2Type {
property var yesButtonFunction
property var noButtonFunction
property real drawerHeight: 0.5
width: parent.width
height: parent.height
contentHeight: parent.height * drawerHeight
height: content.implicitHeight + 32
ColumnLayout {
parent: root.contentParent
id: content
anchors.top: parent.top
anchors.left: parent.left
@@ -31,8 +29,6 @@ Drawer2Type {
anchors.rightMargin: 16
anchors.leftMargin: 16
// visible: false
spacing: 8
Header2TextType {

View File

@@ -5,18 +5,15 @@ import QtQuick.Layouts
import "../Controls2"
import "../Controls2/TextTypes"
Drawer2Type {
DrawerType {
id: root
width: parent.width
height: parent.height
contentHeight: parent.height * 0.9
height: parent.height * 0.9
ColumnLayout {
id: backButton
parent: root.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -31,7 +28,6 @@ Drawer2Type {
}
FlickableType {
parent: root.contentParent
anchors.top: backButton.bottom
anchors.left: parent.left
anchors.right: parent.right

View File

@@ -16,7 +16,7 @@ import "../Controls2/TextTypes"
import "../Config"
import "../Components"
Drawer2Type {
DrawerType {
id: root
property alias headerText: header.headerText
@@ -28,10 +28,9 @@ Drawer2Type {
property string configFileName: "amnezia_config.vpn"
width: parent.width
height: parent.height
contentHeight: parent.height * 0.9
height: parent.height * 0.9
onDrawerClosed: {
onClosed: {
configExtension = ".vpn"
configCaption = qsTr("Save AmneziaVPN config")
configFileName = "amnezia_config"
@@ -42,9 +41,6 @@ Drawer2Type {
Header2Type {
id: header
parent: root.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -54,8 +50,6 @@ Drawer2Type {
}
FlickableType {
parent: root.contentParent
anchors.top: header.bottom
anchors.bottom: parent.bottom
contentHeight: content.height + 32
@@ -132,37 +126,30 @@ Drawer2Type {
text: qsTr("Show connection settings")
onClicked: {
configContentDrawer.open()
configContentDrawer.visible = true
}
}
Drawer2Type {
DrawerType {
id: configContentDrawer
parent: root
width: parent.width
height: parent.height
contentHeight: parent.height * 0.9
height: parent.height * 0.9
BackButtonType {
id: backButton
parent: configContentDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 16
backButtonFunction: function() {
configContentDrawer.close()
configContentDrawer.visible = false
}
}
FlickableType {
parent: configContentDrawer.contentParent
anchors.top: backButton.bottom
anchors.left: parent.left
anchors.right: parent.right

View File

@@ -1,314 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Shapes
Item {
id: root
Connections {
target: PageController
function onForceCloseDrawer() {
if (root.expanded()) {
collapse()
}
}
}
signal drawerClosed
signal collapsedEntered
signal collapsedExited
signal collapsedEnter
signal collapsedPressChanged
visible: false
property bool needCloseButton: true
property string defaultColor: "#1C1D21"
property string borderColor: "#2C2D30"
property string semitransparentColor: "#90000000"
property bool needCollapsed: false
property int contentHeight: 0
property Item contentParent: contentArea
property bool dragActive: dragArea.drag.active
property int collapsedHeight: 0
property bool fullMouseAreaVisible: true
property MouseArea drawerDragArea: dragArea
state: "collapsed"
Rectangle {
id: draw2Background
anchors.fill: parent
height: parent.height
width: parent.width
radius: 16
color: "transparent"
border.color: "transparent"
border.width: 1
visible: true
MouseArea {
id: fullMouseArea
anchors.fill: parent
enabled: root.expanded()
hoverEnabled: true
visible: fullMouseAreaVisible
onClicked: {
if (root.expanded()) {
collapse()
}
}
}
Rectangle {
id: placeAreaHolder
// for apdating home drawer, normal drawer will reset it
height: 0
anchors.right: parent.right
anchors.left: parent.left
visible: true
color: "transparent"
Drag.active: dragArea.drag.active
}
Rectangle {
id: contentArea
anchors.top: placeAreaHolder.bottom
height: contentHeight
radius: 16
color: root.defaultColor
border.width: 1
border.color: root.borderColor
width: parent.width
visible: true
Rectangle {
width: parent.radius
height: parent.radius
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
color: parent.color
}
MouseArea {
id: dragArea
anchors.fill: parent
cursorShape: root.collapsed() ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true
drag.target: placeAreaHolder
drag.axis: Drag.YAxis
drag.maximumY: root.height - root.collapsedHeight
drag.minimumY: root.collapsedHeight > 0 ? root.height - root.height * 0.9 : 0
/** If drag area is released at any point other than min or max y, transition to the other state */
onReleased: {
if (root.collapsed() && placeAreaHolder.y < drag.maximumY) {
root.state = "expanded"
return
}
if (root.expanded() && placeAreaHolder.y > drag.minimumY) {
root.state = "collapsed"
return
}
}
onClicked: {
if (root.expanded()) {
collapse()
return
}
if (root.collapsed()) {
root.state = "expanded"
}
}
onExited: {
collapsedExited()
}
onEntered: {
collapsedEnter()
}
onPressedChanged: {
collapsedPressChanged()
}
}
}
}
onStateChanged: {
if (root.collapsed()) {
var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor()
if (initialPageNavigationBarColor !== 0xFF1C1D21) {
PageController.updateNavigationBarColor(initialPageNavigationBarColor)
}
if (needCloseButton) {
PageController.drawerClose()
}
drawerClosed()
return
}
if (root.expanded()) {
if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) {
PageController.updateNavigationBarColor(0xFF1C1D21)
}
if (needCloseButton) {
PageController.drawerOpen()
}
return
}
}
/** Two states of buttonContent, great place to add any future animations for the drawer */
states: [
State {
name: "collapsed"
PropertyChanges {
target: placeAreaHolder
y: dragArea.drag.maximumY
}
},
State {
name: "expanded"
PropertyChanges {
target: placeAreaHolder
y: dragArea.drag.minimumY
}
}
]
transitions: [
Transition {
from: "expanded"
to: "collapsed"
PropertyAnimation {
target: placeAreaHolder
properties: "y"
duration: 200
}
onRunningChanged: {
if (!running) {
draw2Background.color = "transparent"
fullMouseArea.visible = false
}
}
},
Transition {
from: "collapsed"
to: "expanded"
PropertyAnimation {
target: placeAreaHolder
properties: "y"
duration: 200
}
onRunningChanged: {
if (!running) {
draw2Background.color = semitransparentColor
fullMouseArea.visible = true
}
}
}
]
NumberAnimation {
id: animationVisible
target: placeAreaHolder
property: "y"
from: parent.height
to: 0
duration: 200
}
// for normal drawer
function open() {
if (root.expanded()) {
return
}
draw2Background.color = semitransparentColor
fullMouseArea.visible = true
collapsedHeight = 0
root.y = 0
root.state = "expanded"
root.visible = true
root.height = parent.height
contentArea.height = contentHeight
placeAreaHolder.y = 0
placeAreaHolder.height = root.height - contentHeight
animationVisible.running = true
}
function close() {
collapse()
}
function collapse() {
draw2Background.color = "transparent"
root.state = "collapsed"
}
// for page home
function expand() {
draw2Background.color = semitransparentColor
root.state = "expanded"
}
function expanded() {
return root.state === "expanded" ? true : false
}
function collapsed() {
return root.state === "collapsed" ? true : false
}
onVisibleChanged: {
// e.g cancel, ......
if (!visible) {
if (root.expanded()) {
if (needCloseButton) {
PageController.drawerClose()
}
close()
}
}
}
}

View File

@@ -40,10 +40,6 @@ Item {
property alias menuVisible: menu.visible
property Item drawerParent: root
property Drawer2Type menu: menu
implicitWidth: rootButtonContent.implicitWidth
implicitHeight: rootButtonContent.implicitHeight
@@ -159,26 +155,21 @@ Item {
onClicked: {
if (rootButtonClickedFunction && typeof rootButtonClickedFunction === "function") {
rootButtonClickedFunction()
} else {
menu.visible = true
}
menu.open()
}
}
Drawer2Type {
DrawerType {
id: menu
parent: drawerParent
width: parent.width
height: parent.height
contentHeight: parent.height * drawerHeight
height: parent.height * drawerHeight
ColumnLayout {
id: header
parent: menu.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -187,14 +178,12 @@ Item {
BackButtonType {
backButtonImage: root.headerBackButtonImage
backButtonFunction: function() {
menu.close()
root.menuVisible = false
}
}
}
FlickableType {
parent: menu.contentParent
anchors.top: header.bottom
anchors.topMargin: 16
contentHeight: col.implicitHeight

View File

@@ -30,13 +30,13 @@ PageType {
target: PageController
function onRestorePageHomeState(isContainerInstalled) {
buttonContent.collapse()
buttonContent.state = "expanded"
if (isContainerInstalled) {
containersDropDown.menuVisible = true
}
}
function onForceCloseDrawer() {
buttonContent.collapse()
buttonContent.state = "collapsed"
}
}
@@ -73,8 +73,14 @@ PageType {
expandedServersMenuDescription.text = description + root.defaultServerHostName
}
Component.onCompleted: {
updateDescriptions()
Component.onCompleted: updateDescriptions()
MouseArea {
anchors.fill: parent
enabled: buttonContent.state === "expanded"
onClicked: {
buttonContent.state = "collapsed"
}
}
Item {
@@ -86,10 +92,56 @@ PageType {
}
}
MouseArea {
id: dragArea
anchors.fill: buttonBackground
cursorShape: buttonContent.state === "collapsed" ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true
drag.target: buttonContent
drag.axis: Drag.YAxis
drag.maximumY: root.height - buttonContent.collapsedHeight
drag.minimumY: root.height - root.height * 0.9
/** If drag area is released at any point other than min or max y, transition to the other state */
onReleased: {
if (buttonContent.state === "collapsed" && buttonContent.y < dragArea.drag.maximumY) {
buttonContent.state = "expanded"
return
}
if (buttonContent.state === "expanded" && buttonContent.y > dragArea.drag.minimumY) {
buttonContent.state = "collapsed"
return
}
}
onEntered: {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor
collapsedButtonHeader.opacity = 0.8
}
onExited: {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 1
}
onPressedChanged: {
collapsedButtonChevron.backgroundColor = pressed ? collapsedButtonChevron.pressedColor : entered ? collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 0.7
}
onClicked: {
if (buttonContent.state === "collapsed") {
buttonContent.state = "expanded"
}
}
}
Rectangle {
id: buttonBackground
anchors { left: buttonContent.left; right: buttonContent.right; top: buttonContent.top }
anchors { left: buttonContent.left; right: buttonContent.right; top: buttonContent.top }
height: root.height
radius: 16
color: root.defaultColor
border.color: root.borderColor
@@ -105,126 +157,161 @@ PageType {
}
}
Drawer2Type {
ColumnLayout {
id: buttonContent
visible: true
fullMouseAreaVisible: false
/** Initial height of button content */
property int collapsedHeight: 0
/** True when expanded objects should be visible */
property bool expandedVisibility: buttonContent.expanded() || (buttonContent.collapsed() && buttonContent.dragActive)
property bool expandedVisibility: buttonContent.state === "expanded" || (buttonContent.state === "collapsed" && dragArea.drag.active === true)
/** True when collapsed objects should be visible */
property bool collapsedVisibility: buttonContent.collapsed() && !buttonContent.dragActive
property bool collapsedVisibility: buttonContent.state === "collapsed" && dragArea.drag.active === false
width: parent.width
height: parent.height
contentHeight: parent.height * 0.9
Drag.active: dragArea.drag.active
anchors.right: root.right
anchors.left: root.left
y: root.height - buttonContent.height
Component.onCompleted: {
buttonContent.state = "collapsed"
}
ColumnLayout {
id: collapsedButtonContent
parent: buttonContent.contentParent
visible: buttonContent.collapsedVisibility
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.top
onImplicitHeightChanged: {
if (buttonContent.collapsed() && buttonContent.collapsedHeight === 0) {
buttonContent.collapsedHeight = implicitHeight
}
}
DividerType {
Layout.topMargin: 10
Layout.fillWidth: false
Layout.preferredWidth: 20
Layout.preferredHeight: 2
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
RowLayout {
Layout.topMargin: 14
Layout.leftMargin: 24
Layout.rightMargin: 24
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Header1TextType {
id: collapsedButtonHeader
Layout.maximumWidth: root.width - 48 - 18 - 12 // todo
maximumLineCount: 2
elide: Qt.ElideRight
text: root.defaultServerName
Layout.alignment: Qt.AlignLeft
}
ImageButtonType {
id: collapsedButtonChevron
hoverEnabled: false
image: "qrc:/images/controls/chevron-down.svg"
imageColor: "#d7d8db"
horizontalPadding: 0
padding: 0
spacing: 0
Rectangle {
id: rightImageBackground
anchors.fill: parent
radius: 16
color: "transparent"
Behavior on color {
PropertyAnimation { duration: 200 }
}
}
onClicked: {
if (buttonContent.collapsed()) {
buttonContent.expand()
}
}
}
}
LabelTextType {
id: collapsedServerMenuDescription
Layout.bottomMargin: 44
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: buttonContent.collapsedVisibility
/** Set once based on first implicit height change once all children are layed out */
onImplicitHeightChanged: {
if (buttonContent.state === "collapsed" && collapsedHeight == 0) {
collapsedHeight = implicitHeight
}
}
Component.onCompleted: {
buttonContent.collapse()
onStateChanged: {
if (buttonContent.state === "collapsed") {
var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor()
if (initialPageNavigationBarColor !== 0xFF1C1D21) {
PageController.updateNavigationBarColor(initialPageNavigationBarColor)
}
PageController.drawerClose()
return
}
if (buttonContent.state === "expanded") {
if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) {
PageController.updateNavigationBarColor(0xFF1C1D21)
}
PageController.drawerOpen()
return
}
}
/** Two states of buttonContent, great place to add any future animations for the drawer */
states: [
State {
name: "collapsed"
PropertyChanges {
target: buttonContent
y: root.height - collapsedHeight
}
},
State {
name: "expanded"
PropertyChanges {
target: buttonContent
y: dragArea.drag.minimumY
}
}
]
transitions: [
Transition {
from: "collapsed"
to: "expanded"
PropertyAnimation {
target: buttonContent
properties: "y"
duration: 200
}
},
Transition {
from: "expanded"
to: "collapsed"
PropertyAnimation {
target: buttonContent
properties: "y"
duration: 200
}
}
]
DividerType {
Layout.topMargin: 10
Layout.fillWidth: false
Layout.preferredWidth: 20
Layout.preferredHeight: 2
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: (buttonContent.collapsedVisibility || buttonContent.expandedVisibility)
}
RowLayout {
Layout.topMargin: 14
Layout.leftMargin: 24
Layout.rightMargin: 24
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: buttonContent.collapsedVisibility
spacing: 0
Header1TextType {
id: collapsedButtonHeader
Layout.maximumWidth: buttonContent.width - 48 - 18 - 12 // todo
maximumLineCount: 2
elide: Qt.ElideRight
text: root.defaultServerName
horizontalAlignment: Qt.AlignHCenter
Behavior on opacity {
PropertyAnimation { duration: 200 }
}
}
ImageButtonType {
id: collapsedButtonChevron
Layout.leftMargin: 8
hoverEnabled: false
image: "qrc:/images/controls/chevron-down.svg"
imageColor: "#d7d8db"
icon.width: 18
icon.height: 18
backgroundRadius: 16
horizontalPadding: 4
topPadding: 4
bottomPadding: 3
onClicked: {
if (buttonContent.state === "collapsed") {
buttonContent.state = "expanded"
}
}
}
}
LabelTextType {
id: collapsedServerMenuDescription
Layout.bottomMargin: 44
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: buttonContent.collapsedVisibility
}
ColumnLayout {
id: serversMenuHeader
parent: buttonContent.contentParent
anchors.top: parent.top
anchors.right: parent.right
anchors.left: parent.left
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillWidth: true
visible: buttonContent.expandedVisibility
DividerType {
Layout.topMargin: 10
Layout.fillWidth: false
Layout.preferredWidth: 20
Layout.preferredHeight: 2
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
Header1TextType {
Layout.fillWidth: true
@@ -253,8 +340,6 @@ PageType {
DropDownType {
id: containersDropDown
drawerParent: root
rootButtonImageColor: "#0E0E11"
rootButtonBackgroundColor: "#D7D8DB"
rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8)
@@ -316,18 +401,12 @@ PageType {
Flickable {
id: serversContainer
parent: buttonContent.contentParent
anchors.top: serversMenuHeader.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: 16
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillWidth: true
Layout.topMargin: 16
contentHeight: col.implicitHeight
implicitHeight: root.height - (root.height * 0.1) - serversMenuHeader.implicitHeight - 52 //todo 52 is tabbar height
visible: buttonContent.expandedVisibility
clip: true
ScrollBar.vertical: ScrollBar {
@@ -437,7 +516,7 @@ PageType {
onClicked: function() {
ServersModel.currentlyProcessedIndex = index
PageController.goToPage(PageEnum.PageSettingsServerInfo)
buttonContent.collapse()
buttonContent.state = "collapsed"
}
}
}
@@ -452,22 +531,5 @@ PageType {
}
}
}
onCollapsedEnter: {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor
collapsedButtonHeader.opacity = 0.8
}
onCollapsedExited: {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 1
}
onCollapsedPressChanged: {
collapsedButtonChevron.backgroundColor = buttonContent.drawerDragArea.pressed ?
collapsedButtonChevron.pressedColor : buttonContent.drawerDragArea.entered ?
collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 0.7
}
}
}

View File

@@ -276,7 +276,7 @@ PageType {
onClicked: {
questionDrawer.headerText = qsTr("Remove AmneziaWG from server?")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")

View File

@@ -117,8 +117,6 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
drawerParent: root
descriptionText: qsTr("Cipher")
headerText: qsTr("Cipher")

View File

@@ -157,8 +157,6 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 20
drawerParent: root
enabled: !autoNegotiateEncryprionSwitcher.checked
descriptionText: qsTr("Hash")
@@ -205,8 +203,6 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
drawerParent: root
enabled: !autoNegotiateEncryprionSwitcher.checked
descriptionText: qsTr("Cipher")
@@ -369,19 +365,19 @@ PageType {
onClicked: {
questionDrawer.headerText = qsTr("Remove OpenVpn from server?")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
@@ -406,7 +402,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -90,19 +90,15 @@ PageType {
DividerType {}
Drawer2Type {
DrawerType {
id: configContentDrawer
parent: root
width: parent.width
height: parent.height
contentHeight: parent.height * 0.9
height: parent.height * 0.9
BackButtonType {
id: backButton
parent: configContentDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -180,19 +176,19 @@ PageType {
clickedFunction: function() {
questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName())
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
MouseArea {
@@ -207,7 +203,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -95,8 +95,6 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 20
drawerParent: root
descriptionText: qsTr("Cipher")
headerText: qsTr("Cipher")

View File

@@ -68,14 +68,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
MouseArea {
@@ -89,7 +89,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -253,14 +253,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
}
@@ -270,7 +270,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -131,21 +131,20 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
}
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -119,7 +119,6 @@ PageType {
SelectLanguageDrawer {
id: selectLanguageDrawer
parent: root
}
@@ -152,14 +151,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
SettingsController.clearSettings()
PageController.replaceStartPage()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
@@ -167,7 +166,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -139,19 +139,18 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.showBusyIndicator(true)
SettingsController.restoreAppConfig(filePath)
PageController.showBusyIndicator(false)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
QuestionDrawer {
id: questionDrawer
parent: root
}
}

View File

@@ -92,7 +92,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
SettingsController.primaryDns = "1.1.1.1"
primaryDns.textFieldText = SettingsController.primaryDns
SettingsController.secondaryDns = "1.0.0.1"
@@ -100,9 +100,9 @@ PageType {
PageController.showNotificationMessage(qsTr("Settings have been reset"))
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
@@ -124,7 +124,6 @@ PageType {
}
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -147,16 +147,16 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.showBusyIndicator(true)
SettingsController.clearLogs()
PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs have been cleaned up"))
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
@@ -172,7 +172,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -14,8 +14,6 @@ import "../Components"
PageType {
id: root
property Item questionDrawerParent
Connections {
target: InstallController
@@ -96,15 +94,15 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.showBusyIndicator(true)
SettingsController.clearCachedProfiles()
PageController.showBusyIndicator(false)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
@@ -143,7 +141,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.showBusyIndicator(true)
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
ConnectionController.closeConnection()
@@ -152,9 +150,9 @@ PageType {
PageController.showBusyIndicator(false)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
@@ -174,7 +172,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling)
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
ConnectionController.closeConnection()
@@ -182,9 +180,9 @@ PageType {
InstallController.removeAllContainers()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
@@ -194,10 +192,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
drawerHeight: 0.5
parent: questionDrawerParent
}
}
}

View File

@@ -71,17 +71,15 @@ PageType {
}
actionButtonFunction: function() {
serverNameEditDrawer.open()
serverNameEditDrawer.visible = true
}
}
Drawer2Type {
DrawerType {
id: serverNameEditDrawer
parent: root
width: root.width
height: root.height // * 0.35
contentHeight: root.height * 0.35
height: root.height * 0.35
onVisibleChanged: {
if (serverNameEditDrawer.visible) {
@@ -90,8 +88,6 @@ PageType {
}
ColumnLayout {
parent: serverNameEditDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -99,7 +95,6 @@ PageType {
anchors.leftMargin: 16
anchors.rightMargin: 16
TextFieldWithHeaderType {
id: serverName
@@ -169,7 +164,6 @@ PageType {
}
PageSettingsServerData {
stackView: root.stackView
questionDrawerParent: root
}
}
}

View File

@@ -114,19 +114,19 @@ PageType {
clickedFunction: function() {
questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName())
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
MouseArea {
@@ -141,7 +141,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}

View File

@@ -93,22 +93,15 @@ PageType {
SwitcherType {
id: switcher
property int lastActiveRouteMode: routeMode.onlyForwardSites
enabled: root.pageEnabled
Layout.fillWidth: true
Layout.rightMargin: 16
checked: SitesModel.routeMode !== routeMode.allSites
onToggled: {
if (checked) {
SitesModel.routeMode = lastActiveRouteMode
} else {
lastActiveRouteMode = SitesModel.routeMode
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
SitesModel.routeMode = routeMode.allSites
}
checked: SitesModel.isSplitTunnelingEnabled()
onToggled: {
SitesModel.toggleSplitTunneling(checked)
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
}
}
}
@@ -116,8 +109,6 @@ PageType {
DropDownType {
id: selector
drawerParent: root
Layout.fillWidth: true
Layout.topMargin: 32
Layout.leftMargin: 16
@@ -125,7 +116,7 @@ PageType {
drawerHeight: 0.4375
enabled: switcher.checked && root.pageEnabled
enabled: root.pageEnabled
headerText: qsTr("Mode")
@@ -167,7 +158,7 @@ PageType {
anchors.topMargin: 16
contentHeight: col.implicitHeight + addSiteButton.implicitHeight + addSiteButton.anchors.bottomMargin + addSiteButton.anchors.topMargin
enabled: switcher.checked && root.pageEnabled
enabled: root.pageEnabled
Column {
id: col
@@ -210,13 +201,13 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
SitesController.removeSite(index)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
questionDrawer.visible = false
}
questionDrawer.open()
questionDrawer.visible = true
}
}
@@ -224,7 +215,6 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -279,18 +269,13 @@ PageType {
}
}
Drawer2Type {
DrawerType {
id: moreActionsDrawer
width: parent.width
height: parent.height
contentHeight: parent.height * 0.4375
parent: root
height: parent.height * 0.4375
FlickableType {
parent: moreActionsDrawer.contentParent
anchors.fill: parent
contentHeight: moreActionsDrawerContent.height
ColumnLayout {
@@ -349,20 +334,15 @@ PageType {
}
}
Drawer2Type {
DrawerType {
id: importSitesDrawer
width: parent.width
height: parent.height
contentHeight: parent.height * 0.4375
parent: root
height: parent.height * 0.4375
BackButtonType {
id: importSitesDrawerBackButton
parent: importSitesDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -374,8 +354,6 @@ PageType {
}
FlickableType {
parent: importSitesDrawer.contentParent
anchors.top: importSitesDrawerBackButton.bottom
anchors.left: parent.left
anchors.right: parent.right

View File

@@ -25,7 +25,7 @@ PageType {
function onInstallContainerFinished(finishedMessage, isServiceInstall) {
if (!ConnectionController.isConnected && !isServiceInstall) {
ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex)
ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex())
}
PageController.goToStartPage()

View File

@@ -97,20 +97,15 @@ PageType {
}
}
Drawer2Type {
DrawerType {
id: showDetailsDrawer
width: parent.width
height: parent.height
contentHeight: parent.height * 0.9
parent: root
height: parent.height * 0.9
BackButtonType {
id: showDetailsBackButton
parent: showDetailsDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -122,8 +117,6 @@ PageType {
}
FlickableType {
parent: showDetailsDrawer.contentParent
anchors.top: showDetailsBackButton.bottom
anchors.left: parent.left
anchors.right: parent.right

View File

@@ -115,7 +115,7 @@ PageType {
text: qsTr("I have the data to connect")
onClicked: {
connectionTypeSelection.open()
connectionTypeSelection.visible = true
}
}
@@ -134,13 +134,12 @@ PageType {
text: qsTr("I have nothing")
onClicked: Qt.openUrlExternally("https://ru-docs.amnezia.org/guides/hosting-instructions")
onClicked: Qt.openUrlExternally("https://amnezia.org/instructions/0_starter-guide")
}
}
ConnectionTypeSelectionDrawer {
id: connectionTypeSelection
parent: root
}
}

View File

@@ -118,7 +118,7 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 24
headerText: qsTr("VPN Access")
headerText: qsTr("Share VPN Access")
}
Rectangle {
@@ -171,16 +171,14 @@ PageType {
Layout.topMargin: 24
Layout.bottomMargin: 24
text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") :
qsTr("Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings.")
text: accessTypeSelector.currentIndex === 0 ? qsTr("Share VPN access without the ability to manage the server") :
qsTr("Share access to server management. The user with whom you share full access to the server will be able to add and remove any protocols and services to the server, as well as change settings.")
color: "#878B91"
}
DropDownType {
id: serverSelector
drawerParent: root
signal severSelectorIndexChanged
property int currentIndex: 0
@@ -243,8 +241,6 @@ PageType {
DropDownType {
id: protocolSelector
drawerParent: root
visible: accessTypeSelector.currentIndex === 0
Layout.fillWidth: true
@@ -334,8 +330,6 @@ PageType {
DropDownType {
id: exportTypeSelector
drawerParent: root
property int currentIndex: 0
Layout.fillWidth: true
@@ -377,7 +371,6 @@ PageType {
ShareConnectionDrawer {
id: shareConnectionDrawer
parent: root
}
BasicButtonType {

View File

@@ -135,8 +135,6 @@ PageType {
var pagePath = PageController.getPagePath(PageEnum.PageHome)
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
tabBarStackView.push(pagePath, { "objectName" : pagePath })
connectionTypeSelection.parent = tabBarStackView
}
// onWidthChanged: {
@@ -176,12 +174,6 @@ PageType {
strokeColor: "#2C2D30"
fillColor: "#1C1D21"
}
MouseArea {
id: noPropagateMouseEvent
anchors.fill: parent
enabled: true
}
}
TabImageButtonType {
@@ -252,9 +244,7 @@ PageType {
ConnectionTypeSelectionDrawer {
id: connectionTypeSelection
z: 1
onDrawerClosed: {
onAboutToHide: {
tabBar.setCurrentIndex(tabBar.previousIndex)
}
}