From 2f0c1eeecc11165c1928a6b07e75859e6ec4e629 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 18 Oct 2023 00:36:40 +0500 Subject: [PATCH 1/4] fixed selection of default container after installing a new server --- client/amnezia_application.cpp | 2 ++ client/ui/controllers/installController.cpp | 2 ++ client/ui/models/servers_model.cpp | 2 +- client/ui/models/servers_model.h | 2 +- client/ui/qml/Components/ConnectButton.qml | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index 4e6bce2b..bbd48c96 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -286,6 +286,8 @@ void AmneziaApplication::initModels() m_engine->rootContext()->setContextProperty("ServersModel", m_serversModel.get()); connect(m_serversModel.get(), &ServersModel::currentlyProcessedServerIndexChanged, m_containersModel.get(), &ContainersModel::setCurrentlyProcessedServerIndex); + connect(m_serversModel.get(), &ServersModel::defaultServerIndexChanged, m_containersModel.get(), + &ContainersModel::setCurrentlyProcessedServerIndex); m_languageModel.reset(new LanguageModel(m_settings, this)); m_engine->rootContext()->setContextProperty("LanguageModel", m_languageModel.get()); diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index bb10d39c..db2f9409 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -475,6 +475,8 @@ void InstallController::addEmptyServer() server.insert(config_key::port, m_currentlyInstalledServerCredentials.port); server.insert(config_key::description, m_settings->nextAvailableServerName()); + server.insert(config_key::defaultContainer, ContainerProps::containerToString(DockerContainer::None)); + m_serversModel->addServer(server); m_serversModel->setDefaultServerIndex(m_serversModel->getServersCount() - 1); diff --git a/client/ui/models/servers_model.cpp b/client/ui/models/servers_model.cpp index 7eea94e5..a2a28630 100644 --- a/client/ui/models/servers_model.cpp +++ b/client/ui/models/servers_model.cpp @@ -96,7 +96,7 @@ void ServersModel::setDefaultServerIndex(const int index) { m_settings->setDefaultServer(index); m_defaultServerIndex = m_settings->defaultServerIndex(); - emit defaultServerIndexChanged(); + emit defaultServerIndexChanged(m_defaultServerIndex); } const int ServersModel::getDefaultServerIndex() diff --git a/client/ui/models/servers_model.h b/client/ui/models/servers_model.h index d7b15844..ad1d5a83 100644 --- a/client/ui/models/servers_model.h +++ b/client/ui/models/servers_model.h @@ -64,7 +64,7 @@ protected: signals: void currentlyProcessedServerIndexChanged(const int index); - void defaultServerIndexChanged(); + void defaultServerIndexChanged(const int index); void defaultServerNameChanged(); private: diff --git a/client/ui/qml/Components/ConnectButton.qml b/client/ui/qml/Components/ConnectButton.qml index 76e83da5..c2ec186d 100644 --- a/client/ui/qml/Components/ConnectButton.qml +++ b/client/ui/qml/Components/ConnectButton.qml @@ -142,6 +142,7 @@ Button { PageController.setTriggeredBtConnectButton(true) ServersModel.currentlyProcessedIndex = ServersModel.getDefaultServerIndex() + InstallController.setShouldCreateServer(false) PageController.goToPage(PageEnum.PageSetupWizardEasy) return From 4b64bfaec029aca8355ed627aeaa8356ba243706 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 18 Oct 2023 00:37:15 +0500 Subject: [PATCH 2/4] fixed questionDrawer height --- client/translations/amneziavpn_ru.ts | 14 ++++++++++++-- client/translations/amneziavpn_zh_CN.ts | 14 ++++++++++++-- client/ui/qml/Components/QuestionDrawer.qml | 4 +++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 1617413a..4d3ae6c9 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 Раздельное туннелирование для "Wireguard" не реализовано,опция отключена @@ -194,7 +194,7 @@ Already installed containers were found on the server. All installed containers Пожалуйста, войдите в систему от имени пользователя - + Server added successfully Сервер успешно добавлен @@ -2700,6 +2700,16 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 09198c9c..ae25e41c 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分离 @@ -228,7 +228,7 @@ Already installed containers were found on the server. All installed containers 请以用户身份登录 - + Server added successfully 增加服务器成功 @@ -2839,6 +2839,16 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/ui/qml/Components/QuestionDrawer.qml b/client/ui/qml/Components/QuestionDrawer.qml index a79f9140..16cdcb39 100644 --- a/client/ui/qml/Components/QuestionDrawer.qml +++ b/client/ui/qml/Components/QuestionDrawer.qml @@ -17,9 +17,11 @@ DrawerType { property var noButtonFunction width: parent.width - height: parent.height * 0.5 + height: content.implicitHeight + 32 ColumnLayout { + id: content + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right From a46e55d5c2b938f06ddd03e510e6f9470a538504 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 18 Oct 2023 01:11:41 +0500 Subject: [PATCH 3/4] added a dash for drawerType --- client/translations/amneziavpn_ru.ts | 6 +++--- client/translations/amneziavpn_zh_CN.ts | 6 +++--- client/ui/qml/Controls2/DrawerType.qml | 14 ++++++++++++++ client/ui/qml/Pages2/PageHome.qml | 14 ++++++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 4d3ae6c9..db27afbc 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -262,17 +262,17 @@ Already installed containers were found on the server. All installed containers PageHome - + VPN protocol VPN протокол - + Servers Серверы - + Unable change server while there is an active connection diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index ae25e41c..59bef770 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -296,17 +296,17 @@ Already installed containers were found on the server. All installed containers PageHome - + VPN protocol VPN协议 - + Servers 服务器 - + Unable change server while there is an active connection Невозможно изменить сервер при наличии активного соединения diff --git a/client/ui/qml/Controls2/DrawerType.qml b/client/ui/qml/Controls2/DrawerType.qml index 72765d78..830f59f9 100644 --- a/client/ui/qml/Controls2/DrawerType.qml +++ b/client/ui/qml/Controls2/DrawerType.qml @@ -1,6 +1,8 @@ import QtQuick import QtQuick.Controls +import "../Config" + Drawer { id: drawer property bool needCloseButton: true @@ -39,6 +41,18 @@ Drawer { border.color: "#2C2D30" border.width: 1 + + Rectangle { + visible: GC.isMobile() + + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 10 + + width: 20 + height: 2 + color: "#2C2D30" + } } Overlay.modal: Rectangle { diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index d89d6be1..3a71adac 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -241,8 +241,18 @@ PageType { } ] + DividerType { + Layout.topMargin: 10 + Layout.fillWidth: false + Layout.preferredWidth: 20 + Layout.preferredHeight: 2 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + + visible: GC.isMobile() && (buttonContent.collapsedVisibility || buttonContent.expandedVisibility) + } + RowLayout { - Layout.topMargin: 24 + Layout.topMargin: 14 Layout.leftMargin: 24 Layout.rightMargin: 24 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter @@ -305,7 +315,7 @@ PageType { Header1TextType { Layout.fillWidth: true - Layout.topMargin: 24 + Layout.topMargin: 14 Layout.leftMargin: 16 Layout.rightMargin: 16 From e16c425f875d209f4f35fe7f94714b46593352e0 Mon Sep 17 00:00:00 2001 From: pokamest Date: Wed, 18 Oct 2023 12:04:39 +0100 Subject: [PATCH 4/4] PageHome.qml fix --- CMakeLists.txt | 2 +- client/translations/amneziavpn_ru.ts | 10 ---------- client/translations/amneziavpn_zh_CN.ts | 10 ---------- client/ui/qml/Pages2/PageHome.qml | 2 +- 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 028aacd3..68de51fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR) set(PROJECT AmneziaVPN) -project(${PROJECT} VERSION 4.0.8.3 +project(${PROJECT} VERSION 4.0.8.4 DESCRIPTION "AmneziaVPN" HOMEPAGE_URL "https://amnezia.org/" ) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index db27afbc..a26758b7 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -2700,16 +2700,6 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 59bef770..a10fb449 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -2839,16 +2839,6 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index 3a71adac..cc49e4f0 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -248,7 +248,7 @@ PageType { Layout.preferredHeight: 2 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - visible: GC.isMobile() && (buttonContent.collapsedVisibility || buttonContent.expandedVisibility) + visible: (buttonContent.collapsedVisibility || buttonContent.expandedVisibility) } RowLayout {