Compare commits

..

5 Commits

Author SHA1 Message Date
vladimir.kuznetsov 25785bfe74 added color behavior for drawer 2023-10-23 14:27:08 +05:00
pokamest 89cf03ca26 Merge pull request #388 from amnezia-vpn/bugfix/updated_drawer_height_pageserverdata
updated drawer height of PageSettingsServerData
2023-10-21 06:23:35 -07:00
pokamest 74da944c68 Merge pull request #389 from amnezia-vpn/bugfix/adapted_awg_questiondrawer
adapted awg-questiondrawer with drawer2type
2023-10-21 06:22:44 -07:00
ronoaer e6ecfaf171 adapted awg-questiondrawer with drawer2type 2023-10-21 16:11:54 +08:00
ronoaer 9d2b01ef48 updated drawer height of PageSettingsServerData 2023-10-21 10:34:45 +08:00
39 changed files with 756 additions and 491 deletions
+8 -11
View File
@@ -139,8 +139,7 @@ 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));
@@ -227,13 +226,14 @@ 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,13 +297,11 @@ 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_containersModel->getDefaultContainer() == DockerContainer::Awg)
&& m_sitesModel->isSplitTunnelingEnabled()) {
m_sitesModel->toggleSplitTunneling(false);
if (m_containersModel->getDefaultContainer() == DockerContainer::WireGuard
&& m_sitesModel->getRouteMode() != Settings::RouteMode::VpnAllSites) {
m_sitesModel->setRouteMode(Settings::RouteMode::VpnAllSites);
emit m_pageController->showNotificationMessage(
tr("Split tunneling for %1 is not implemented, the option was disabled")
.arg(ContainerProps::containerHumanNames().value(m_containersModel->getDefaultContainer())));
tr("Split tunneling for WireGuard is not implemented, the option was disabled"));
}
});
@@ -339,8 +337,7 @@ 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());
+26 -14
View File
@@ -17,31 +17,43 @@ 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();
QMap<QString, QString> configMap;
auto configLines = awgConfig.split("\n");
for (auto &line : configLines) {
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) {
auto trimmedLine = line.trimmed();
if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) {
continue;
} else {
QStringList parts = trimmedLine.split(" = ");
if (parts.count() == 2) {
configMap.insert(parts[0].trimmed(), parts[1].trimmed());
serverConfigMap.insert(parts[0].trimmed(), parts[1].trimmed());
}
}
}
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);
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);
return QJsonDocument(jsonConfig).toJson();
}
-28
View File
@@ -834,34 +834,6 @@ 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);
+1
View File
@@ -216,6 +216,7 @@
<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>
+36 -68
View File
@@ -4,13 +4,9 @@
<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 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>
<translation>Раздельное туннелирование для &quot;Wireguard&quot; не реализовано,опция отключена</translation>
</message>
</context>
<context>
@@ -124,7 +120,7 @@
<message>
<location filename="../ui/qml/Components/HomeContainersListView.qml" line="58"/>
<source>Unable change protocol while there is an active connection</source>
<translation>Невозможно изменить протокол при активном соединении</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Components/HomeContainersListView.qml" line="69"/>
@@ -278,7 +274,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>Невозможно изменить сервер при активном соединении</translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -350,12 +346,8 @@ 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>Все пользователи, с которыми вы поделились этим 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>
<translation>Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolAwgSettings.qml" line="280"/>
@@ -412,7 +404,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"/>
@@ -579,12 +571,8 @@ 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>Все пользователи, с которыми вы поделились этим 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>
<translation>Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolOpenVpnSettings.qml" line="369"/>
@@ -631,12 +619,8 @@ 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="obsolete">Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
<translation type="unfinished">Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolRaw.qml" line="180"/>
@@ -1148,7 +1132,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"/>
@@ -1294,7 +1278,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"/>
@@ -1456,12 +1440,8 @@ 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 type="vanished">Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться.</translation>
<translation>Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsServerProtocol.qml" line="118"/>
@@ -1500,75 +1480,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="121"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="128"/>
<source>Mode</source>
<translation>Режим</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="199"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="206"/>
<source>Remove </source>
<translation>Удалить </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="200"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="207"/>
<source>Continue</source>
<translation>Продолжить</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="201"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="208"/>
<source>Cancel</source>
<translation>Отменить</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="248"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="255"/>
<source>Site or IP</source>
<translation>Сайт или IP</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="292"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="299"/>
<source>Import/Export Sites</source>
<translation>Импорт/экспорт Сайтов</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="298"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="305"/>
<source>Import</source>
<translation>Импорт</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="310"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="317"/>
<source>Save site list</source>
<translation>Сохранить список сайтов</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="317"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="324"/>
<source>Save sites</source>
<translation>Сохранить</translation>
</message>
<message>
<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"/>
<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"/>
<source>Sites files (*.json)</source>
<translation>Sites files (*.json)</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="375"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="382"/>
<source>Import a list of sites</source>
<translation>Импортировать список с сайтами</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="381"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="388"/>
<source>Replace site list</source>
<translation>Заменить список сайтов</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="384"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="399"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="391"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="406"/>
<source>Open sites file</source>
<translation>Открыть список с сайтами</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="396"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="403"/>
<source>Add imported sites to existing ones</source>
<translation>Добавить импортированные сайты к существующим</translation>
</message>
@@ -1904,8 +1884,9 @@ 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 type="vanished">VPN-Доступ</translation>
<translation>VPN-Доступ</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="146"/>
@@ -1913,12 +1894,14 @@ 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 type="vanished">Доступ к VPN, без возможности управления сервером</translation>
<translation>Доступ к 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 type="vanished">Доступ к управлению сервером. Пользователь, с которым вы делитесь полным доступом к соединению, сможет добавлять и удалять ваши протоколы и службы на сервере, а также изменять настройки.</translation>
<translation>Доступ к управлению сервером. Пользователь, с которым вы делитесь полным доступом к соединению, сможет добавлять и удалять ваши протоколы и службы на сервере, а также изменять настройки.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="190"/>
@@ -1961,26 +1944,11 @@ 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"/>
@@ -2603,9 +2571,9 @@ OpenVPN обеспечивает безопасное VPN-соединение
Cloak защищает OpenVPN от обнаружения и блокировок.
Cloak может изменять метаданные пакетов. Он полностью маскирует VPN-трафик под обычный веб-трафик, а также защищает VPN от обнаружения с помощью Active Probing. Это делает его очень устойчивым к обнаружению
Cloak может изменять метаданные пакетов. Он полностью маскирует VPN-трафик под обычный веб-трафик, а также защищает VPN от обнаружения с помощью Active Probing. Это делает ее очень устойчивой к обнаружению
Сразу же после получения первого пакета данных Cloak проверяет подлинность входящего соединения. Если аутентификация не проходит, плагин маскирует сервер под поддельный сайт, и ваш VPN становится невидимым для аналитических систем.
Сразу же после получения первого пакета данных Cloak проверяет подлинность входящего соединения. Если аутентификация не проходит, плагин маскирует сервер под поддельный сайт, и ваша VPN становится невидимой для аналитических систем.
Если в вашем регионе существует экстремальный уровень цензуры в Интернете, мы советуем вам при первом подключении использовать только OpenVPN через Cloak
+29 -61
View File
@@ -4,13 +4,9 @@
<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 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>
<translation>未启用选项,还未实现基于WireGuard协议的VPN分离</translation>
</message>
</context>
<context>
@@ -135,7 +131,7 @@
<message>
<location filename="../ui/qml/Components/HomeContainersListView.qml" line="58"/>
<source>Unable change protocol while there is an active connection</source>
<translation>已建立连接时无法更改服务器配置</translation>
<translation type="unfinished">已建立连接时无法更改服务器配置</translation>
</message>
<message>
<location filename="../ui/qml/Components/HomeContainersListView.qml" line="69"/>
@@ -384,12 +380,8 @@ 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 type="vanished">使用此共享连接的所有用户,将无法再连接它。</translation>
<translation>使用此共享连接的所有用户,将无法再连接它。</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageProtocolAwgSettings.qml" line="280"/>
@@ -613,12 +605,8 @@ 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 type="vanished">使用此共享连接的所有用户,将无法再连接它。</translation>
<translation>使用此共享连接的所有用户,将无法再连接它。</translation>
</message>
<message>
<source>All users with whom you shared a connection will no longer be able to connect to it</source>
@@ -673,12 +661,8 @@ 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 type="vanished">使用此共享连接的所有用户,将无法再连接它。</translation>
<translation>使用此共享连接的所有用户,将无法再连接它。</translation>
</message>
<message>
<source> from server?</source>
@@ -1537,12 +1521,8 @@ 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 type="vanished">使用此共享连接的所有用户,将无法再连接它。</translation>
<translation>使用此共享连接的所有用户,将无法再连接它。</translation>
</message>
<message>
<source> from server?</source>
@@ -1606,75 +1586,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="121"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="128"/>
<source>Mode</source>
<translation>规则</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="199"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="206"/>
<source>Remove </source>
<translation>移除 </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="200"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="207"/>
<source>Continue</source>
<translation>继续</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="201"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="208"/>
<source>Cancel</source>
<translation>取消</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="248"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="255"/>
<source>Site or IP</source>
<translation>网站或IP地址</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="292"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="299"/>
<source>Import/Export Sites</source>
<translation>导入/导出网站</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="298"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="305"/>
<source>Import</source>
<translation>导入</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="310"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="317"/>
<source>Save site list</source>
<translation>保存网址</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="317"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="324"/>
<source>Save sites</source>
<translation>保存网址</translation>
</message>
<message>
<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"/>
<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"/>
<source>Sites files (*.json)</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="375"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="382"/>
<source>Import a list of sites</source>
<translation>导入网址列表</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="381"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="388"/>
<source>Replace site list</source>
<translation>替换网址列表</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="384"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="399"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="391"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="406"/>
<source>Open sites file</source>
<translation>打开网址文件</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="396"/>
<location filename="../ui/qml/Pages2/PageSettingsSplitTunneling.qml" line="403"/>
<source>Add imported sites to existing ones</source>
<translation>将导入的网址添加到现有网址中</translation>
</message>
@@ -2026,22 +2006,8 @@ 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 type="vanished">访问VPN</translation>
<translation>访问VPN</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="146"/>
@@ -2054,12 +2020,14 @@ 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 type="vanished">访问VPN,但没有权限管理服务。</translation>
<translation>访问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 type="vanished">除访问VPN外,用户还能添加和删除协议、服务以及更改配置信息</translation>
<translation>除访问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>
+1 -2
View File
@@ -117,9 +117,8 @@ QString ContainersModel::getDefaultContainerName()
return ContainerProps::containerHumanNames().value(m_defaultContainerIndex);
}
void ContainersModel::setDefaultContainer(int index)
void ContainersModel::setDefaultContainer(DockerContainer container)
{
auto container = static_cast<DockerContainer>(index);
m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container);
m_defaultContainerIndex = container;
emit defaultContainerChanged();
+1 -1
View File
@@ -46,7 +46,7 @@ public:
public slots:
DockerContainer getDefaultContainer();
QString getDefaultContainerName();
void setDefaultContainer(int index);
void setDefaultContainer(DockerContainer container);
void setCurrentlyProcessedServerIndex(const int index);
+1 -23
View File
@@ -3,14 +3,7 @@
SitesModel::SitesModel(std::shared_ptr<Settings> settings, QObject *parent)
: QAbstractListModel(parent), m_settings(settings)
{
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;
}
m_currentRouteMode = m_settings->routeMode();
fillSites();
}
@@ -100,21 +93,6 @@ 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;
-4
View File
@@ -31,9 +31,6 @@ public slots:
int getRouteMode();
void setRouteMode(int routeMode);
bool isSplitTunnelingEnabled();
void toggleSplitTunneling(bool enabled);
QVector<QPair<QString, QString>> getCurrentSites();
signals:
@@ -47,7 +44,6 @@ private:
std::shared_ptr<Settings> m_settings;
bool m_isSplitTunnelingEnabled;
Settings::RouteMode m_currentRouteMode;
QVector<QPair<QString, QString>> m_sites;
@@ -8,13 +8,16 @@ import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
DrawerType {
Drawer2Type {
id: root
width: parent.width
height: parent.height * 0.4375
height: parent.height
contentHeight: parent.height * 0.4375
ColumnLayout {
parent: root.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -63,7 +63,7 @@ ListView {
isDefault = true
menuContent.currentIndex = index
containersDropDown.menuVisible = false
containersDropDown.menu.close()
} else {
if (!isSupported && isInstalled) {
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
+7 -3
View File
@@ -5,7 +5,7 @@ import QtQuick.Layouts
import "../Controls2"
import "../Controls2/TextTypes"
DrawerType {
Drawer2Type {
id: root
property string headerText
@@ -15,12 +15,14 @@ DrawerType {
property var yesButtonFunction
property var noButtonFunction
property real drawerHeight: 0.5
width: parent.width
height: content.implicitHeight + 32
height: parent.height
contentHeight: parent.height * drawerHeight
ColumnLayout {
id: content
parent: root.contentParent
anchors.top: parent.top
anchors.left: parent.left
@@ -29,6 +31,8 @@ DrawerType {
anchors.rightMargin: 16
anchors.leftMargin: 16
// visible: false
spacing: 8
Header2TextType {
@@ -5,15 +5,18 @@ import QtQuick.Layouts
import "../Controls2"
import "../Controls2/TextTypes"
DrawerType {
Drawer2Type {
id: root
width: parent.width
height: parent.height * 0.9
height: parent.height
contentHeight: parent.height * 0.9
ColumnLayout {
id: backButton
parent: root.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -28,6 +31,7 @@ DrawerType {
}
FlickableType {
parent: root.contentParent
anchors.top: backButton.bottom
anchors.left: parent.left
anchors.right: parent.right
@@ -16,7 +16,7 @@ import "../Controls2/TextTypes"
import "../Config"
import "../Components"
DrawerType {
Drawer2Type {
id: root
property alias headerText: header.headerText
@@ -28,9 +28,10 @@ DrawerType {
property string configFileName: "amnezia_config.vpn"
width: parent.width
height: parent.height * 0.9
height: parent.height
contentHeight: parent.height * 0.9
onClosed: {
onDrawerClosed: {
configExtension = ".vpn"
configCaption = qsTr("Save AmneziaVPN config")
configFileName = "amnezia_config"
@@ -41,6 +42,9 @@ DrawerType {
Header2Type {
id: header
parent: root.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -50,6 +54,8 @@ DrawerType {
}
FlickableType {
parent: root.contentParent
anchors.top: header.bottom
anchors.bottom: parent.bottom
contentHeight: content.height + 32
@@ -126,30 +132,37 @@ DrawerType {
text: qsTr("Show connection settings")
onClicked: {
configContentDrawer.visible = true
configContentDrawer.open()
}
}
DrawerType {
Drawer2Type {
id: configContentDrawer
parent: root
width: parent.width
height: parent.height * 0.9
height: parent.height
contentHeight: 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.visible = false
configContentDrawer.close()
}
}
FlickableType {
parent: configContentDrawer.contentParent
anchors.top: backButton.bottom
anchors.left: parent.left
anchors.right: parent.right
+318
View File
@@ -0,0 +1,318 @@
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
Behavior on color {
PropertyAnimation { duration: 200 }
}
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()
}
}
}
}
+16 -5
View File
@@ -40,6 +40,10 @@ Item {
property alias menuVisible: menu.visible
property Item drawerParent: root
property Drawer2Type menu: menu
implicitWidth: rootButtonContent.implicitWidth
implicitHeight: rootButtonContent.implicitHeight
@@ -155,21 +159,26 @@ Item {
onClicked: {
if (rootButtonClickedFunction && typeof rootButtonClickedFunction === "function") {
rootButtonClickedFunction()
} else {
menu.visible = true
}
menu.open()
}
}
DrawerType {
Drawer2Type {
id: menu
parent: drawerParent
width: parent.width
height: parent.height * drawerHeight
height: parent.height
contentHeight: parent.height * drawerHeight
ColumnLayout {
id: header
parent: menu.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -178,12 +187,14 @@ Item {
BackButtonType {
backButtonImage: root.headerBackButtonImage
backButtonFunction: function() {
root.menuVisible = false
menu.close()
}
}
}
FlickableType {
parent: menu.contentParent
anchors.top: header.bottom
anchors.topMargin: 16
contentHeight: col.implicitHeight
+125 -187
View File
@@ -30,13 +30,13 @@ PageType {
target: PageController
function onRestorePageHomeState(isContainerInstalled) {
buttonContent.state = "expanded"
buttonContent.collapse()
if (isContainerInstalled) {
containersDropDown.menuVisible = true
}
}
function onForceCloseDrawer() {
buttonContent.state = "collapsed"
buttonContent.collapse()
}
}
@@ -73,14 +73,8 @@ PageType {
expandedServersMenuDescription.text = description + root.defaultServerHostName
}
Component.onCompleted: updateDescriptions()
MouseArea {
anchors.fill: parent
enabled: buttonContent.state === "expanded"
onClicked: {
buttonContent.state = "collapsed"
}
Component.onCompleted: {
updateDescriptions()
}
Item {
@@ -92,56 +86,10 @@ 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 }
height: root.height
radius: 16
color: root.defaultColor
border.color: root.borderColor
@@ -157,161 +105,126 @@ PageType {
}
}
ColumnLayout {
Drawer2Type {
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.state === "expanded" || (buttonContent.state === "collapsed" && dragArea.drag.active === true)
property bool expandedVisibility: buttonContent.expanded() || (buttonContent.collapsed() && buttonContent.dragActive)
/** True when collapsed objects should be visible */
property bool collapsedVisibility: buttonContent.state === "collapsed" && dragArea.drag.active === false
property bool collapsedVisibility: buttonContent.collapsed() && !buttonContent.dragActive
Drag.active: dragArea.drag.active
anchors.right: root.right
anchors.left: root.left
y: root.height - buttonContent.height
width: parent.width
height: parent.height
contentHeight: parent.height * 0.9
Component.onCompleted: {
buttonContent.state = "collapsed"
}
/** Set once based on first implicit height change once all children are layed out */
onImplicitHeightChanged: {
if (buttonContent.state === "collapsed" && collapsedHeight == 0) {
collapsedHeight = implicitHeight
}
}
ColumnLayout {
id: collapsedButtonContent
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
}
}
parent: buttonContent.contentParent
/** 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
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.top
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 }
onImplicitHeightChanged: {
if (buttonContent.collapsed() && buttonContent.collapsedHeight === 0) {
buttonContent.collapsedHeight = implicitHeight
}
}
ImageButtonType {
id: collapsedButtonChevron
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
Layout.leftMargin: 8
Header1TextType {
id: collapsedButtonHeader
Layout.maximumWidth: root.width - 48 - 18 - 12 // todo
hoverEnabled: false
image: "qrc:/images/controls/chevron-down.svg"
imageColor: "#d7d8db"
maximumLineCount: 2
elide: Qt.ElideRight
icon.width: 18
icon.height: 18
backgroundRadius: 16
horizontalPadding: 4
topPadding: 4
bottomPadding: 3
text: root.defaultServerName
onClicked: {
if (buttonContent.state === "collapsed") {
buttonContent.state = "expanded"
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
}
}
LabelTextType {
id: collapsedServerMenuDescription
Layout.bottomMargin: 44
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: buttonContent.collapsedVisibility
Component.onCompleted: {
buttonContent.collapse()
}
ColumnLayout {
id: serversMenuHeader
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillWidth: true
parent: buttonContent.contentParent
anchors.top: parent.top
anchors.right: parent.right
anchors.left: parent.left
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
@@ -340,6 +253,8 @@ PageType {
DropDownType {
id: containersDropDown
drawerParent: root
rootButtonImageColor: "#0E0E11"
rootButtonBackgroundColor: "#D7D8DB"
rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8)
@@ -401,12 +316,18 @@ PageType {
Flickable {
id: serversContainer
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillWidth: true
Layout.topMargin: 16
parent: buttonContent.contentParent
anchors.top: serversMenuHeader.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.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 {
@@ -516,7 +437,7 @@ PageType {
onClicked: function() {
ServersModel.currentlyProcessedIndex = index
PageController.goToPage(PageEnum.PageSettingsServerInfo)
buttonContent.state = "collapsed"
buttonContent.collapse()
}
}
}
@@ -531,5 +452,22 @@ 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
}
}
}
@@ -276,7 +276,7 @@ PageType {
onClicked: {
questionDrawer.headerText = qsTr("Remove AmneziaWG from server?")
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
@@ -286,9 +286,9 @@ PageType {
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -324,6 +324,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -117,6 +117,8 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
drawerParent: root
descriptionText: qsTr("Cipher")
headerText: qsTr("Cipher")
@@ -157,6 +157,8 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 20
drawerParent: root
enabled: !autoNegotiateEncryprionSwitcher.checked
descriptionText: qsTr("Hash")
@@ -203,6 +205,8 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
drawerParent: root
enabled: !autoNegotiateEncryprionSwitcher.checked
descriptionText: qsTr("Cipher")
@@ -365,19 +369,19 @@ PageType {
onClicked: {
questionDrawer.headerText = qsTr("Remove OpenVpn from server?")
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -402,6 +406,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
+11 -6
View File
@@ -90,15 +90,19 @@ PageType {
DividerType {}
DrawerType {
Drawer2Type {
id: configContentDrawer
parent: root
width: parent.width
height: parent.height * 0.9
height: parent.height
contentHeight: parent.height * 0.9
BackButtonType {
id: backButton
parent: configContentDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -176,19 +180,19 @@ PageType {
clickedFunction: function() {
questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName())
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
MouseArea {
@@ -203,6 +207,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -95,6 +95,8 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 20
drawerParent: root
descriptionText: qsTr("Cipher")
headerText: qsTr("Cipher")
@@ -68,14 +68,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
MouseArea {
@@ -89,6 +89,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -253,14 +253,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
}
@@ -270,6 +270,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -131,20 +131,21 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
}
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -119,6 +119,7 @@ PageType {
SelectLanguageDrawer {
id: selectLanguageDrawer
parent: root
}
@@ -151,14 +152,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
SettingsController.clearSettings()
PageController.replaceStartPage()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -166,6 +167,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
+4 -3
View File
@@ -139,18 +139,19 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.showBusyIndicator(true)
SettingsController.restoreAppConfig(filePath)
PageController.showBusyIndicator(false)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
QuestionDrawer {
id: questionDrawer
parent: root
}
}
+4 -3
View File
@@ -92,7 +92,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
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.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -124,6 +124,7 @@ PageType {
}
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
+4 -3
View File
@@ -147,16 +147,16 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.showBusyIndicator(true)
SettingsController.clearLogs()
PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs have been cleaned up"))
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -172,6 +172,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -14,6 +14,8 @@ import "../Components"
PageType {
id: root
property Item questionDrawerParent
Connections {
target: InstallController
@@ -94,15 +96,15 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.showBusyIndicator(true)
SettingsController.clearCachedProfiles()
PageController.showBusyIndicator(false)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -141,7 +143,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.showBusyIndicator(true)
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
ConnectionController.closeConnection()
@@ -150,9 +152,9 @@ PageType {
PageController.showBusyIndicator(false)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -172,7 +174,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling)
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
ConnectionController.closeConnection()
@@ -180,9 +182,9 @@ PageType {
InstallController.removeAllContainers()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -192,6 +194,10 @@ PageType {
QuestionDrawer {
id: questionDrawer
drawerHeight: 0.6
parent: questionDrawerParent
}
}
}
@@ -71,15 +71,17 @@ PageType {
}
actionButtonFunction: function() {
serverNameEditDrawer.visible = true
serverNameEditDrawer.open()
}
}
DrawerType {
Drawer2Type {
id: serverNameEditDrawer
parent: root
width: root.width
height: root.height * 0.35
height: root.height // * 0.35
contentHeight: root.height * 0.35
onVisibleChanged: {
if (serverNameEditDrawer.visible) {
@@ -88,6 +90,8 @@ PageType {
}
ColumnLayout {
parent: serverNameEditDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -95,6 +99,7 @@ PageType {
anchors.leftMargin: 16
anchors.rightMargin: 16
TextFieldWithHeaderType {
id: serverName
@@ -164,6 +169,7 @@ PageType {
}
PageSettingsServerData {
stackView: root.stackView
questionDrawerParent: root
}
}
}
@@ -114,19 +114,19 @@ PageType {
clickedFunction: function() {
questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName())
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer()
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
MouseArea {
@@ -141,6 +141,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -93,15 +93,22 @@ PageType {
SwitcherType {
id: switcher
property int lastActiveRouteMode: routeMode.onlyForwardSites
enabled: root.pageEnabled
Layout.fillWidth: true
Layout.rightMargin: 16
checked: SitesModel.isSplitTunnelingEnabled()
onToggled: {
SitesModel.toggleSplitTunneling(checked)
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
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
}
}
}
}
@@ -109,6 +116,8 @@ PageType {
DropDownType {
id: selector
drawerParent: root
Layout.fillWidth: true
Layout.topMargin: 32
Layout.leftMargin: 16
@@ -116,7 +125,7 @@ PageType {
drawerHeight: 0.4375
enabled: root.pageEnabled
enabled: switcher.checked && root.pageEnabled
headerText: qsTr("Mode")
@@ -158,7 +167,7 @@ PageType {
anchors.topMargin: 16
contentHeight: col.implicitHeight + addSiteButton.implicitHeight + addSiteButton.anchors.bottomMargin + addSiteButton.anchors.topMargin
enabled: root.pageEnabled
enabled: switcher.checked && root.pageEnabled
Column {
id: col
@@ -201,13 +210,13 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
SitesController.removeSite(index)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
questionDrawer.close()
}
questionDrawer.visible = true
questionDrawer.open()
}
}
@@ -215,6 +224,7 @@ PageType {
QuestionDrawer {
id: questionDrawer
parent: root
}
}
}
@@ -269,13 +279,18 @@ PageType {
}
}
DrawerType {
Drawer2Type {
id: moreActionsDrawer
width: parent.width
height: parent.height * 0.4375
height: parent.height
contentHeight: parent.height * 0.4375
parent: root
FlickableType {
parent: moreActionsDrawer.contentParent
anchors.fill: parent
contentHeight: moreActionsDrawerContent.height
ColumnLayout {
@@ -334,15 +349,20 @@ PageType {
}
}
DrawerType {
Drawer2Type {
id: importSitesDrawer
width: parent.width
height: parent.height * 0.4375
height: parent.height
contentHeight: parent.height * 0.4375
parent: root
BackButtonType {
id: importSitesDrawerBackButton
parent: importSitesDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -354,6 +374,8 @@ PageType {
}
FlickableType {
parent: importSitesDrawer.contentParent
anchors.top: importSitesDrawerBackButton.bottom
anchors.left: parent.left
anchors.right: parent.right
@@ -25,7 +25,7 @@ PageType {
function onInstallContainerFinished(finishedMessage, isServiceInstall) {
if (!ConnectionController.isConnected && !isServiceInstall) {
ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex())
ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex)
}
PageController.goToStartPage()
@@ -97,15 +97,20 @@ PageType {
}
}
DrawerType {
Drawer2Type {
id: showDetailsDrawer
width: parent.width
height: parent.height * 0.9
height: parent.height
contentHeight: parent.height * 0.9
parent: root
BackButtonType {
id: showDetailsBackButton
parent: showDetailsDrawer.contentParent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@@ -117,6 +122,8 @@ PageType {
}
FlickableType {
parent: showDetailsDrawer.contentParent
anchors.top: showDetailsBackButton.bottom
anchors.left: parent.left
anchors.right: parent.right
@@ -115,7 +115,7 @@ PageType {
text: qsTr("I have the data to connect")
onClicked: {
connectionTypeSelection.visible = true
connectionTypeSelection.open()
}
}
@@ -134,12 +134,13 @@ PageType {
text: qsTr("I have nothing")
onClicked: Qt.openUrlExternally("https://amnezia.org/instructions/0_starter-guide")
onClicked: Qt.openUrlExternally("https://ru-docs.amnezia.org/guides/hosting-instructions")
}
}
ConnectionTypeSelectionDrawer {
id: connectionTypeSelection
parent: root
}
}
+10 -3
View File
@@ -118,7 +118,7 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 24
headerText: qsTr("Share VPN Access")
headerText: qsTr("VPN Access")
}
Rectangle {
@@ -171,14 +171,16 @@ PageType {
Layout.topMargin: 24
Layout.bottomMargin: 24
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.")
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.")
color: "#878B91"
}
DropDownType {
id: serverSelector
drawerParent: root
signal severSelectorIndexChanged
property int currentIndex: 0
@@ -241,6 +243,8 @@ PageType {
DropDownType {
id: protocolSelector
drawerParent: root
visible: accessTypeSelector.currentIndex === 0
Layout.fillWidth: true
@@ -330,6 +334,8 @@ PageType {
DropDownType {
id: exportTypeSelector
drawerParent: root
property int currentIndex: 0
Layout.fillWidth: true
@@ -371,6 +377,7 @@ PageType {
ShareConnectionDrawer {
id: shareConnectionDrawer
parent: root
}
BasicButtonType {
+11 -1
View File
@@ -135,6 +135,8 @@ PageType {
var pagePath = PageController.getPagePath(PageEnum.PageHome)
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
tabBarStackView.push(pagePath, { "objectName" : pagePath })
connectionTypeSelection.parent = tabBarStackView
}
// onWidthChanged: {
@@ -174,6 +176,12 @@ PageType {
strokeColor: "#2C2D30"
fillColor: "#1C1D21"
}
MouseArea {
id: noPropagateMouseEvent
anchors.fill: parent
enabled: true
}
}
TabImageButtonType {
@@ -244,7 +252,9 @@ PageType {
ConnectionTypeSelectionDrawer {
id: connectionTypeSelection
onAboutToHide: {
z: 1
onDrawerClosed: {
tabBar.setCurrentIndex(tabBar.previousIndex)
}
}