mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
f9b106cf5b
* fix: fixed country model update * fix: fixed context menu crush on ios * fix: fixed passphrase dialog freeze * fix: fixed country switch * fix: fixed start minimized * fix: fixed black screen after remove container * refactor: return cloak and ss only for view * fix: fixed default server change after improt while connected * fix: divider visibility * fix: fixed revoke admin user * fix: fixed language restore after backup * fix: link hover for tor settings page * fix: fixed openvpn connecntion status * fix: fixed free color status * fix: fixed client config update * chore: bump version
98 lines
2.8 KiB
QML
98 lines
2.8 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
import PageEnum 1.0
|
|
|
|
import "../Controls2"
|
|
import "../Controls2/TextTypes"
|
|
|
|
ListViewType {
|
|
id: menuContent
|
|
|
|
property var rootWidth
|
|
property var selectedText
|
|
|
|
width: rootWidth
|
|
anchors.top: parent.top
|
|
anchors.bottom: parent.bottom
|
|
|
|
ButtonGroup {
|
|
id: containersRadioButtonGroup
|
|
}
|
|
|
|
delegate: Item {
|
|
implicitWidth: rootWidth
|
|
implicitHeight: content.implicitHeight
|
|
|
|
ColumnLayout {
|
|
id: content
|
|
|
|
anchors.fill: parent
|
|
anchors.rightMargin: 16
|
|
anchors.leftMargin: 16
|
|
|
|
VerticalRadioButton {
|
|
id: containerRadioButton
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: name
|
|
descriptionText: description
|
|
|
|
ButtonGroup.group: containersRadioButtonGroup
|
|
|
|
imageSource: "qrc:/images/controls/download.svg"
|
|
showImage: !isInstalled
|
|
|
|
checkable: isInstalled && !ConnectionController.isConnected
|
|
checked: proxyDefaultServerContainersModel.mapToSource(index) === ServersUiController.serverDefaultContainer(ServersUiController.defaultServerId)
|
|
|
|
onClicked: {
|
|
if (ConnectionController.isConnected && isInstalled) {
|
|
PageController.showNotificationMessage(qsTr("Unable change protocol while there is an active connection"))
|
|
return
|
|
}
|
|
|
|
var containerIndex = proxyDefaultServerContainersModel.mapToSource(index)
|
|
|
|
if (!isInstalled) {
|
|
ServersUiController.processedContainerIndex = containerIndex
|
|
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings)
|
|
containersDropDown.closeTriggered()
|
|
return
|
|
}
|
|
|
|
containersDropDown.closeTriggered()
|
|
ServersUiController.setDefaultContainer(ServersUiController.defaultServerId, containerIndex)
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: containerRadioButton
|
|
cursorShape: Qt.PointingHandCursor
|
|
enabled: false
|
|
}
|
|
|
|
Keys.onEnterPressed: {
|
|
if (checkable) {
|
|
checked = true
|
|
}
|
|
containerRadioButton.clicked()
|
|
}
|
|
Keys.onReturnPressed: {
|
|
if (checkable) {
|
|
checked = true
|
|
}
|
|
containerRadioButton.clicked()
|
|
}
|
|
}
|
|
|
|
DividerType {
|
|
Layout.fillWidth: true
|
|
}
|
|
}
|
|
}
|
|
}
|