diff --git a/client/ui/qml/Pages2/PageServiceDnsSettings.qml b/client/ui/qml/Pages2/PageServiceDnsSettings.qml index eb3fb1f8..457c16b4 100644 --- a/client/ui/qml/Pages2/PageServiceDnsSettings.qml +++ b/client/ui/qml/Pages2/PageServiceDnsSettings.qml @@ -68,8 +68,14 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - PageController.goToPage(PageEnum.PageDeinstalling) - InstallController.removeProcessedContainer() + if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected + && SettingsController.isAmneziaDnsEnabled()) { + PageController.showNotificationMessage(qsTr("Cannot remove Amnezia DNS from running server")) + } else + { + PageController.goToPage(PageEnum.PageDeinstalling) + InstallController.removeProcessedContainer() + } } var noButtonFunction = function() { } diff --git a/client/ui/qml/Pages2/PageSettingsApplication.qml b/client/ui/qml/Pages2/PageSettingsApplication.qml index af029b7b..f02224c6 100644 --- a/client/ui/qml/Pages2/PageSettingsApplication.qml +++ b/client/ui/qml/Pages2/PageSettingsApplication.qml @@ -169,8 +169,13 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - SettingsController.clearSettings() - PageController.replaceStartPage() + if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { + PageController.showNotificationMessage(qsTr("Cannot reset settings during active connection")) + } else + { + SettingsController.clearSettings() + PageController.replaceStartPage() + } } var noButtonFunction = function() { } diff --git a/client/ui/qml/Pages2/PageSettingsBackup.qml b/client/ui/qml/Pages2/PageSettingsBackup.qml index 1ba4305a..78969564 100644 --- a/client/ui/qml/Pages2/PageSettingsBackup.qml +++ b/client/ui/qml/Pages2/PageSettingsBackup.qml @@ -135,9 +135,14 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - PageController.showBusyIndicator(true) - SettingsController.restoreAppConfig(filePath) - PageController.showBusyIndicator(false) + if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { + PageController.showNotificationMessage(qsTr("Cannot restore backup settings during active connection")) + } else + { + PageController.showBusyIndicator(true) + SettingsController.restoreAppConfig(filePath) + PageController.showBusyIndicator(false) + } } var noButtonFunction = function() { } diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index 96bda96a..fe121c46 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -116,12 +116,13 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - PageController.showBusyIndicator(true) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { - ConnectionController.closeConnection() + PageController.showNotificationMessage(qsTr("Cannot reboot server during active connection")) + } else { + PageController.showBusyIndicator(true) + InstallController.rebootProcessedServer() + PageController.showBusyIndicator(false) } - InstallController.rebootProcessedServer() - PageController.showBusyIndicator(false) } var noButtonFunction = function() { } @@ -147,12 +148,13 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - PageController.showBusyIndicator(true) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { - ConnectionController.closeConnection() + PageController.showNotificationMessage(qsTr("Cannot remove server during active connection")) + } else { + PageController.showBusyIndicator(true) + InstallController.removeProcessedServer() + PageController.showBusyIndicator(false) } - InstallController.removeProcessedServer() - PageController.showBusyIndicator(false) } var noButtonFunction = function() { } @@ -177,11 +179,12 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - PageController.goToPage(PageEnum.PageDeinstalling) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { - ConnectionController.closeConnection() + PageController.showNotificationMessage(qsTr("Cannot clear server from Amnezia software during active connection")) + } else { + PageController.goToPage(PageEnum.PageDeinstalling) + InstallController.removeAllContainers() } - InstallController.removeAllContainers() } var noButtonFunction = function() { } @@ -208,9 +211,13 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - PageController.showBusyIndicator(true) - InstallController.removeApiConfig() - PageController.showBusyIndicator(false) + if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { + PageController.showNotificationMessage(qsTr("Cannot reset API config during active connection")) + } else { + PageController.showBusyIndicator(true) + InstallController.removeApiConfig() + PageController.showBusyIndicator(false) + } } var noButtonFunction = function() { } diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index aee89cd5..36b8a1df 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -147,8 +147,14 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - PageController.goToPage(PageEnum.PageDeinstalling) - InstallController.removeProcessedContainer() + if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected + && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) { + PageController.showNotificationMessage(qsTr("Cannot remove active container")) + } else + { + PageController.goToPage(PageEnum.PageDeinstalling) + InstallController.removeProcessedContainer() + } } var noButtonFunction = function() { }