2022-10-20 20:09:17 +01:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
2021-09-16 16:19:14 +03:00
|
|
|
import SortFilterProxyModel 0.2
|
2021-09-20 21:51:28 +03:00
|
|
|
import ProtocolEnum 1.0
|
2021-09-09 20:15:44 +03:00
|
|
|
import "./"
|
|
|
|
|
import "../../Controls"
|
|
|
|
|
import "../../Config"
|
|
|
|
|
|
|
|
|
|
Drawer {
|
|
|
|
|
id: root
|
2021-09-20 21:51:28 +03:00
|
|
|
signal containerSelected(int c_index)
|
|
|
|
|
property int selectedIndex: -1
|
2021-09-09 20:15:44 +03:00
|
|
|
|
|
|
|
|
y: 0
|
|
|
|
|
x: 0
|
|
|
|
|
edge: Qt.RightEdge
|
|
|
|
|
width: parent.width * 0.85
|
|
|
|
|
height: parent.height
|
|
|
|
|
|
|
|
|
|
modal: true
|
2021-11-17 15:01:48 +03:00
|
|
|
interactive: activeFocus
|
2021-09-09 20:15:44 +03:00
|
|
|
|
2021-09-16 16:19:14 +03:00
|
|
|
SortFilterProxyModel {
|
|
|
|
|
id: proxyModel
|
|
|
|
|
sourceModel: UiLogic.containersModel
|
|
|
|
|
filters: [
|
|
|
|
|
ValueFilter {
|
|
|
|
|
roleName: "is_installed_role"
|
|
|
|
|
value: false },
|
|
|
|
|
ValueFilter {
|
2021-09-20 21:51:28 +03:00
|
|
|
roleName: "service_type_role"
|
|
|
|
|
value: ProtocolEnum.Vpn }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
|
id: proxyModel_other
|
|
|
|
|
sourceModel: UiLogic.containersModel
|
|
|
|
|
filters: [
|
|
|
|
|
ValueFilter {
|
|
|
|
|
roleName: "is_installed_role"
|
|
|
|
|
value: false },
|
|
|
|
|
ValueFilter {
|
|
|
|
|
roleName: "service_type_role"
|
|
|
|
|
value: ProtocolEnum.Other }
|
2021-09-16 16:19:14 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-09 20:15:44 +03:00
|
|
|
Flickable {
|
|
|
|
|
clip: true
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
contentHeight: col.height
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
id: col
|
|
|
|
|
anchors {
|
|
|
|
|
left: parent.left;
|
|
|
|
|
right: parent.right;
|
|
|
|
|
}
|
|
|
|
|
topPadding: 20
|
|
|
|
|
spacing: 10
|
|
|
|
|
|
|
|
|
|
Caption {
|
|
|
|
|
id: cap1
|
|
|
|
|
text: qsTr("VPN containers")
|
|
|
|
|
font.pixelSize: 20
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
|
id: tb
|
|
|
|
|
x: 10
|
2021-09-20 21:51:28 +03:00
|
|
|
currentIndex: -1
|
|
|
|
|
width: parent.width - 20
|
2021-09-09 20:15:44 +03:00
|
|
|
height: contentItem.height
|
|
|
|
|
|
2021-09-16 16:19:14 +03:00
|
|
|
spacing: 0
|
2021-09-09 20:15:44 +03:00
|
|
|
clip: true
|
|
|
|
|
interactive: false
|
2021-09-16 16:19:14 +03:00
|
|
|
model: proxyModel
|
2021-09-09 20:15:44 +03:00
|
|
|
|
|
|
|
|
delegate: Item {
|
|
|
|
|
implicitWidth: 170 * 2
|
|
|
|
|
implicitHeight: 30
|
|
|
|
|
Item {
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: 30
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
id: c1
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: 1
|
|
|
|
|
color: "lightgray"
|
|
|
|
|
visible: index !== tb.currentIndex
|
|
|
|
|
}
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
color: "#63B4FB"
|
|
|
|
|
visible: index === tb.currentIndex
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
id: text_name
|
2021-09-10 22:19:00 +03:00
|
|
|
text: name_role
|
|
|
|
|
font.pixelSize: 16
|
2021-09-09 20:15:44 +03:00
|
|
|
anchors.fill: parent
|
|
|
|
|
leftPadding: 10
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
2022-12-15 21:16:59 +03:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
2021-09-09 20:15:44 +03:00
|
|
|
onClicked: {
|
|
|
|
|
tb.currentIndex = index
|
2021-09-20 21:51:28 +03:00
|
|
|
tb_other.currentIndex = -1
|
|
|
|
|
containerSelected(proxyModel.mapToSource(index))
|
|
|
|
|
selectedIndex = proxyModel.mapToSource(index)
|
2021-09-09 20:15:44 +03:00
|
|
|
root.close()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-09-20 21:51:28 +03:00
|
|
|
Caption {
|
|
|
|
|
id: cap2
|
|
|
|
|
font.pixelSize: 20
|
|
|
|
|
text: qsTr("Other containers")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
|
id: tb_other
|
|
|
|
|
x: 10
|
|
|
|
|
currentIndex: -1
|
|
|
|
|
width: parent.width - 20
|
|
|
|
|
height: contentItem.height
|
|
|
|
|
|
|
|
|
|
spacing: 0
|
|
|
|
|
clip: true
|
|
|
|
|
interactive: false
|
|
|
|
|
model: proxyModel_other
|
|
|
|
|
|
|
|
|
|
delegate: Item {
|
|
|
|
|
implicitWidth: 170 * 2
|
|
|
|
|
implicitHeight: 30
|
|
|
|
|
Item {
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: 30
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
id: c1_other
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: 1
|
|
|
|
|
color: "lightgray"
|
|
|
|
|
visible: index !== tb_other.currentIndex
|
|
|
|
|
}
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
color: "#63B4FB"
|
|
|
|
|
visible: index === tb_other.currentIndex
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
id: text_name_other
|
|
|
|
|
text: name_role
|
|
|
|
|
font.pixelSize: 16
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
leftPadding: 10
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
2022-12-15 21:16:59 +03:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
2021-09-20 21:51:28 +03:00
|
|
|
onClicked: {
|
|
|
|
|
tb_other.currentIndex = index
|
|
|
|
|
tb.currentIndex = -1
|
|
|
|
|
containerSelected(proxyModel_other.mapToSource(index))
|
|
|
|
|
selectedIndex = proxyModel_other.mapToSource(index)
|
|
|
|
|
root.close()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-09-09 20:15:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|