Files

105 lines
2.6 KiB
QML
Raw Permalink Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import ProtocolEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Config"
PageType {
id: root
SortFilterProxyModel {
id: proxyContainersModel
sourceModel: ContainersModel
filters: [
ValueFilter {
roleName: "serviceType"
value: ProtocolEnum.Vpn
},
ValueFilter {
roleName: "isSupported"
value: true
2025-12-11 15:18:36 +08:00
},
ValueFilter {
roleName: "isInstallationAllowed"
value: true
}
]
sorters: RoleSorter {
roleName: "installPageOrder"
sortOrder: Qt.AscendingOrder
}
}
2024-12-31 04:16:52 +01:00
BackButtonType {
id: backButton
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
2025-11-04 11:43:36 +08:00
anchors.topMargin: 20 + SettingsController.safeAreaTopMargin
onActiveFocusChanged: {
if(backButton.enabled && backButton.activeFocus) {
listView.positionViewAtBeginning()
}
}
}
ListViewType {
2024-12-31 04:16:52 +01:00
id: listView
anchors.top: backButton.bottom
anchors.bottom: parent.bottom
2024-12-31 04:16:52 +01:00
anchors.right: parent.right
anchors.left: parent.left
2023-06-05 15:49:10 +08:00
2024-12-31 04:16:52 +01:00
header: ColumnLayout {
width: listView.width
2025-05-02 23:54:36 -07:00
BaseHeaderType {
2024-12-31 04:16:52 +01:00
id: header
2024-12-31 04:16:52 +01:00
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.bottomMargin: 16
2024-12-31 04:16:52 +01:00
headerText: qsTr("VPN protocol")
descriptionText: qsTr("Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP.")
}
2024-12-31 04:16:52 +01:00
}
2024-12-31 04:16:52 +01:00
model: proxyContainersModel
2024-12-31 04:16:52 +01:00
spacing: 0
snapMode: ListView.SnapToItem
2024-12-31 04:16:52 +01:00
delegate: ColumnLayout {
width: listView.width
2024-12-31 04:16:52 +01:00
LabelWithButtonType {
Layout.fillWidth: true
2024-12-31 04:16:52 +01:00
text: name
descriptionText: description
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function () {
ContainersModel.setProcessedContainerIndex(proxyContainersModel.mapToSource(index));
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings);
}
}
2024-12-31 04:16:52 +01:00
DividerType {}
}
}
}