From 4ab006f065c63bf02a86c6caafd5c92ad7d6162c Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 6 Sep 2023 13:37:37 +0500 Subject: [PATCH] added swipe up for menu on PageHome --- client/ui/controllers/pageController.h | 2 ++ .../ConnectionTypeSelectionDrawer.qml | 4 +-- .../qml/Components/HomeContainersListView.qml | 2 +- .../Components/SettingsContainersListView.qml | 16 +++++----- client/ui/qml/Controls2/BackButtonType.qml | 2 +- client/ui/qml/Controls2/DrawerType.qml | 1 + client/ui/qml/Controls2/PageType.qml | 32 ++++--------------- client/ui/qml/Pages2/PageHome.qml | 11 +++++-- .../Pages2/PageProtocolOpenVpnSettings.qml | 2 +- client/ui/qml/Pages2/PageProtocolRaw.qml | 2 +- .../ui/qml/Pages2/PageServiceSftpSettings.qml | 2 +- .../Pages2/PageServiceTorWebsiteSettings.qml | 2 +- client/ui/qml/Pages2/PageSettings.qml | 10 +++--- .../ui/qml/Pages2/PageSettingsApplication.qml | 2 +- .../ui/qml/Pages2/PageSettingsConnection.qml | 4 +-- .../ui/qml/Pages2/PageSettingsServerData.qml | 12 +++---- .../qml/Pages2/PageSettingsServerProtocol.qml | 4 +-- .../ui/qml/Pages2/PageSettingsServersList.qml | 2 +- .../Pages2/PageSetupWizardConfigSource.qml | 10 +++--- .../qml/Pages2/PageSetupWizardCredentials.qml | 2 +- client/ui/qml/Pages2/PageSetupWizardEasy.qml | 6 ++-- .../qml/Pages2/PageSetupWizardInstalling.qml | 16 +++++----- .../PageSetupWizardProtocolSettings.qml | 2 +- .../qml/Pages2/PageSetupWizardProtocols.qml | 2 +- client/ui/qml/Pages2/PageSetupWizardStart.qml | 2 +- .../ui/qml/Pages2/PageSetupWizardTextKey.qml | 2 +- .../qml/Pages2/PageSetupWizardViewConfig.qml | 6 ++-- client/ui/qml/Pages2/PageStart.qml | 15 +++++++++ 28 files changed, 90 insertions(+), 85 deletions(-) diff --git a/client/ui/controllers/pageController.h b/client/ui/controllers/pageController.h index 1dd16090..8d3da507 100644 --- a/client/ui/controllers/pageController.h +++ b/client/ui/controllers/pageController.h @@ -79,6 +79,8 @@ public slots: void showOnStartup(); signals: + void goToPage(PageLoader::PageEnum page, bool slide = true); + void goToStartPage(); void goToPageHome(); void goToPageSettings(); void goToPageViewConfig(); diff --git a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml index 8b377600..ecde1554 100644 --- a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml +++ b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml @@ -41,7 +41,7 @@ DrawerType { rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { - goToPage(PageEnum.PageSetupWizardCredentials) + PageController.goToPage(PageEnum.PageSetupWizardCredentials) root.visible = false } } @@ -55,7 +55,7 @@ DrawerType { rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { - goToPage(PageEnum.PageSetupWizardConfigSource) + PageController.goToPage(PageEnum.PageSetupWizardConfigSource) root.visible = false } } diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index fc4dd8b3..f5d27c00 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -67,7 +67,7 @@ ListView { } else { ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index)) InstallController.setShouldCreateServer(false) - goToPage(PageEnum.PageSetupWizardProtocolSettings) + PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) containersDropDown.menuVisible = false menu.visible = false } diff --git a/client/ui/qml/Components/SettingsContainersListView.qml b/client/ui/qml/Components/SettingsContainersListView.qml index 2489323b..a0c74a04 100644 --- a/client/ui/qml/Components/SettingsContainersListView.qml +++ b/client/ui/qml/Components/SettingsContainersListView.qml @@ -45,44 +45,44 @@ ListView { if (config[ContainerProps.containerTypeToString(containerIndex)]["isThirdPartyConfig"]) { ProtocolsModel.updateModel(config) - goToPage(PageEnum.PageProtocolRaw) + PageController.goToPage(PageEnum.PageProtocolRaw) return } switch (containerIndex) { case ContainerEnum.OpenVpn: { OpenVpnConfigModel.updateModel(config) - goToPage(PageEnum.PageProtocolOpenVpnSettings) + PageController.goToPage(PageEnum.PageProtocolOpenVpnSettings) break } case ContainerEnum.WireGuard: { ProtocolsModel.updateModel(config) - goToPage(PageEnum.PageProtocolRaw) + PageController.goToPage(PageEnum.PageProtocolRaw) // WireGuardConfigModel.updateModel(config) // goToPage(PageEnum.PageProtocolWireGuardSettings) break } case ContainerEnum.Ipsec: { ProtocolsModel.updateModel(config) - goToPage(PageEnum.PageProtocolRaw) + PageController.goToPage(PageEnum.PageProtocolRaw) // Ikev2ConfigModel.updateModel(config) // goToPage(PageEnum.PageProtocolIKev2Settings) break } case ContainerEnum.Sftp: { SftpConfigModel.updateModel(config) - goToPage(PageEnum.PageServiceSftpSettings) + PageController.goToPage(PageEnum.PageServiceSftpSettings) break } case ContainerEnum.TorWebSite: { - goToPage(PageEnum.PageServiceTorWebsiteSettings) + PageController.goToPage(PageEnum.PageServiceTorWebsiteSettings) break } default: { if (serviceType !== ProtocolEnum.Other) { //todo disable settings for dns container ProtocolsModel.updateModel(config) - goToPage(PageEnum.PageSettingsServerProtocol) + PageController.goToPage(PageEnum.PageSettingsServerProtocol) } } } @@ -90,7 +90,7 @@ ListView { } else { ContainersModel.setCurrentlyProcessedContainerIndex(root.model.mapToSource(index)) InstallController.setShouldCreateServer(false) - goToPage(PageEnum.PageSetupWizardProtocolSettings) + PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) } } diff --git a/client/ui/qml/Controls2/BackButtonType.qml b/client/ui/qml/Controls2/BackButtonType.qml index 91f5f28f..67ffbd9c 100644 --- a/client/ui/qml/Controls2/BackButtonType.qml +++ b/client/ui/qml/Controls2/BackButtonType.qml @@ -27,7 +27,7 @@ Item { if (backButtonFunction && typeof backButtonFunction === "function") { backButtonFunction() } else { - closePage() + PageController.closePage() } } } diff --git a/client/ui/qml/Controls2/DrawerType.qml b/client/ui/qml/Controls2/DrawerType.qml index 97fbf034..35d03449 100644 --- a/client/ui/qml/Controls2/DrawerType.qml +++ b/client/ui/qml/Controls2/DrawerType.qml @@ -6,6 +6,7 @@ Drawer { clip: true modal: true + dragMargin: -10 enter: Transition { SmoothedAnimation { diff --git a/client/ui/qml/Controls2/PageType.qml b/client/ui/qml/Controls2/PageType.qml index cb6fa142..193fbcf2 100644 --- a/client/ui/qml/Controls2/PageType.qml +++ b/client/ui/qml/Controls2/PageType.qml @@ -7,35 +7,15 @@ Item { property StackView stackView: StackView.view - function goToPage(page, slide = true) { - var pagePath = PageController.getPagePath(page) - if (slide) { - root.stackView.push(pagePath, { "objectName" : pagePath }, StackView.PushTransition) - } else { - root.stackView.push(pagePath, { "objectName" : pagePath }, StackView.Immediate) - } - } - - function closePage() { - if (root.stackView.depth <= 1) { - return - } - root.stackView.pop() - } - - function goToStartPage() { - while (root.stackView.depth > 1) { - root.stackView.pop() - } - } - MouseArea { - z: -1 + z: 99 anchors.fill: parent - onClicked: { - console.log("base mouse area pressed") - focus = true + enabled: true + + onPressed: function(mouse) { + forceActiveFocus() + mouse.accepted = false } } } diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index d40f8748..0c778215 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -26,11 +26,15 @@ PageType { property string defaultServerHostName: ServersModel.defaultServerHostName property string defaultContainerName: ContainersModel.defaultContainerName - ConnectButton { + Item { anchors.top: parent.top anchors.bottom: buttonBackground.top anchors.right: parent.right anchors.left: parent.left + + ConnectButton { + anchors.centerIn: parent + } } Connections { @@ -125,6 +129,9 @@ PageType { DrawerType { id: menu + interactive: true + dragMargin: buttonBackground.height + 56 // page start tabBar height + width: parent.width height: parent.height * 0.9 @@ -320,7 +327,7 @@ PageType { onClicked: function() { ServersModel.currentlyProcessedIndex = index - goToPage(PageEnum.PageSettingsServerInfo) + PageController.goToPage(PageEnum.PageSettingsServerInfo) menu.visible = false } } diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index 607b6584..aed1dbc1 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -368,7 +368,7 @@ PageType { questionDrawer.yesButtonFunction = function() { questionDrawer.visible = false - goToPage(PageEnum.PageDeinstalling) + PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index 4c155d61..8bbfab14 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -180,7 +180,7 @@ PageType { questionDrawer.yesButtonFunction = function() { questionDrawer.visible = false - goToPage(PageEnum.PageDeinstalling) + PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { diff --git a/client/ui/qml/Pages2/PageServiceSftpSettings.qml b/client/ui/qml/Pages2/PageServiceSftpSettings.qml index 5eb288f8..fead034b 100644 --- a/client/ui/qml/Pages2/PageServiceSftpSettings.qml +++ b/client/ui/qml/Pages2/PageServiceSftpSettings.qml @@ -259,7 +259,7 @@ PageType { questionDrawer.yesButtonFunction = function() { questionDrawer.visible = false - goToPage(PageEnum.PageDeinstalling) + PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { diff --git a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml index 38490375..04d7076c 100644 --- a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml +++ b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml @@ -144,7 +144,7 @@ PageType { questionDrawer.yesButtonFunction = function() { questionDrawer.visible = false - goToPage(PageEnum.PageDeinstalling) + PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { diff --git a/client/ui/qml/Pages2/PageSettings.qml b/client/ui/qml/Pages2/PageSettings.qml index 6c088a70..e020dc2c 100644 --- a/client/ui/qml/Pages2/PageSettings.qml +++ b/client/ui/qml/Pages2/PageSettings.qml @@ -46,7 +46,7 @@ PageType { leftImageSource: "qrc:/images/controls/server.svg" clickedFunction: function() { - goToPage(PageEnum.PageSettingsServersList) + PageController.goToPage(PageEnum.PageSettingsServersList) } } @@ -60,7 +60,7 @@ PageType { leftImageSource: "qrc:/images/controls/radio.svg" clickedFunction: function() { - goToPage(PageEnum.PageSettingsConnection) + PageController.goToPage(PageEnum.PageSettingsConnection) } } @@ -74,7 +74,7 @@ PageType { leftImageSource: "qrc:/images/controls/app.svg" clickedFunction: function() { - goToPage(PageEnum.PageSettingsApplication) + PageController.goToPage(PageEnum.PageSettingsApplication) } } @@ -88,7 +88,7 @@ PageType { leftImageSource: "qrc:/images/controls/save.svg" clickedFunction: function() { - goToPage(PageEnum.PageSettingsBackup) + PageController.goToPage(PageEnum.PageSettingsBackup) } } @@ -102,7 +102,7 @@ PageType { leftImageSource: "qrc:/images/controls/amnezia.svg" clickedFunction: function() { - goToPage(PageEnum.PageSettingsAbout) + PageController.goToPage(PageEnum.PageSettingsAbout) } } diff --git a/client/ui/qml/Pages2/PageSettingsApplication.qml b/client/ui/qml/Pages2/PageSettingsApplication.qml index 7b628037..6f5e48a2 100644 --- a/client/ui/qml/Pages2/PageSettingsApplication.qml +++ b/client/ui/qml/Pages2/PageSettingsApplication.qml @@ -112,7 +112,7 @@ PageType { rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { - goToPage(PageEnum.PageSettingsLogging) + PageController.goToPage(PageEnum.PageSettingsLogging) } } diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index 0692abda..78d4a681 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -86,7 +86,7 @@ PageType { rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { - goToPage(PageEnum.PageSettingsDns) + PageController.goToPage(PageEnum.PageSettingsDns) } } @@ -100,7 +100,7 @@ PageType { rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { - goToPage(PageEnum.PageSettingsSplitTunneling) + PageController.goToPage(PageEnum.PageSettingsSplitTunneling) } } diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index 8ae90351..3eb07ce9 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -32,20 +32,20 @@ PageType { if (!ServersModel.getServersCount()) { PageController.replaceStartPage() } else { - goToStartPage() - goToPage(PageEnum.PageSettingsServersList) + PageController.goToStartPage() + PageController.goToPage(PageEnum.PageSettingsServersList) } PageController.showNotificationMessage(finishedMessage) } function onRemoveAllContainersFinished(finishedMessage) { - closePage() // close deInstalling page + PageController.closePage() // close deInstalling page PageController.showNotificationMessage(finishedMessage) } function onRemoveCurrentlyProcessedContainerFinished(finishedMessage) { - closePage() // close deInstalling page - closePage() // close page with remove button + PageController.closePage() // close deInstalling page + PageController.closePage() // close page with remove button PageController.showNotificationMessage(finishedMessage) } } @@ -173,7 +173,7 @@ PageType { questionDrawer.yesButtonFunction = function() { questionDrawer.visible = false - goToPage(PageEnum.PageDeinstalling) + PageController.goToPage(PageEnum.PageDeinstalling) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { ConnectionController.closeConnection() } diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index 2163a71c..14d34590 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -87,7 +87,7 @@ PageType { case ProtocolEnum.WireGuard: WireGuardConfigModel.updateModel(ProtocolsModel.getConfig()); break; case ProtocolEnum.Ipsec: Ikev2ConfigModel.updateModel(ProtocolsModel.getConfig()); break; } - goToPage(protocolPage); + PageController.goToPage(protocolPage); } MouseArea { @@ -120,7 +120,7 @@ PageType { questionDrawer.yesButtonFunction = function() { questionDrawer.visible = false - goToPage(PageEnum.PageDeinstalling) + PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { diff --git a/client/ui/qml/Pages2/PageSettingsServersList.qml b/client/ui/qml/Pages2/PageSettingsServersList.qml index 40e51e9e..c0807f35 100644 --- a/client/ui/qml/Pages2/PageSettingsServersList.qml +++ b/client/ui/qml/Pages2/PageSettingsServersList.qml @@ -98,7 +98,7 @@ PageType { clickedFunction: function() { ServersModel.currentlyProcessedIndex = index - goToPage(PageEnum.PageSettingsServerInfo) + PageController.goToPage(PageEnum.PageSettingsServerInfo) } } diff --git a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml index 6362ca6d..c0ad6249 100644 --- a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml +++ b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml @@ -17,8 +17,8 @@ PageType { target: ImportController function onQrDecodingFinished() { - closePage() - goToPage(PageEnum.PageSetupWizardViewConfig) + PageController.closePage() + PageController.goToPage(PageEnum.PageSetupWizardViewConfig) } } @@ -84,7 +84,7 @@ It's okay as long as it's from someone you trust.") PageController.showBusyIndicator(false) } else { ImportController.extractConfigFromFile(fileDialog.selectedFile.toString()) - goToPage(PageEnum.PageSetupWizardViewConfig) + PageController.goToPage(PageEnum.PageSetupWizardViewConfig) } } } @@ -103,7 +103,7 @@ It's okay as long as it's from someone you trust.") clickedFunction: function() { ImportController.startDecodingQr() if (Qt.platform.os === "ios") { - goToPage(PageEnum.PageSetupWizardQrReader) + PageController.goToPage(PageEnum.PageSetupWizardQrReader) } } } @@ -120,7 +120,7 @@ It's okay as long as it's from someone you trust.") leftImageSource: "qrc:/images/controls/text-cursor.svg" clickedFunction: function() { - goToPage(PageEnum.PageSetupWizardTextKey) + PageController.goToPage(PageEnum.PageSetupWizardTextKey) } } diff --git a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml index d089a70d..bc24c196 100644 --- a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml +++ b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml @@ -104,7 +104,7 @@ PageType { return } - goToPage(PageEnum.PageSetupWizardEasy) + PageController.goToPage(PageEnum.PageSetupWizardEasy) } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardEasy.qml b/client/ui/qml/Pages2/PageSetupWizardEasy.qml index 375a8332..6fdc4b3e 100644 --- a/client/ui/qml/Pages2/PageSetupWizardEasy.qml +++ b/client/ui/qml/Pages2/PageSetupWizardEasy.qml @@ -159,12 +159,12 @@ PageType { onClicked: function() { if (root.isEasySetup) { ContainersModel.setCurrentlyProcessedContainerIndex(containers.dockerContainer) - goToPage(PageEnum.PageSetupWizardInstalling) + PageController.goToPage(PageEnum.PageSetupWizardInstalling) InstallController.install(containers.dockerContainer, containers.containerDefaultPort, containers.containerDefaultTransportProto) } else { - goToPage(PageEnum.PageSetupWizardProtocols) + PageController.goToPage(PageEnum.PageSetupWizardProtocols) } } } @@ -186,7 +186,7 @@ PageType { text: qsTr("Set up later") onClicked: function() { - goToPage(PageEnum.PageSetupWizardInstalling) + PageController.goToPage(PageEnum.PageSetupWizardInstalling) InstallController.addEmptyServer() } } diff --git a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml index 20c589ee..f2919398 100644 --- a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml +++ b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml @@ -24,28 +24,28 @@ PageType { target: InstallController function onInstallContainerFinished(finishedMessage, isServiceInstall) { - goToStartPage() + PageController.goToStartPage() if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) { PageController.restorePageHomeState(true) } else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) { - goToPage(PageEnum.PageSettingsServersList, false) - goToPage(PageEnum.PageSettingsServerInfo, false) + PageController.goToPage(PageEnum.PageSettingsServersList, false) + PageController.goToPage(PageEnum.PageSettingsServerInfo, false) if (isServiceInstall) { PageController.goToPageSettingsServerServices() } } else { - goToPage(PageEnum.PageHome) + PageController.goToPage(PageEnum.PageHome) } PageController.showNotificationMessage(finishedMessage) } function onInstallServerFinished(finishedMessage) { - goToStartPage() + PageController.goToStartPage() if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) { PageController.restorePageHomeState() } else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) { - goToPage(PageEnum.PageSettingsServersList, false) + PageController.goToPage(PageEnum.PageSettingsServersList, false) } else { PageController.replaceStartPage() } @@ -54,9 +54,9 @@ PageType { } function onServerAlreadyExists(serverIndex) { - goToStartPage() + PageController.goToStartPage() ServersModel.currentlyProcessedIndex = serverIndex - goToPage(PageEnum.PageSettingsServerInfo, false) + PageController.goToPage(PageEnum.PageSettingsServerInfo, false) PageController.showErrorMessage(qsTr("The server has already been added to the application")) } diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml index d64fa097..6552d873 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml @@ -229,7 +229,7 @@ PageType { text: qsTr("Install") onClicked: function() { - goToPage(PageEnum.PageSetupWizardInstalling); + PageController.goToPage(PageEnum.PageSetupWizardInstalling); InstallController.install(dockerContainer, port.textFieldText, transportProtoSelector.currentIndex) } } diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocols.qml b/client/ui/qml/Pages2/PageSetupWizardProtocols.qml index 8c7f5de0..71b33eb0 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocols.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocols.qml @@ -105,7 +105,7 @@ PageType { clickedFunction: function() { ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index)) - goToPage(PageEnum.PageSetupWizardProtocolSettings) + PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) } } diff --git a/client/ui/qml/Pages2/PageSetupWizardStart.qml b/client/ui/qml/Pages2/PageSetupWizardStart.qml index 3bc57495..2ce93e53 100644 --- a/client/ui/qml/Pages2/PageSetupWizardStart.qml +++ b/client/ui/qml/Pages2/PageSetupWizardStart.qml @@ -17,7 +17,7 @@ PageType { target: PageController function onGoToPageViewConfig() { - goToPage(PageEnum.PageSetupWizardViewConfig) + PageController.goToPage(PageEnum.PageSetupWizardViewConfig) } function onShowBusyIndicator(visible) { diff --git a/client/ui/qml/Pages2/PageSetupWizardTextKey.qml b/client/ui/qml/Pages2/PageSetupWizardTextKey.qml index 504645d1..4cdfc444 100644 --- a/client/ui/qml/Pages2/PageSetupWizardTextKey.qml +++ b/client/ui/qml/Pages2/PageSetupWizardTextKey.qml @@ -72,7 +72,7 @@ PageType { onClicked: function() { ImportController.extractConfigFromCode(textKey.textFieldText) - goToPage(PageEnum.PageSetupWizardViewConfig) + PageController.goToPage(PageEnum.PageSetupWizardViewConfig) } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml index 222fbd11..2f1fc392 100644 --- a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml +++ b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml @@ -19,16 +19,16 @@ PageType { target: ImportController function onImportErrorOccurred(errorMessage) { - closePage() + PageController.closePage() PageController.showErrorMessage(errorMessage) } function onImportFinished() { - goToStartPage() + PageController.goToStartPage() if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) { PageController.restorePageHomeState() } else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) { - goToPage(PageEnum.PageSettingsServersList, false) + PageController.goToPage(PageEnum.PageSettingsServersList, false) } else { PageController.replaceStartPage() } diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index e4cc02ee..31474c12 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -47,6 +47,21 @@ PageType { } tabBarStackView.pop() } + + function onGoToPage(page, slide) { + var pagePath = PageController.getPagePath(page) + if (slide) { + tabBarStackView.push(pagePath, { "objectName" : pagePath }, StackView.PushTransition) + } else { + tabBarStackView.push(pagePath, { "objectName" : pagePath }, StackView.Immediate) + } + } + + function onGoToStartPage() { + while (tabBarStackView.depth > 1) { + tabBarStackView.pop() + } + } } Connections {