2023-07-14 13:14:50 +09:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
|
|
import PageEnum 1.0
|
|
|
|
|
import ContainerProps 1.0
|
2024-07-07 13:42:38 +03:00
|
|
|
import Style 1.0
|
2023-07-14 13:14:50 +09:00
|
|
|
|
|
|
|
|
import "./"
|
|
|
|
|
import "../Controls2"
|
|
|
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
import "../Config"
|
|
|
|
|
import "../Components"
|
|
|
|
|
|
|
|
|
|
PageType {
|
|
|
|
|
id: root
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
BackButtonType {
|
|
|
|
|
id: backButton
|
2023-07-14 13:14:50 +09:00
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
2026-04-30 14:53:03 +08:00
|
|
|
anchors.topMargin: 20 + PageController.safeAreaTopMargin
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
onFocusChanged: {
|
|
|
|
|
if (this.activeFocus) {
|
|
|
|
|
listView.positionViewAtBeginning()
|
|
|
|
|
}
|
2023-07-14 13:14:50 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
ListViewType {
|
|
|
|
|
id: listView
|
|
|
|
|
|
|
|
|
|
anchors.top: backButton.bottom
|
|
|
|
|
anchors.bottom: parent.bottom
|
2023-07-14 13:14:50 +09:00
|
|
|
anchors.right: parent.right
|
2025-08-06 04:35:51 +02:00
|
|
|
anchors.left: parent.left
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
header: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
BaseHeaderType {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.bottomMargin: 16
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
headerText: ContainersModel.getProcessedContainerName() + qsTr(" settings")
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-18 17:54:55 +04:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
model: ProtocolsModel
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
delegate: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2024-04-18 17:54:55 +04:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
LabelWithButtonType {
|
|
|
|
|
id: button
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
text: qsTr("Show connection options")
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
clickedFunction: function() {
|
|
|
|
|
configContentDrawer.openTriggered()
|
|
|
|
|
}
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: button
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
|
enabled: false
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
DividerType {}
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
DrawerType2 {
|
|
|
|
|
id: configContentDrawer
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
expandedHeight: root.height * 0.9
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
parent: root
|
|
|
|
|
anchors.fill: parent
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
expandedStateContent: Item {
|
|
|
|
|
implicitHeight: configContentDrawer.expandedHeight
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
BackButtonType {
|
|
|
|
|
id: drawerBackButton
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.topMargin: 16
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
backButtonFunction: function() {
|
|
|
|
|
configContentDrawer.closeTriggered()
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-16 15:24:06 +05:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
ListViewType {
|
|
|
|
|
id: drawerListView
|
2024-02-16 15:24:06 +05:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
anchors.top: drawerBackButton.bottom
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.left: parent.left
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
header: ColumnLayout {
|
|
|
|
|
width: drawerListView.width
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
Header2Type {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
headerText: qsTr("Connection options %1").arg(protocolName)
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
model: 1 // fake model to force the ListView to be created without a model
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
delegate: ColumnLayout {
|
|
|
|
|
width: drawerListView.width
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
TextArea {
|
|
|
|
|
id: configText
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
padding: 0
|
|
|
|
|
height: 24
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
color: AmneziaStyle.color.paleGray
|
|
|
|
|
selectionColor: AmneziaStyle.color.richBrown
|
|
|
|
|
selectedTextColor: AmneziaStyle.color.paleGray
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
font.pixelSize: 16
|
|
|
|
|
font.weight: Font.Medium
|
|
|
|
|
font.family: "PT Root UI VF"
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
text: rawConfig
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
wrapMode: Text.Wrap
|
2023-07-14 13:14:50 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
background: Rectangle {
|
|
|
|
|
color: AmneziaStyle.color.transparent
|
2023-07-14 13:14:50 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-06 04:35:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
footer: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2023-07-14 13:14:50 +09:00
|
|
|
|
|
|
|
|
LabelWithButtonType {
|
|
|
|
|
id: removeButton
|
|
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
|
2026-04-30 14:53:03 +08:00
|
|
|
visible: ServersUiController.isProcessedServerHasWriteAccess()
|
2023-10-20 14:10:04 +05:00
|
|
|
|
2024-04-01 20:20:02 +07:00
|
|
|
text: qsTr("Remove ") + ContainersModel.getProcessedContainerName()
|
2024-08-20 16:54:05 +07:00
|
|
|
textColor: AmneziaStyle.color.vibrantRed
|
2023-07-14 13:14:50 +09:00
|
|
|
|
|
|
|
|
clickedFunction: function() {
|
2024-04-01 20:20:02 +07:00
|
|
|
var headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getProcessedContainerName())
|
2024-03-26 20:05:04 +02:00
|
|
|
var descriptionText = qsTr("All users with whom you shared a connection with will no longer be able to connect to it.")
|
2024-02-16 15:24:06 +05:00
|
|
|
var yesButtonText = qsTr("Continue")
|
|
|
|
|
var noButtonText = qsTr("Cancel")
|
2023-07-31 00:13:08 +09:00
|
|
|
|
2024-02-16 15:24:06 +05:00
|
|
|
var yesButtonFunction = function() {
|
2023-09-06 13:37:37 +05:00
|
|
|
PageController.goToPage(PageEnum.PageDeinstalling)
|
2026-05-28 10:57:08 +08:00
|
|
|
InstallController.removeContainer(ServersUiController.processedServerId, ServersUiController.processedContainerIndex)
|
2023-07-31 00:13:08 +09:00
|
|
|
}
|
2025-08-06 04:35:51 +02:00
|
|
|
var noButtonFunction = function() {}
|
2024-02-16 15:24:06 +05:00
|
|
|
|
|
|
|
|
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
2023-07-14 13:14:50 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: removeButton
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
|
enabled: false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DividerType {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|