mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
Merge branch 'dev' into feature/wg-mtu-setup
This commit is contained in:
@@ -138,26 +138,9 @@ Button {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
if (!ApiController.updateServerConfigFromApi()) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!ContainersModel.isAnyContainerInstalled()) {
|
||||
PageController.setTriggeredBtConnectButton(true)
|
||||
|
||||
ServersModel.currentlyProcessedIndex = ServersModel.getDefaultServerIndex()
|
||||
InstallController.setShouldCreateServer(false)
|
||||
PageController.goToPage(PageEnum.PageSetupWizardEasy)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (ConnectionController.isConnectionInProgress) {
|
||||
ConnectionController.closeConnection()
|
||||
} else if (ConnectionController.isConnected) {
|
||||
ConnectionController.closeConnection()
|
||||
} else {
|
||||
ConnectionController.openConnection()
|
||||
if (!ConnectionController.isConnectionInProgress) {
|
||||
ServersModel.setCurrentlyProcessedServerIndex(ServersModel.defaultIndex)
|
||||
ApiController.updateServerConfigFromApi()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,24 +26,6 @@ ListView {
|
||||
id: containersRadioButtonGroup
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onCurrentlyProcessedServerIndexChanged() {
|
||||
if (ContainersModel.getDefaultContainer()) {
|
||||
menuContent.checkCurrentItem()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkCurrentItem() {
|
||||
var item = menuContent.itemAtIndex(currentIndex)
|
||||
if (item !== null) {
|
||||
var radioButton = item.children[0].children[0]
|
||||
radioButton.checked = true
|
||||
}
|
||||
}
|
||||
|
||||
delegate: Item {
|
||||
implicitWidth: rootWidth
|
||||
implicitHeight: content.implicitHeight
|
||||
@@ -69,7 +51,7 @@ ListView {
|
||||
showImage: !isInstalled
|
||||
|
||||
checkable: isInstalled && !ConnectionController.isConnected && isSupported
|
||||
checked: isDefault
|
||||
checked: proxyContainersModel.mapToSource(index) === ServersModel.getDefaultContainer(ServersModel.defaultIndex)
|
||||
|
||||
onClicked: {
|
||||
if (ConnectionController.isConnected && isInstalled) {
|
||||
@@ -79,7 +61,7 @@ ListView {
|
||||
|
||||
if (checked) {
|
||||
containersDropDown.menuVisible = false
|
||||
ServersModel.setDefaultContainer(proxyContainersModel.mapToSource(index))
|
||||
ServersModel.setDefaultContainer(ServersModel.defaultIndex, proxyContainersModel.mapToSource(index))
|
||||
} else {
|
||||
if (!isSupported && isInstalled) {
|
||||
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
|
||||
|
||||
Reference in New Issue
Block a user