2024-08-20 16:54:05 +07:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Dialogs
|
|
|
|
|
|
2025-08-27 15:15:53 +08:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
2024-08-20 16:54:05 +07:00
|
|
|
import PageEnum 1.0
|
|
|
|
|
import Style 1.0
|
|
|
|
|
|
|
|
|
|
import "./"
|
|
|
|
|
import "../Controls2"
|
|
|
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
import "../Config"
|
|
|
|
|
|
|
|
|
|
PageType {
|
|
|
|
|
id: root
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
BackButtonType {
|
|
|
|
|
id: backButton
|
2024-11-26 11:41:17 +07:00
|
|
|
|
2024-08-20 16:54:05 +07:00
|
|
|
anchors.top: parent.top
|
2024-11-26 11:41:17 +07:00
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
2025-08-06 04:35:51 +02:00
|
|
|
Layout.topMargin: 20
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
onActiveFocusChanged: {
|
|
|
|
|
if(backButton.enabled && backButton.activeFocus) {
|
|
|
|
|
listView.positionViewAtBeginning()
|
|
|
|
|
}
|
2024-11-26 11:41:17 +07:00
|
|
|
}
|
|
|
|
|
}
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
ListViewType {
|
|
|
|
|
id: listView
|
2024-12-31 04:16:52 +01:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
anchors.top: backButton.bottom
|
2024-11-26 11:41:17 +07:00
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.topMargin: 16
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
header: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2024-12-31 04:16:52 +01:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
BaseHeaderType {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.bottomMargin: 24
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
headerText: qsTr("VPN by Amnezia")
|
|
|
|
|
descriptionText: qsTr("Choose a VPN service that suits your needs.")
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
spacing: 0
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-27 15:15:53 +08:00
|
|
|
model: SortFilterProxyModel {
|
|
|
|
|
id: proxyApiServicesModel
|
|
|
|
|
|
|
|
|
|
sourceModel: ApiServicesModel
|
|
|
|
|
sorters: RoleSorter {
|
|
|
|
|
roleName: "order"
|
|
|
|
|
sortOrder: Qt.AscendingOrder
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-06 04:35:51 +02:00
|
|
|
|
|
|
|
|
delegate: ColumnLayout {
|
2024-12-31 04:16:52 +01:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
width: listView.width
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
enabled: isServiceAvailable
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
CardWithIconsType {
|
|
|
|
|
id: card
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.bottomMargin: 16
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
headerText: name
|
|
|
|
|
bodyText: cardDescription
|
|
|
|
|
footerText: price
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
onClicked: {
|
|
|
|
|
if (isServiceAvailable) {
|
2025-08-27 15:15:53 +08:00
|
|
|
ApiServicesModel.setServiceIndex(proxyApiServicesModel.mapToSource(index))
|
2025-08-06 04:35:51 +02:00
|
|
|
PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo)
|
2024-08-20 16:54:05 +07:00
|
|
|
}
|
|
|
|
|
}
|
2025-08-06 04:35:51 +02:00
|
|
|
|
|
|
|
|
Keys.onEnterPressed: clicked()
|
|
|
|
|
Keys.onReturnPressed: clicked()
|
2024-08-20 16:54:05 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|