Merge pull request #145 from amnezia-vpn/feature/qt6-server-busy-notification

feature/qt6-server-busy-notification
This commit is contained in:
pokamest 2023-01-18 00:43:13 +00:00 committed by GitHub
commit 9d01a52a4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 573 additions and 369 deletions

View file

@ -10,7 +10,6 @@ PageBase {
page: PageEnum.ServerConfiguringProgress
logic: ServerConfiguringProgressLogic
enabled: ServerConfiguringProgressLogic.pageEnabled
Caption {
id: caption
text: qsTr("Configuring...")
@ -27,6 +26,22 @@ PageBase {
horizontalAlignment: Text.AlignHCenter
}
LabelType {
id: labelServerBusy
x: 0
anchors.top: label.bottom
anchors.topMargin: 30
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
width: parent.width - 40
height: 41
text: ServerConfiguringProgressLogic.labelServerBusyText
visible: ServerConfiguringProgressLogic.labelServerBusyVisible
}
LabelType {
anchors.bottom: pr.top
anchors.bottomMargin: 20
@ -40,14 +55,27 @@ PageBase {
visible: ServerConfiguringProgressLogic.labelWaitInfoVisible
}
ProgressBar {
id: pr
BlueButtonType {
id: pb_cancel
z: 1
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: logo.bottom
anchors.bottomMargin: 40
width: parent.width - 40
width: root.width - 60
height: 40
text: qsTr("Cancel")
visible: ServerConfiguringProgressLogic.pushButtonCancelVisible
enabled: ServerConfiguringProgressLogic.pushButtonCancelVisible
onClicked: {
ServerConfiguringProgressLogic.onPushButtonCancelClicked()
}
}
ProgressBar {
id: pr
enabled: ServerConfiguringProgressLogic.pageEnabled
anchors.fill: pb_cancel
from: 0
to: ServerConfiguringProgressLogic.progressBarMaximium
value: ServerConfiguringProgressLogic.progressBarValue

View file

@ -14,6 +14,7 @@ PageProtocolBase {
enabled: logic.pageEnabled
BackButton {
id: back
enabled: logic.pageEnabled
}
Caption {
@ -110,17 +111,24 @@ PageProtocolBase {
}
}
LabelType {
id: label_server_busy
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelServerBusyVisible
text: logic.labelServerBusyText
}
LabelType {
id: label_proto_cloak_info
x: 30
anchors.bottom: pb_save.top
anchors.bottomMargin: 10
width: parent.width - 40
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelInfoVisible
text: logic.labelInfoText
}
ProgressBar {
id: progressBar_proto_cloak_reset
anchors.horizontalCenter: parent.horizontalCenter
@ -146,6 +154,19 @@ PageProtocolBase {
}
}
visible: logic.progressBarResetVisible
LabelType {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: logic.progressBarText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
visible: logic.progressBarTextVisible
}
}
BlueButtonType {
id: pb_save
@ -162,4 +183,13 @@ PageProtocolBase {
}
}
BlueButtonType {
anchors.fill: pb_save
text: qsTr("Cancel")
visible: logic.pushButtonCancelVisible
enabled: logic.pushButtonCancelVisible
onClicked: {
logic.onPushButtonCancelClicked()
}
}
}

View file

@ -13,7 +13,9 @@ PageProtocolBase {
BackButton {
id: back
enabled: logic.pageEnabled
}
Caption {
id: caption
text: qsTr("OpenVPN Settings")
@ -33,16 +35,17 @@ PageProtocolBase {
ColumnLayout {
visible: !logic.isThirdPartyConfig
enabled: logic.pageEnabled
LabelType {
id: lb_subnet
enabled: logic.pageEnabled
height: 21
text: qsTr("VPN Addresses Subnet")
}
TextFieldType {
id: tf_subnet
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 31
text: logic.lineEditSubnetText
@ -51,15 +54,17 @@ PageProtocolBase {
}
}
//
LabelType {
id: lb_proto
enabled: logic.pageEnabled
Layout.topMargin: 20
height: 21
text: qsTr("Network protocol")
}
Rectangle {
id: rect_proto
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 71
border.width: 1
@ -91,8 +96,8 @@ PageProtocolBase {
}
}
//
RowLayout {
enabled: logic.pageEnabled
Layout.topMargin: 10
Layout.fillWidth: true
LabelType {
@ -114,12 +119,9 @@ PageProtocolBase {
}
}
//
CheckBoxType {
id: check_auto_enc
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 21
text: qsTr("Auto-negotiate encryption")
@ -132,15 +134,16 @@ PageProtocolBase {
}
}
//
LabelType {
id: lb_cipher
enabled: logic.pageEnabled
height: 21
text: qsTr("Cipher")
}
ComboBoxType {
id: cb_cipher
enabled: logic.pageEnabled && !check_auto_enc.checked
implicitWidth: parent.width
height: 31
@ -167,18 +170,19 @@ PageProtocolBase {
onCurrentTextChanged: {
logic.comboBoxVpnCipherText = currentText
}
enabled: !check_auto_enc.checked
}
//
LabelType {
id: lb_hash
enabled: logic.pageEnabled
height: 21
Layout.topMargin: 20
text: qsTr("Hash")
}
ComboBoxType {
id: cb_hash
enabled: logic.pageEnabled && !check_auto_enc.checked
height: 31
implicitWidth: parent.width
model: [
@ -204,11 +208,11 @@ PageProtocolBase {
onCurrentTextChanged: {
logic.comboBoxVpnHashText = currentText
}
enabled: !check_auto_enc.checked
}
CheckBoxType {
id: check_tls
enabled: logic.pageEnabled
implicitWidth: parent.width
Layout.topMargin: 20
height: 21
@ -222,6 +226,7 @@ PageProtocolBase {
CheckBoxType {
id: check_block_dns
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 21
text: qsTr("Block DNS requests outside of VPN")
@ -231,10 +236,9 @@ PageProtocolBase {
}
}
BasicButtonType {
id: pb_client_config
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 21
text: qsTr("Additional client config commands →")
@ -259,6 +263,7 @@ PageProtocolBase {
Rectangle {
id: rect_client_conf
enabled: logic.pageEnabled
implicitWidth: root.width - 60
height: 101
border.width: 1
@ -284,10 +289,9 @@ PageProtocolBase {
}
BasicButtonType {
id: pb_server_config
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 21
text: qsTr("Additional server config commands →")
@ -312,6 +316,7 @@ PageProtocolBase {
Rectangle {
id: rect_server_conf
enabled: logic.pageEnabled
implicitWidth: root.width - 60
height: 101
border.width: 1
@ -338,8 +343,21 @@ PageProtocolBase {
}
LabelType {
id: label_proto_openvpn_info
id: label_server_busy
enabled: logic.pageEnabled
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelServerBusyVisible
text: logic.labelServerBusyText
}
LabelType {
id: label_proto_openvpn_info
enabled: logic.pageEnabled
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
height: 41
visible: logic.labelProtoOpenVpnInfoVisible
text: logic.labelProtoOpenVpnInfoText
@ -353,13 +371,25 @@ PageProtocolBase {
BlueButtonType {
id: pb_save
enabled: logic.pageEnabled
z: 1
height: 40
text: qsTr("Save and restart VPN")
width: parent.width
visible: logic.pushButtonSaveVisible
onClicked: {
logic.onPushButtonProtoOpenVpnSaveClicked()
logic.onPushButtonSaveClicked()
}
}
BlueButtonType {
z: 1
anchors.fill: pb_save
text: qsTr("Cancel")
visible: logic.pushButtonCancelVisible
enabled: logic.pushButtonCancelVisible
onClicked: {
logic.onPushButtonCancelClicked()
}
}
@ -389,6 +419,19 @@ PageProtocolBase {
}
}
LabelType {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: logic.progressBarText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
visible: logic.progressBarTextVisible
}
}
}
@ -412,5 +455,4 @@ PageProtocolBase {
}
}
}
}

View file

@ -13,6 +13,7 @@ PageProtocolBase {
BackButton {
id: back
enabled: logic.pageEnabled
}
Caption {
@ -88,27 +89,33 @@ PageProtocolBase {
Item {
Layout.fillHeight: true
}
}
LabelType {
id: label_server_busy
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelServerBusyVisible
text: logic.labelServerBusyText
}
LabelType {
id: label_proto_shadowsocks_info
x: 30
anchors.bottom: pb_save.top
anchors.bottomMargin: 10
width: parent.width - 40
height: 41
visible: logic.labelInfoVisible
text: logic.labelInfoText
LabelType {
id: label_proto_shadowsocks_info
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelInfoVisible
text: logic.labelInfoText
}
}
ProgressBar {
id: progressBar_reset
anchors.fill: pb_save
from: 0
to: logic.progressBaResetMaximium
value: logic.progressBaResetValue
visible: logic.progressBaResetVisible
to: logic.progressBarResetMaximium
value: logic.progressBarResetValue
visible: logic.progressBarResetVisible
background: Rectangle {
implicitWidth: parent.width
implicitHeight: parent.height
@ -126,6 +133,19 @@ PageProtocolBase {
color: Qt.rgba(255, 255, 255, 0.15);
}
}
LabelType {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: logic.progressBarText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
visible: logic.progressBarTextVisible
}
}
BlueButtonType {
@ -142,4 +162,14 @@ PageProtocolBase {
logic.onPushButtonSaveClicked()
}
}
BlueButtonType {
anchors.fill: pb_save
text: qsTr("Cancel")
visible: logic.pushButtonCancelVisible
enabled: logic.pushButtonCancelVisible
onClicked: {
logic.onPushButtonCancelClicked()
}
}
}