reconnect to server when changed the protocol and status is connected or connnecting

This commit is contained in:
ronoaer 2023-09-12 21:38:36 +08:00
parent f11c65c393
commit f81ee1b267
2 changed files with 15 additions and 1 deletions

View file

@ -62,8 +62,22 @@ ListView {
onClicked: {
if (checked) {
isDefault = true
var needReconnected = false
if (menuContent.currentIndex !== index) {
needReconnected = true
}
menuContent.currentIndex = index
containersDropDown.menuVisible = false
if (needReconnected &&
(ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) {
PageController.showNotificationMessage(qsTr("Reconnect via VPN Procotol: ") + name)
PageController.goToPageHome()
menu.visible = false
ConnectionController.openConnection()
}
} else {
ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index))
InstallController.setShouldCreateServer(false)

View file

@ -210,7 +210,7 @@ PageType {
}
Component.onCompleted: updateContainersModelFilters()
currentIndex: ContainersModel.getDefaultContainer()
currentIndex: ContainersModel.getDefaultContainer() - 1
}
}
}