Share page reimpl
This commit is contained in:
parent
a89104127a
commit
396af917b5
12 changed files with 298 additions and 286 deletions
90
client/ui/qml/Pages/Share/PageShareProtoAmnezia.qml
Normal file
90
client/ui/qml/Pages/Share/PageShareProtoAmnezia.qml
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
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.Any
|
||||
logic: ShareConnectionLogic
|
||||
|
||||
BackButton {
|
||||
id: back
|
||||
}
|
||||
Caption {
|
||||
id: caption
|
||||
text: qsTr("Share for Amnezia")
|
||||
}
|
||||
|
||||
Text {
|
||||
id: lb_desc
|
||||
anchors.top: caption.bottom
|
||||
anchors.topMargin: 20
|
||||
width: parent.width - 60
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#181922"
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: qsTr("Anyone who logs in with this code will be able to connect to this VPN server. \nThis code does not include server credentials.")
|
||||
}
|
||||
|
||||
TextAreaType {
|
||||
anchors.top: lb_desc.bottom
|
||||
anchors.topMargin: 20
|
||||
anchors.bottom: pb_gen.top
|
||||
anchors.bottomMargin: 20
|
||||
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: parent.width - 60
|
||||
|
||||
textArea.readOnly: true
|
||||
textArea.wrapMode: TextEdit.WrapAnywhere
|
||||
textArea.verticalAlignment: Text.AlignTop
|
||||
textArea.text: ShareConnectionLogic.textEditShareAmneziaCodeText
|
||||
}
|
||||
|
||||
|
||||
ShareConnectionButtonType {
|
||||
id: pb_gen
|
||||
anchors.bottom: pb_copy.top
|
||||
anchors.bottomMargin: 10
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: parent.width - 60
|
||||
text: ShareConnectionLogic.pushButtonShareAmneziaGenerateText
|
||||
enabled: ShareConnectionLogic.pushButtonShareAmneziaGenerateEnabled
|
||||
onClicked: {
|
||||
ShareConnectionLogic.onPushButtonShareAmneziaGenerateClicked()
|
||||
}
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
id: pb_copy
|
||||
anchors.bottom: pb_save.top
|
||||
anchors.bottomMargin: 10
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: parent.width - 60
|
||||
text: ShareConnectionLogic.pushButtonShareAmneziaCopyText
|
||||
onClicked: {
|
||||
ShareConnectionLogic.onPushButtonShareAmneziaCopyClicked()
|
||||
}
|
||||
enabled: ShareConnectionLogic.pushButtonShareAmneziaCopyEnabled
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
id: pb_save
|
||||
anchors.bottom: root.bottom
|
||||
anchors.bottomMargin: 10
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: parent.width - 60
|
||||
text: qsTr("Save file")
|
||||
onClicked: {
|
||||
ShareConnectionLogic.onPushButtonShareAmneziaSaveClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ PageShareProtocolBase {
|
|||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: parent.width - 60
|
||||
text: ShareConnectionLogic.pushButtonShareCloakCopyText
|
||||
enabled: ShareConnectionLogic.pushButtonShareCloakCopyEnabled
|
||||
//enabled: ShareConnectionLogic.pushButtonShareCloakCopyEnabled
|
||||
onClicked: {
|
||||
ShareConnectionLogic.onPushButtonShareCloakCopyClicked()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,4 @@ PageShareProtocolBase {
|
|||
ShareConnectionLogic.onPushButtonShareOpenVpnSaveClicked()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,18 +31,101 @@ PageShareProtocolBase {
|
|||
anchors.right: root.right
|
||||
anchors.rightMargin: 30
|
||||
|
||||
contentHeight: content.height
|
||||
contentHeight: content.height + content2.height + 40
|
||||
clip: true
|
||||
|
||||
ColumnLayout {
|
||||
GridLayout {
|
||||
id: content
|
||||
enabled: logic.pageEnabled
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
columns: 2
|
||||
|
||||
//
|
||||
LabelType {
|
||||
height: 20
|
||||
text: qsTr("Server:")
|
||||
}
|
||||
TextFieldType {
|
||||
height: 20
|
||||
text: ShareConnectionLogic.labelShareShadowSocksServerText
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
//
|
||||
LabelType {
|
||||
height: 20
|
||||
text: qsTr("Port:")
|
||||
}
|
||||
TextFieldType {
|
||||
height: 20
|
||||
text: ShareConnectionLogic.labelShareShadowSocksPortText
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
//
|
||||
LabelType {
|
||||
height: 20
|
||||
text: qsTr("Password")
|
||||
}
|
||||
TextFieldType {
|
||||
height: 20
|
||||
text: ShareConnectionLogic.labelShareShadowSocksPasswordText
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
//
|
||||
LabelType {
|
||||
height: 20
|
||||
text: qsTr("Encryption:")
|
||||
}
|
||||
TextFieldType {
|
||||
height: 20
|
||||
text: ShareConnectionLogic.labelShareShadowSocksMethodText
|
||||
readOnly: true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
ColumnLayout {
|
||||
id: content2
|
||||
enabled: logic.pageEnabled
|
||||
anchors.top: content.bottom
|
||||
anchors.topMargin: 20
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
LabelType {
|
||||
height: 20
|
||||
text: qsTr("Connection string")
|
||||
}
|
||||
TextFieldType {
|
||||
id: tfConnString
|
||||
height: 100
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
text: ShareConnectionLogic.lineEditShareShadowSocksStringText
|
||||
readOnly: true
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
height: 40
|
||||
Layout.fillWidth: true
|
||||
text: ShareConnectionLogic.pushButtonShareShadowSocksCopyText
|
||||
enabled: tfConnString.length > 0
|
||||
onClicked: {
|
||||
ShareConnectionLogic.onPushButtonShareShadowSocksCopyClicked()
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: label_share_ss_qr_code
|
||||
Layout.topMargin: 20
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: width
|
||||
smooth: false
|
||||
source: ShareConnectionLogic.labelShareShadowSocksQrCodeText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue