Files
amnezia-client/client/ui/qml/Pages/Share/PageShareProtoCloak.qml
T

100 lines
2.7 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
2021-11-06 13:47:52 +03:00
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.Cloak
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share Cloak Settings")
}
2022-12-24 16:41:53 +00:00
FlickableType {
2021-11-15 18:17:28 +03:00
id: fl
2021-11-06 13:47:52 +03:00
anchors.top: caption.bottom
2021-11-15 18:17:28 +03:00
contentHeight: content.height
2021-11-06 13:47:52 +03:00
2021-11-15 18:17:28 +03:00
ColumnLayout {
id: content
enabled: logic.pageEnabled
2021-11-17 15:01:48 +03:00
anchors.top: parent.top
2021-11-15 18:17:28 +03:00
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
2021-11-15 18:17:28 +03:00
LabelType {
id: lb_desc
Layout.fillWidth: true
Layout.topMargin: 10
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("Note: Cloak protocol using same password for all connections")
}
ShareConnectionButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: genConfigProcess ? generatingConfigText : generateConfigText
onClicked: {
enabled = false
genConfigProcess = true
ShareConnectionLogic.onPushButtonShareCloakGenerateClicked()
enabled = true
genConfigProcess = false
}
}
TextAreaType {
id: tfShareCode
Layout.topMargin: 20
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: 200
textArea.readOnly: true
textArea.text: ShareConnectionLogic.textEditShareCloakText
visible: tfShareCode.textArea.length > 0
}
ShareConnectionButtonCopyType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
copyText: tfShareCode.textArea.text
}
ShareConnectionButtonType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: Qt.platform.os === "android" ? qsTr("Share") : qsTr("Save to file")
2021-11-15 18:17:28 +03:00
enabled: tfShareCode.textArea.length > 0
visible: tfShareCode.textArea.length > 0
onClicked: {
UiLogic.saveTextFile(qsTr("Save AmneziaVPN config"), "amnezia_config_cloak.json", "*.json", tfShareCode.textArea.text)
2021-11-15 18:17:28 +03:00
}
}
}
2021-11-06 13:47:52 +03:00
}
2021-11-15 18:17:28 +03:00
2021-11-06 13:47:52 +03:00
}