From 9d6559f0d732008387936addf1e9c3061019bf59 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Tue, 10 Oct 2023 12:50:41 +0500 Subject: [PATCH] fixed an error when after the first connection with admin config the container model was not updated --- client/amnezia_application.cpp | 2 + client/translations/amneziavpn_ru.ts | 54 ++++++++-------- client/translations/amneziavpn_zh_CN.ts | 86 ++++++++++++++++--------- client/ui/models/containers_model.cpp | 5 ++ client/ui/models/containers_model.h | 2 + client/vpnconnection.cpp | 1 + client/vpnconnection.h | 2 + 7 files changed, 95 insertions(+), 57 deletions(-) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index 5b6d2491..4e6bce2b 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -279,6 +279,8 @@ void AmneziaApplication::initModels() { m_containersModel.reset(new ContainersModel(m_settings, this)); m_engine->rootContext()->setContextProperty("ContainersModel", m_containersModel.get()); + connect(m_vpnConnection.get(), &VpnConnection::newVpnConfigurationCreated, m_containersModel.get(), + &ContainersModel::updateContainersConfig); m_serversModel.reset(new ServersModel(m_settings, this)); m_engine->rootContext()->setContextProperty("ServersModel", m_serversModel.get()); diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 47d0510f..27cb25e2 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -4,7 +4,7 @@ AmneziaApplication - + Split tunneling for WireGuard is not implemented, the option was disabled @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. @@ -162,32 +162,32 @@ Already installed containers were found on the server. All installed containers - + Settings updated successfully - + Server '%1' was removed - + All containers from server '%1' have been removed - + %1 has been removed from the server '%2' - + Please login as the user - + Server added successfully @@ -559,7 +559,7 @@ Already installed containers were found on the server. All installed containers - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -607,7 +607,7 @@ Already installed containers were found on the server. All installed containers - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -879,8 +879,12 @@ Already installed containers were found on the server. All installed containers - This is a free and open source application. If you like it, support the developers with a donation. -And if you don't like the app, all the more support it - the donation will be used to improve the app. + This is a free and open source application. If you like it, support the developers with a donation. + + + + + And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application. @@ -1056,7 +1060,7 @@ And if you don't like the app, all the more support it - the donation will - It will help you instantly restore connection settings at the next installation + You can save your settings to a backup file to restore them the next time you install the application. @@ -1150,7 +1154,7 @@ And if you don't like the app, all the more support it - the donation will - Allows you to connect to some sites through a secure connection, and to others bypassing it + Allows you to choose which sites you want to use the VPN for. @@ -1414,7 +1418,7 @@ And if you don't like the app, all the more support it - the donation will - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -1800,27 +1804,27 @@ It's okay as long as it's from someone you trust. PageSetupWizardViewConfig - + New connection - + Do not use connection code from public sources. It could be created to intercept your data. - + Collapse content - + Show content - + Connect @@ -1853,6 +1857,7 @@ It's okay as long as it's from someone you trust. + Server @@ -1902,11 +1907,6 @@ It's okay as long as it's from someone you trust. 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. - - - Servers - - @@ -2627,7 +2627,7 @@ It's okay as long as it's from someone you trust. - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" @@ -2719,7 +2719,7 @@ It's okay as long as it's from someone you trust. VpnConnection - + Mbps diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index e9d73b46..32d2d742 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -4,7 +4,7 @@ AmneziaApplication - + Split tunneling for WireGuard is not implemented, the option was disabled 未启用选项,还未实现基于WireGuard协议的VPN分流 @@ -30,9 +30,6 @@ - - - Connect 连接 @@ -133,7 +130,7 @@ ImportController - + Scanned %1 of %2. 扫描 %1 of %2. @@ -174,22 +171,22 @@ Already installed containers were found on the server. All installed containers 在服务上发现已经安装协议并添加到应用程序 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -210,12 +207,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 服务器添加成功 @@ -587,8 +584,12 @@ Already installed containers were found on the server. All installed containers + All users who you shared a connection with will no longer be able to connect to it. + + + All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -633,14 +634,18 @@ Already installed containers were found on the server. All installed containers Remove %1 from server? 从服务器移除 %1 ? + + + All users who you shared a connection with will no longer be able to connect to it. + + from server? 从服务器 - All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -907,12 +912,21 @@ Already installed containers were found on the server. All installed containers 捐款 - This is a free and open source application. If you like it, support the developers with a donation. And if you don't like the app, all the more support it - the donation will be used to improve the app. - 这是一个免费且开源的应用软件。如果您喜欢它,请捐助支持我们继续研发。 + 这是一个免费且开源的应用软件。如果您喜欢它,请捐助支持我们继续研发。 如果您不喜欢,请捐助支持我们改进它。 + + + This is a free and open source application. If you like it, support the developers with a donation. + + + + + And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application. + + Card on Patreon @@ -1085,9 +1099,13 @@ And if you don't like the app, all the more support it - the donation will 配置备份 - It will help you instantly restore connection settings at the next installation - 帮助您在下次安装时立即恢复连接设置 + 帮助您在下次安装时立即恢复连接设置 + + + + You can save your settings to a backup file to restore them the next time you install the application. + @@ -1184,8 +1202,12 @@ And if you don't like the app, all the more support it - the donation will + Allows you to choose which sites you want to use the VPN for. + + + Allows you to connect to some sites through a secure connection, and to others bypassing it - 使用VPN访问指定网站,其他的则绕过 + 使用VPN访问指定网站,其他的则绕过 @@ -1441,6 +1463,11 @@ And if you don't like the app, all the more support it - the donation will Remove 移除 + + + All users who you shared a connection with will no longer be able to connect to it. + + from server? 从服务器 @@ -1451,9 +1478,8 @@ And if you don't like the app, all the more support it - the donation will 从服务器移除 %1 ? - All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -1839,27 +1865,27 @@ It's okay as long as it's from someone you trust. PageSetupWizardViewConfig - + New connection 新连接 - + Do not use connection code from public sources. It could be created to intercept your data. 请勿使用公共来源的连接代码。它可以被创建来拦截您的数据。 - + Collapse content - + Show content 展示内容 - + Connect 连接 @@ -1921,11 +1947,11 @@ It's okay as long as it's from someone you trust. 获得服务器完整授权 - Servers - 服务器 + 服务器 + Server 服务器 @@ -2678,7 +2704,7 @@ It's okay as long as it's from someone you trust. 展示内容 - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" 要读取 Amnezia 应用程序中的二维码,请选择“添加服务器”→“我有数据要连接”→“二维码、密钥或配置文件” @@ -2770,7 +2796,7 @@ It's okay as long as it's from someone you trust. VpnConnection - + Mbps diff --git a/client/ui/models/containers_model.cpp b/client/ui/models/containers_model.cpp index 6cf855a6..0c99041e 100644 --- a/client/ui/models/containers_model.cpp +++ b/client/ui/models/containers_model.cpp @@ -228,6 +228,11 @@ bool ContainersModel::isAnyContainerInstalled() return false; } +void ContainersModel::updateContainersConfig() +{ + m_containers = m_settings->containers(m_currentlyProcessedServerIndex); +} + QHash ContainersModel::roleNames() const { QHash roles; diff --git a/client/ui/models/containers_model.h b/client/ui/models/containers_model.h index 2cc41cbf..cc549bb3 100644 --- a/client/ui/models/containers_model.h +++ b/client/ui/models/containers_model.h @@ -65,6 +65,8 @@ public slots: bool isAnyContainerInstalled(); + void updateContainersConfig(); + protected: QHash roleNames() const override; diff --git a/client/vpnconnection.cpp b/client/vpnconnection.cpp index 1cff01e6..46e8be60 100644 --- a/client/vpnconnection.cpp +++ b/client/vpnconnection.cpp @@ -323,6 +323,7 @@ void VpnConnection::connectToVpn(int serverIndex, const ServerCredentials &crede ErrorCode e = ErrorCode::NoError; m_vpnConfiguration = createVpnConfiguration(serverIndex, credentials, container, containerConfig, &e); + emit newVpnConfigurationCreated(); if (e) { emit connectionStateChanged(Vpn::ConnectionState::Error); return; diff --git a/client/vpnconnection.h b/client/vpnconnection.h index 20ee14fa..f6b2343c 100644 --- a/client/vpnconnection.h +++ b/client/vpnconnection.h @@ -79,6 +79,8 @@ signals: void serviceIsNotReady(); + void newVpnConfigurationCreated(); + protected slots: void onBytesChanged(quint64 receivedBytes, quint64 sentBytes); void onConnectionStateChanged(Vpn::ConnectionState state);