mirror of
https://github.com/amnezia-vpn/DefaultVPN.git
synced 2026-05-17 08:36:37 +03:00
fix: api config notifications (#27)
* reset notification (temp solution) * added connections * fix: api signal connection * fix: import ApiConfigsController * fix: proper connection target name
This commit is contained in:
@@ -26,6 +26,14 @@ Page {
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ApiConfigsController
|
||||
|
||||
function onReloadServerFromApiFinished(message) {
|
||||
PageController.showNotificationMessage(message)
|
||||
}
|
||||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyServersModel
|
||||
objectName: "proxyServersModel"
|
||||
|
||||
@@ -25,6 +25,10 @@ Page {
|
||||
}
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
|
||||
function onApiConfigRemoved(message) {
|
||||
PageController.showNotificationMessage(message)
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
@@ -96,7 +100,13 @@ Page {
|
||||
hoveredTextColor: Style.color.error
|
||||
pressedTextColor: Style.color.error
|
||||
|
||||
onClicked: resetConfirmationDialog.open()
|
||||
onClicked: {
|
||||
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
|
||||
PageController.showNotificationMessage(qsTr("Cannot reset API config during active connection"))
|
||||
} else {
|
||||
resetConfirmationDialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WhiteButtonWithBorder {
|
||||
@@ -125,13 +135,9 @@ Page {
|
||||
cancelButtonText: qsTr("Cancel")
|
||||
|
||||
onConfirm: function() {
|
||||
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
|
||||
PageController.showNotificationMessage(qsTr("Cannot reset API config during active connection"))
|
||||
} else {
|
||||
PageController.showBusyIndicator(true)
|
||||
InstallController.removeApiConfig(ServersModel.processedIndex)
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
PageController.showBusyIndicator(true)
|
||||
InstallController.removeApiConfig(ServersModel.processedIndex)
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user