fixed remove button for wireguard and xray settings page

This commit is contained in:
vladimir.kuznetsov 2024-03-28 15:33:23 +05:00
parent ba4237f1dd
commit e4841e809b
2 changed files with 20 additions and 22 deletions

View file

@ -41,7 +41,7 @@ PageType {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
enabled: ServersModel.isCurrentlyProcessedServerHasWriteAccess() enabled: ServersModel.isProcessedServerHasWriteAccess()
ListView { ListView {
id: listview id: listview
@ -126,21 +126,20 @@ PageType {
text: qsTr("Remove WG") text: qsTr("Remove WG")
onClicked: { clickedFunc: function() {
questionDrawer.headerText = qsTr("Remove WG from server?") var 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.") var descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue") var yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel") var noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { var yesButtonFunction = function() {
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { var noButtonFunction = function() {
questionDrawer.visible = false
} }
questionDrawer.visible = true
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
} }
} }

View file

@ -42,7 +42,7 @@ PageType {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
enabled: ServersModel.isCurrentlyProcessedServerHasWriteAccess() enabled: ServersModel.isProcessedServerHasWriteAccess()
ListView { ListView {
id: listview id: listview
@ -112,21 +112,20 @@ PageType {
text: qsTr("Remove XRay") text: qsTr("Remove XRay")
onClicked: { clickedFunc: function() {
questionDrawer.headerText = qsTr("Remove XRay from server?") var 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.") var descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue") var yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel") var noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { var yesButtonFunction = function() {
questionDrawer.visible = false
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { var noButtonFunction = function() {
questionDrawer.visible = false
} }
questionDrawer.visible = true
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
} }
} }