moved ContainersPageHomeListView and ConnectionTypeSelectionDrawer to separate components
This commit is contained in:
parent
acca85b99a
commit
0479113949
23 changed files with 443 additions and 294 deletions
|
@ -2,7 +2,11 @@ import QtQuick
|
|||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import ContainerProps 1.0
|
||||
import ProtocolProps 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
|
@ -11,13 +15,28 @@ import "../Config"
|
|||
Item {
|
||||
id: root
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyContainersModel
|
||||
sourceModel: ContainersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "isEasySetupContainer"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
sorters: RoleSorter {
|
||||
roleName: "dockerContainer"
|
||||
sortOrder: Qt.DescendingOrder
|
||||
}
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: root.top
|
||||
anchors.bottom: root.bottom
|
||||
contentHeight: content.height
|
||||
|
||||
ColumnLayout {
|
||||
Column {
|
||||
id: content
|
||||
|
||||
anchors.top: parent.top
|
||||
|
@ -25,47 +44,91 @@ Item {
|
|||
anchors.right: parent.right
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
anchors.topMargin: 20
|
||||
|
||||
spacing: 16
|
||||
|
||||
HeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
implicitWidth: parent.width
|
||||
anchors.topMargin: 20
|
||||
|
||||
backButtonImage: "qrc:/images/controls/arrow-left.svg"
|
||||
|
||||
headerText: "Какой уровень контроля интернета в вашем регионе?"
|
||||
headerText: qsTr("What is the level of Internet control in your region?")
|
||||
}
|
||||
|
||||
CardType {
|
||||
Layout.fillWidth: true
|
||||
ListView {
|
||||
id: containers
|
||||
width: parent.width
|
||||
height: containers.contentItem.height
|
||||
spacing: 16
|
||||
|
||||
headerText: "Высокий"
|
||||
bodyText: "Многие иностранные сайты и VPN-провайдеры заблокированы"
|
||||
}
|
||||
currentIndex: 1
|
||||
clip: true
|
||||
interactive: false
|
||||
model: proxyContainersModel
|
||||
|
||||
CardType {
|
||||
Layout.fillWidth: true
|
||||
property int dockerContainer
|
||||
property int containerDefaultPort
|
||||
property int containerDefaultTransportProto
|
||||
|
||||
checked: true
|
||||
delegate: Item {
|
||||
implicitWidth: containers.width
|
||||
implicitHeight: delegateContent.implicitHeight
|
||||
|
||||
headerText: "Средний"
|
||||
bodyText: "Некоторые иностранные сайты заблокированы, но VPN-провайдеры не блокируются"
|
||||
}
|
||||
ColumnLayout {
|
||||
id: delegateContent
|
||||
|
||||
CardType {
|
||||
Layout.fillWidth: true
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
headerText: "Низкий"
|
||||
bodyText: "Хочу просто повысить уровень приватности"
|
||||
CardType {
|
||||
id: card
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: easySetupHeader
|
||||
bodyText: easySetupDescription
|
||||
|
||||
ButtonGroup.group: buttonGroup
|
||||
|
||||
onClicked: function() {
|
||||
var defaultContainerProto = ContainerProps.defaultProtocol(dockerContainer)
|
||||
|
||||
containers.dockerContainer = dockerContainer
|
||||
containers.containerDefaultPort = ProtocolProps.defaultPort(defaultContainerProto)
|
||||
containers.containerDefaultTransportProto = ProtocolProps.defaultTransportProto(defaultContainerProto)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (index === containers.currentIndex) {
|
||||
card.checked = true
|
||||
card.clicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ButtonGroup {
|
||||
id: buttonGroup
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 24
|
||||
Layout.bottomMargin: 32
|
||||
implicitWidth: parent.width
|
||||
anchors.topMargin: 24
|
||||
anchors.bottomMargin: 32
|
||||
|
||||
text: qsTr("Продолжить")
|
||||
text: qsTr("Continue")
|
||||
|
||||
onClicked: function() {
|
||||
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
||||
InstallController.install(containers.dockerContainer,
|
||||
containers.containerDefaultPort,
|
||||
containers.containerDefaultTransportProto)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue