Merge pull request #163 from amnezia-vpn/feature/confirm-on-clear-and-delete-server
feature/confirm-on-clear-and-delete-server
This commit is contained in:
commit
c3fc3a3132
9 changed files with 105 additions and 39 deletions
|
|
@ -296,23 +296,24 @@ PageBase {
|
|||
implicitHeight: 30
|
||||
|
||||
checked: default_role
|
||||
|
||||
MessageDialog {
|
||||
id: dialogRemove
|
||||
buttons: StandardButton.Yes | StandardButton.Cancel
|
||||
title: "AmneziaVPN"
|
||||
text: qsTr("Remove container") + " " + name_role + "?" + "\n" + qsTr("This action will erase all data of this container on the server.")
|
||||
onAccepted: {
|
||||
tb_c.currentIndex = -1
|
||||
ServerContainersLogic.onPushButtonRemoveClicked(proxyContainersModel.mapToSource(index))
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: dialogRemove.open()
|
||||
onClicked: popupRemove.open()
|
||||
|
||||
VisibleBehavior on visible { }
|
||||
}
|
||||
|
||||
PopupWithQuestion {
|
||||
id: popupRemove
|
||||
questionText: qsTr("Remove container") + " " + name_role + "?" + "\n" + qsTr("This action will erase all data of this container on the server.")
|
||||
yesFunc: function() {
|
||||
tb_c.currentIndex = -1
|
||||
ServerContainersLogic.onPushButtonRemoveClicked(proxyContainersModel.mapToSource(index))
|
||||
close()
|
||||
}
|
||||
noFunc: function() {
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: button_share
|
||||
visible: (index === tb_c.currentIndex) && ServerContainersLogic.isManagedServer
|
||||
|
|
@ -417,7 +418,7 @@ PageBase {
|
|||
|
||||
BlueButtonType {
|
||||
id: pb_add_container
|
||||
visible: container_selector.selectedIndex < 0
|
||||
visible: container_selector.selectedIndex < 0 && ServerContainersLogic.isManagedServer
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
|
|
@ -429,6 +430,5 @@ PageBase {
|
|||
text: qsTr("Install new service")
|
||||
font.pixelSize: 16
|
||||
onClicked: container_selector.visible ? container_selector.close() : container_selector.open()
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,24 +93,49 @@ PageBase {
|
|||
ServerSettingsLogic.onPushButtonClearClientCacheClicked()
|
||||
}
|
||||
}
|
||||
|
||||
BlueButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 10
|
||||
text: ServerSettingsLogic.pushButtonClearText
|
||||
visible: ServerSettingsLogic.pushButtonClearVisible
|
||||
onClicked: {
|
||||
ServerSettingsLogic.onPushButtonClearServer()
|
||||
onClicked: {
|
||||
popupClearServer.open()
|
||||
}
|
||||
}
|
||||
|
||||
PopupWithQuestion {
|
||||
id: popupClearServer
|
||||
questionText: "Attention! All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted. Continue?"
|
||||
yesFunc: function() {
|
||||
ServerSettingsLogic.onPushButtonClearServer()
|
||||
close()
|
||||
}
|
||||
noFunc: function() {
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
BlueButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 10
|
||||
text: qsTr("Forget this server")
|
||||
onClicked: {
|
||||
ServerSettingsLogic.onPushButtonForgetServer()
|
||||
popupForgetServer.open()
|
||||
}
|
||||
}
|
||||
|
||||
PopupWithQuestion {
|
||||
id: popupForgetServer
|
||||
questionText: "Attention! This action will not remove the container on the server, it will only remove the container information from the application. Continue?"
|
||||
yesFunc: function() {
|
||||
ServerSettingsLogic.onPushButtonForgetServer()
|
||||
close()
|
||||
}
|
||||
noFunc: function() {
|
||||
close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,9 @@ PageProtocolBase {
|
|||
protocol: ProtocolEnum.Cloak
|
||||
logic: UiLogic.protocolLogic(protocol)
|
||||
|
||||
enabled: logic.pageEnabled
|
||||
BackButton {
|
||||
id: back
|
||||
enabled: logic.pageEnabled
|
||||
enabled: !logic.pushButtonCancelVisible
|
||||
}
|
||||
|
||||
Caption {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ PageProtocolBase {
|
|||
|
||||
BackButton {
|
||||
id: back
|
||||
enabled: logic.pageEnabled
|
||||
enabled: !logic.pushButtonCancelVisible
|
||||
}
|
||||
|
||||
Caption {
|
||||
|
|
@ -285,8 +285,6 @@ PageProtocolBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
|
|
@ -338,8 +336,6 @@ PageProtocolBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
LabelType {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ PageProtocolBase {
|
|||
|
||||
BackButton {
|
||||
id: back
|
||||
enabled: logic.pageEnabled
|
||||
enabled: !logic.pushButtonCancelVisible
|
||||
}
|
||||
|
||||
Caption {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue