From e4841e809bf59dedf1c0f8d30ff94d94c82dda66 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 28 Mar 2024 15:33:23 +0500 Subject: [PATCH] fixed remove button for wireguard and xray settings page --- .../Pages2/PageProtocolWireGuardSettings.qml | 21 +++++++++---------- .../qml/Pages2/PageProtocolXraySettings.qml | 21 +++++++++---------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml index f9f4a4dc..40d8803a 100644 --- a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml @@ -41,7 +41,7 @@ PageType { anchors.left: parent.left anchors.right: parent.right - enabled: ServersModel.isCurrentlyProcessedServerHasWriteAccess() + enabled: ServersModel.isProcessedServerHasWriteAccess() ListView { id: listview @@ -126,21 +126,20 @@ PageType { text: qsTr("Remove WG") - onClicked: { - questionDrawer.headerText = qsTr("Remove WG from server?") - questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.") - questionDrawer.yesButtonText = qsTr("Continue") - questionDrawer.noButtonText = qsTr("Cancel") + clickedFunc: function() { + var headerText = qsTr("Remove WG from server?") + var descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.") + var yesButtonText = qsTr("Continue") + var noButtonText = qsTr("Cancel") - questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + var yesButtonFunction = function() { PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } - questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + var noButtonFunction = function() { } - questionDrawer.visible = true + + showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) } } diff --git a/client/ui/qml/Pages2/PageProtocolXraySettings.qml b/client/ui/qml/Pages2/PageProtocolXraySettings.qml index 05b958ac..588a7f8b 100644 --- a/client/ui/qml/Pages2/PageProtocolXraySettings.qml +++ b/client/ui/qml/Pages2/PageProtocolXraySettings.qml @@ -42,7 +42,7 @@ PageType { anchors.left: parent.left anchors.right: parent.right - enabled: ServersModel.isCurrentlyProcessedServerHasWriteAccess() + enabled: ServersModel.isProcessedServerHasWriteAccess() ListView { id: listview @@ -112,21 +112,20 @@ PageType { text: qsTr("Remove XRay") - onClicked: { - questionDrawer.headerText = qsTr("Remove XRay from server?") - questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.") - questionDrawer.yesButtonText = qsTr("Continue") - questionDrawer.noButtonText = qsTr("Cancel") + clickedFunc: function() { + var headerText = qsTr("Remove XRay from server?") + var descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.") + var yesButtonText = qsTr("Continue") + var noButtonText = qsTr("Cancel") - questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + var yesButtonFunction = function() { PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } - questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + var noButtonFunction = function() { } - questionDrawer.visible = true + + showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) } }