2023-04-14 19:31:10 +03:00
import QtQuick
import QtQuick . Controls
import QtQuick . Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import ProtocolEnum 1.0
2024-08-20 16:54:05 +07:00
import Style 1.0
2023-04-14 19:31:10 +03:00
import "./"
import "../Controls2"
import "../Config"
2023-05-25 15:40:17 +08:00
PageType {
2023-04-14 19:31:10 +03:00
id: root
SortFilterProxyModel {
2023-05-03 19:06:16 +03:00
id: proxyContainersModel
sourceModel: ContainersModel
2023-04-14 19:31:10 +03:00
filters: [
ValueFilter {
2023-05-22 00:10:51 +08:00
roleName: "serviceType"
2023-04-14 19:31:10 +03:00
value: ProtocolEnum . Vpn
2023-05-22 00:10:51 +08:00
} ,
ValueFilter {
roleName: "isSupported"
value: true
2025-12-11 15:18:36 +08:00
} ,
ValueFilter {
roleName: "isInstallationAllowed"
value: true
2023-04-14 19:31:10 +03:00
}
]
2024-07-02 22:00:28 +02:00
sorters: RoleSorter {
roleName: "installPageOrder"
sortOrder: Qt . AscendingOrder
}
2023-04-14 19:31:10 +03:00
}
2024-12-31 04:16:52 +01:00
BackButtonType {
id: backButton
2023-06-30 13:45:11 +09:00
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
2025-08-06 04:35:51 +02:00
onActiveFocusChanged: {
if ( backButton . enabled && backButton . activeFocus ) {
listView . positionViewAtBeginning ( )
}
}
2023-06-30 13:45:11 +09:00
}
2025-08-06 04:35:51 +02:00
ListViewType {
2024-12-31 04:16:52 +01:00
id: listView
anchors.top: backButton . bottom
2023-06-20 10:25:24 +09:00
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
2023-06-30 10:40:43 +09:00
2025-05-02 23:54:36 -07:00
BaseHeaderType {
2024-12-31 04:16:52 +01:00
id: header
2023-06-30 10:40:43 +09:00
2024-12-31 04:16:52 +01:00
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.bottomMargin: 16
2023-06-30 10:40:43 +09:00
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." )
2023-04-14 19:31:10 +03:00
}
2024-12-31 04:16:52 +01:00
}
2023-04-14 19:31:10 +03:00
2024-12-31 04:16:52 +01:00
model: proxyContainersModel
2025-08-06 04:35:51 +02:00
2024-12-31 04:16:52 +01:00
spacing: 0
snapMode: ListView . SnapToItem
2023-04-14 19:31:10 +03:00
2024-12-31 04:16:52 +01:00
delegate: ColumnLayout {
width: listView . width
2023-04-14 19:31:10 +03:00
2024-12-31 04:16:52 +01:00
LabelWithButtonType {
Layout.fillWidth: true
2023-04-14 19:31:10 +03:00
2024-12-31 04:16:52 +01:00
text: name
descriptionText: description
rightImageSource: "qrc:/images/controls/chevron-right.svg"
2023-04-14 19:31:10 +03:00
2025-08-06 04:35:51 +02:00
clickedFunction: function ( ) {
ContainersModel . setProcessedContainerIndex ( proxyContainersModel . mapToSource ( index ) ) ;
PageController . goToPage ( PageEnum . PageSetupWizardProtocolSettings ) ;
2023-04-14 19:31:10 +03:00
}
}
2024-12-31 04:16:52 +01:00
DividerType { }
2023-04-14 19:31:10 +03:00
}
}
}