From d364dbac2ce6c3e1f82bc55950f323915f869b8e Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 9 Oct 2023 22:39:32 +0500 Subject: [PATCH] now when a new container is installed, it is selected as the default container --- client/translations/amneziavpn_ru.ts | 28 +++++++++---------- client/translations/amneziavpn_zh_CN.ts | 28 +++++++++---------- client/ui/controllers/installController.cpp | 1 + .../qml/Components/HomeContainersListView.qml | 2 -- .../qml/Pages2/PageSetupWizardViewConfig.qml | 6 +--- client/ui/qml/Pages2/PageShare.qml | 2 +- 6 files changed, 31 insertions(+), 36 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 92061f89..2f36f748 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -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 @@ -260,7 +260,7 @@ Already installed containers were found on the server. All installed containers - + Servers @@ -1343,7 +1343,7 @@ And if you don't like the app, all the more support it - the donation will PageSettingsServersList - + Servers @@ -1568,33 +1568,33 @@ It's okay as long as it's from someone you trust. PageSetupWizardInstalling - + The server has already been added to the application - + Amnesia has detected that your server is currently - + busy installing other software. Amnesia installation - + will pause until the server finishes installing other software - + Installing - + Usually it takes no more than 5 minutes diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 6c57e9f1..c2376be0 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -171,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' 上移除 @@ -207,12 +207,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 服务器添加成功 @@ -285,7 +285,7 @@ Already installed containers were found on the server. All installed containers VPN协议 - + Servers 服务器 @@ -1378,7 +1378,7 @@ And if you don't like the app, all the more support it - the donation will PageSettingsServersList - + Servers 服务器 @@ -1605,32 +1605,32 @@ It's okay as long as it's from someone you trust. PageSetupWizardInstalling - + Usually it takes no more than 5 minutes 通常不超过5分钟 - + The server has already been added to the application 服务器已添加到应用程序中 - + Amnesia has detected that your server is currently Amnezia 检测到您的服务器当前 - + busy installing other software. Amnesia installation 正安装其他软件。Amnezia安装 - + will pause until the server finishes installing other software 将暂停,直到服务器完成安装其他软件。 - + Installing 安装中 diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index 72cc34b6..34917cac 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -183,6 +183,7 @@ void InstallController::installContainer(DockerContainer container, QJsonObject "All installed containers have been added to the application"); } + m_containersModel->setData(m_containersModel->index(0, 0), container, ContainersModel::Roles::IsDefaultRole); emit installContainerFinished(finishMessage, ContainerProps::containerService(container) == ServiceType::Other); return; } diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index 4708128f..86a755c1 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -76,7 +76,6 @@ ListView { (ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) { PageController.showNotificationMessage(qsTr("Reconnect via VPN Procotol: ") + name) PageController.goToPageHome() - menu.visible = false ConnectionController.openConnection() } } else { @@ -84,7 +83,6 @@ ListView { InstallController.setShouldCreateServer(false) PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) containersDropDown.menuVisible = false - menu.visible = false } } diff --git a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml index 2f1fc392..83132bd9 100644 --- a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml +++ b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml @@ -25,11 +25,7 @@ PageType { function onImportFinished() { PageController.goToStartPage() - if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) { - PageController.restorePageHomeState() - } else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) { - PageController.goToPage(PageEnum.PageSettingsServersList, false) - } else { + if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { PageController.replaceStartPage() } } diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 6c284278..2fa5e4a1 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -187,7 +187,7 @@ PageType { drawerHeight: 0.4375 - descriptionText: qsTr("Servers") + descriptionText: qsTr("Server") headerText: qsTr("Server") listView: ListViewWithRadioButtonType {