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

125 lines
3.6 KiB
QML
Raw Normal View History

2021-11-06 13:47:52 +03:00
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.15
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.ShadowSocks
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share ShadowSocks Settings")
}
Flickable {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
2021-11-13 16:09:08 +03:00
anchors.bottom: root.bottom
2021-11-06 13:47:52 +03:00
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
2021-11-15 18:17:28 +03:00
contentHeight: content.height
2021-11-06 13:47:52 +03:00
clip: true
2021-11-15 18:17:28 +03:00
ColumnLayout {
2021-11-06 13:47:52 +03:00
id: content
enabled: logic.pageEnabled
2021-11-17 15:01:48 +03:00
anchors.top: parent.top
2021-11-06 13:47:52 +03:00
anchors.left: parent.left
anchors.right: parent.right
2021-11-08 15:18:52 +03:00
LabelType {
2021-11-15 18:17:28 +03:00
id: lb_desc
Layout.fillWidth: true
Layout.topMargin: 10
2021-11-08 15:18:52 +03:00
2021-11-15 18:17:28 +03:00
horizontalAlignment: Text.AlignHCenter
2021-11-08 15:18:52 +03:00
2021-11-15 18:17:28 +03:00
wrapMode: Text.Wrap
text: qsTr("Note: ShadowSocks protocol using same password for all connections")
2021-11-08 15:18:52 +03:00
}
2021-11-15 18:17:28 +03:00
ShareConnectionButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: genConfigProcess ? generatingConfigText : generateConfigText
onClicked: {
enabled = false
genConfigProcess = true
ShareConnectionLogic.onPushButtonShareShadowSocksGenerateClicked()
enabled = true
genConfigProcess = false
}
2021-11-08 15:18:52 +03:00
}
2021-11-15 18:17:28 +03:00
TextAreaType {
id: tfShareCode
Layout.topMargin: 20
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.wrapMode: TextEdit.WrapAnywhere
textArea.verticalAlignment: Text.AlignTop
textArea.text: ShareConnectionLogic.textEditShareShadowSocksText
visible: tfShareCode.textArea.length > 0
2021-11-08 15:18:52 +03:00
}
2021-11-15 18:17:28 +03:00
ShareConnectionButtonCopyType {
Layout.preferredHeight: 40
Layout.fillWidth: true
Layout.bottomMargin: 20
2021-11-06 13:47:52 +03:00
2021-11-15 18:17:28 +03:00
start_text: qsTr("Copy config")
copyText: tfShareCode.textArea.text
}
2021-11-06 13:47:52 +03:00
2021-11-08 15:18:52 +03:00
LabelType {
height: 20
2021-11-15 18:17:28 +03:00
visible: tfConnString.length > 0
2021-11-08 15:18:52 +03:00
text: qsTr("Connection string")
}
TextFieldType {
id: tfConnString
height: 100
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
text: ShareConnectionLogic.lineEditShareShadowSocksStringText
2021-11-15 18:17:28 +03:00
visible: tfConnString.length > 0
2021-11-08 15:18:52 +03:00
readOnly: true
}
2021-11-13 16:09:08 +03:00
ShareConnectionButtonCopyType {
Layout.preferredHeight: 40
2021-11-08 15:18:52 +03:00
Layout.fillWidth: true
2021-11-15 18:17:28 +03:00
start_text: qsTr("Copy string")
copyText: tfConnString.text
2021-11-08 15:18:52 +03:00
}
Image {
id: label_share_ss_qr_code
Layout.topMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: width
smooth: false
2021-11-13 16:09:08 +03:00
source: ShareConnectionLogic.shareShadowSocksQrCodeText
2021-11-08 15:18:52 +03:00
}
}
}
2021-11-06 13:47:52 +03:00
}