mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
update SettingsContainersListView
This commit is contained in:
@@ -16,75 +16,61 @@ import "../Controls2/TextTypes"
|
|||||||
ListViewType {
|
ListViewType {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
width: parent.width
|
anchors.fill: parent
|
||||||
height: root.contentItem.height
|
|
||||||
|
|
||||||
clip: true
|
delegate: ColumnLayout {
|
||||||
reuseItems: true
|
width: root.width
|
||||||
|
|
||||||
property bool isFocusable: false
|
LabelWithButtonType {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
delegate: Item {
|
text: name
|
||||||
implicitWidth: root.width
|
descriptionText: description
|
||||||
implicitHeight: delegateContent.implicitHeight
|
rightImageSource: isInstalled ? "qrc:/images/controls/chevron-right.svg" : "qrc:/images/controls/download.svg"
|
||||||
|
|
||||||
ColumnLayout {
|
clickedFunction: function() {
|
||||||
id: delegateContent
|
if (isInstalled) {
|
||||||
|
var containerIndex = root.model.mapToSource(index)
|
||||||
|
ContainersModel.setProcessedContainerIndex(containerIndex)
|
||||||
|
|
||||||
anchors.fill: parent
|
if (serviceType !== ProtocolEnum.Other) {
|
||||||
|
if (config[ContainerProps.containerTypeToString(containerIndex)]["isThirdPartyConfig"]) {
|
||||||
LabelWithButtonType {
|
|
||||||
id: containerRadioButton
|
|
||||||
implicitWidth: parent.width
|
|
||||||
|
|
||||||
text: name
|
|
||||||
descriptionText: description
|
|
||||||
rightImageSource: isInstalled ? "qrc:/images/controls/chevron-right.svg" : "qrc:/images/controls/download.svg"
|
|
||||||
|
|
||||||
clickedFunction: function() {
|
|
||||||
if (isInstalled) {
|
|
||||||
var containerIndex = root.model.mapToSource(index)
|
|
||||||
ContainersModel.setProcessedContainerIndex(containerIndex)
|
|
||||||
|
|
||||||
if (serviceType !== ProtocolEnum.Other) {
|
|
||||||
if (config[ContainerProps.containerTypeToString(containerIndex)]["isThirdPartyConfig"]) {
|
|
||||||
ProtocolsModel.updateModel(config)
|
|
||||||
PageController.goToPage(PageEnum.PageProtocolRaw)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (containerIndex) {
|
|
||||||
case ContainerEnum.Ipsec: {
|
|
||||||
ProtocolsModel.updateModel(config)
|
ProtocolsModel.updateModel(config)
|
||||||
PageController.goToPage(PageEnum.PageProtocolRaw)
|
PageController.goToPage(PageEnum.PageProtocolRaw)
|
||||||
break
|
return
|
||||||
}
|
}
|
||||||
case ContainerEnum.Dns: {
|
|
||||||
PageController.goToPage(PageEnum.PageServiceDnsSettings)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
ProtocolsModel.updateModel(config)
|
|
||||||
PageController.goToPage(PageEnum.PageSettingsServerProtocol)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
ContainersModel.setProcessedContainerIndex(root.model.mapToSource(index))
|
|
||||||
InstallController.setShouldCreateServer(false)
|
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
switch (containerIndex) {
|
||||||
anchors.fill: parent
|
case ContainerEnum.Ipsec: {
|
||||||
cursorShape: Qt.PointingHandCursor
|
ProtocolsModel.updateModel(config)
|
||||||
enabled: false
|
PageController.goToPage(PageEnum.PageProtocolRaw)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case ContainerEnum.Dns: {
|
||||||
|
PageController.goToPage(PageEnum.PageServiceDnsSettings)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
ProtocolsModel.updateModel(config)
|
||||||
|
PageController.goToPage(PageEnum.PageSettingsServerProtocol)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ContainersModel.setProcessedContainerIndex(root.model.mapToSource(index))
|
||||||
|
InstallController.setShouldCreateServer(false)
|
||||||
|
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DividerType {}
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DividerType {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user