2024-08-20 16:54:05 +07:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Dialogs
|
|
|
|
|
|
|
|
|
|
import PageEnum 1.0
|
|
|
|
|
import Style 1.0
|
|
|
|
|
|
|
|
|
|
import "./"
|
|
|
|
|
import "../Controls2"
|
|
|
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
import "../Config"
|
|
|
|
|
|
|
|
|
|
PageType {
|
|
|
|
|
id: root
|
|
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
ColumnLayout {
|
|
|
|
|
id: header
|
|
|
|
|
|
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
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
spacing: 0
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
BackButtonType {
|
|
|
|
|
id: backButton
|
|
|
|
|
Layout.topMargin: 20
|
|
|
|
|
}
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-05-02 23:54:36 -07:00
|
|
|
BaseHeaderType {
|
2024-11-26 11:41:17 +07:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 8
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.bottomMargin: 16
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
headerText: qsTr("VPN by Amnezia")
|
|
|
|
|
descriptionText: qsTr("Choose a VPN service that suits your needs.")
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
ListView {
|
|
|
|
|
id: servicesListView
|
2024-12-31 04:16:52 +01:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
anchors.top: header.bottom
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.topMargin: 16
|
|
|
|
|
spacing: 0
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-12-31 04:16:52 +01:00
|
|
|
property bool isFocusable: true
|
|
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
clip: true
|
2024-12-31 04:16:52 +01:00
|
|
|
reuseItems: true
|
|
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
model: ApiServicesModel
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-12-31 04:16:52 +01:00
|
|
|
ScrollBar.vertical: ScrollBarType {}
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
delegate: Item {
|
|
|
|
|
implicitWidth: servicesListView.width
|
|
|
|
|
implicitHeight: delegateContent.implicitHeight
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-12-31 04:16:52 +01:00
|
|
|
enabled: isServiceAvailable
|
|
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
ColumnLayout {
|
|
|
|
|
id: delegateContent
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
anchors.fill: parent
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
CardWithIconsType {
|
|
|
|
|
id: card
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.bottomMargin: 16
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
headerText: name
|
|
|
|
|
bodyText: cardDescription
|
|
|
|
|
footerText: price
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-11-26 11:41:17 +07:00
|
|
|
onClicked: {
|
|
|
|
|
if (isServiceAvailable) {
|
|
|
|
|
ApiServicesModel.setServiceIndex(index)
|
|
|
|
|
PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo)
|
2024-08-20 16:54:05 +07:00
|
|
|
}
|
|
|
|
|
}
|
2024-12-31 04:16:52 +01:00
|
|
|
|
|
|
|
|
Keys.onEnterPressed: clicked()
|
|
|
|
|
Keys.onReturnPressed: clicked()
|
2024-08-20 16:54:05 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|