port UI Logic to QML
This commit is contained in:
parent
8d36c31cb4
commit
d1a3545912
34 changed files with 4386 additions and 12344 deletions
|
|
@ -3,11 +3,12 @@ import QtQuick.Controls 2.12
|
|||
|
||||
Button {
|
||||
id: root
|
||||
property alias containsMouse: mouseArea.containsMouse
|
||||
hoverEnabled: true
|
||||
property bool containsMouse: hovered
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: false
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
|
||||
Item {
|
||||
|
|
@ -87,6 +88,9 @@ Item {
|
|||
height: 30
|
||||
icon.source: "qrc:/images/plus.png"
|
||||
text: qsTr("Add server")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Start)
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
|
|
@ -95,6 +99,9 @@ Item {
|
|||
height: 30
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
text: qsTr("App settings")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.AppSettings)
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
|
|
@ -103,6 +110,9 @@ Item {
|
|||
height: 30
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
text: qsTr("Exit")
|
||||
onClicked: {
|
||||
Qt.quit()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
|
|
@ -111,6 +121,9 @@ Item {
|
|||
height: 30
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
text: qsTr("Network settings")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.NetworkSettings)
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
|
|
@ -119,6 +132,9 @@ Item {
|
|||
height: 30
|
||||
icon.source: "qrc:/images/server_settings.png"
|
||||
text: qsTr("Server management")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonGeneralSettingsServerSettingsClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
|
|
@ -127,6 +143,9 @@ Item {
|
|||
height: 30
|
||||
icon.source: "qrc:/images/server_settings.png"
|
||||
text: qsTr("Servers")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ServersList)
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
|
|
@ -136,5 +155,8 @@ Item {
|
|||
icon.source: "qrc:/images/share.png"
|
||||
text: qsTr("Share connection")
|
||||
enabled: UiLogic.pushButtonGeneralSettingsShareConnectionEnable
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonGeneralSettingsShareConnectionClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Page 1.0
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
|
||||
Item {
|
||||
|
|
@ -47,7 +47,7 @@ Item {
|
|||
height: 40
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onClicked: {
|
||||
UiLogic.goToPage(Page.Wizard);
|
||||
UiLogic.goToPage(PageEnum.Wizard);
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
|
|
@ -57,7 +57,7 @@ Item {
|
|||
height: 40
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onClicked: {
|
||||
UiLogic.goToPage(Page.NewServerProtocols);
|
||||
UiLogic.goToPage(PageEnum.NewServerProtocols);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ Item {
|
|||
id: root
|
||||
width: GC.screenWidth
|
||||
height: GC.screenHeight
|
||||
enabled: UiLogic.pageNewServerConfiguringEnabled
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
|
|
@ -31,7 +32,8 @@ Item {
|
|||
y: 560
|
||||
width: 301
|
||||
height: 41
|
||||
text: qsTr("Please wait, configuring process may take up to 5 minutes")
|
||||
text: UiLogic.labelNewServerConfiguringWaitInfoText
|
||||
visible: UiLogic.labelNewServerConfiguringWaitInfoVisible
|
||||
}
|
||||
ProgressBar {
|
||||
id: pr
|
||||
|
|
@ -40,8 +42,9 @@ Item {
|
|||
width: 301
|
||||
height: 40
|
||||
from: 0
|
||||
to: 100
|
||||
to: UiLogic.progressBarNewServerConfiguringMaximium
|
||||
value: UiLogic.progressBarNewServerConfiguringValue
|
||||
visible: UiLogic.progressBarNewServerConfiguringVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
|
|
@ -62,12 +65,13 @@ Item {
|
|||
|
||||
LabelType {
|
||||
anchors.fill: parent
|
||||
text: qsTr("Configuring...")
|
||||
text: UiLogic.progressBarNewServerConfiguringText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#D4D4D4"
|
||||
visible: UiLogic.progressBarNewServerConfiguringTextVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ Item {
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: false
|
||||
radius: 2
|
||||
Grid {
|
||||
anchors.fill: parent
|
||||
|
|
@ -164,6 +165,11 @@ Item {
|
|||
checked: UiLogic.pushButtonNewServerSettingsCloakChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonNewServerSettingsCloakChecked = checked
|
||||
if (checked) {
|
||||
frame_new_server_setting_cloak.visible = true
|
||||
} else {
|
||||
frame_new_server_setting_cloak.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -186,6 +192,7 @@ Item {
|
|||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
radius: 2
|
||||
visible: false
|
||||
Grid {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
|
|
@ -258,8 +265,14 @@ Item {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
checked: UiLogic.pushButtonNewServerSettingsSsChecked
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonNewServerSettingsSsChecked = checked
|
||||
if (checked) {
|
||||
frame_new_server_settings_ss.visible = true
|
||||
} else {
|
||||
frame_new_server_settings_ss.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -282,6 +295,7 @@ Item {
|
|||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
radius: 2
|
||||
visible: false
|
||||
Grid {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
|
|
@ -351,8 +365,14 @@ Item {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
checked: UiLogic.pushButtonNewServerSettingsOpenvpnChecked
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonNewServerSettingsOpenvpnChecked = checked
|
||||
if (checked) {
|
||||
frame_new_server_settings_openvpn.visible = true
|
||||
} else {
|
||||
frame_new_server_settings_openvpn.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -377,6 +397,7 @@ Item {
|
|||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
radius: 2
|
||||
visible: false
|
||||
Grid {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
|
|
@ -414,6 +435,14 @@ Item {
|
|||
height: 35
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
frame_new_server_settings_wireguard.visible = true
|
||||
} else {
|
||||
frame_new_server_settings_wireguard.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ Item {
|
|||
id: root
|
||||
width: GC.screenWidth
|
||||
height: GC.screenHeight
|
||||
enabled: UiLogic.pageProtoCloakEnabled
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
|
|
@ -22,6 +23,7 @@ Item {
|
|||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: UiLogic.widgetProtoCloakEnabled
|
||||
ComboBoxType {
|
||||
x: 190
|
||||
y: 60
|
||||
|
|
@ -86,6 +88,8 @@ Item {
|
|||
y: 550
|
||||
width: 321
|
||||
height: 41
|
||||
visible: UiLogic.labelProtoCloakInfoVisible
|
||||
text: UiLogic.labelProtoCloakInfoText
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_cloak_port
|
||||
|
|
@ -97,6 +101,7 @@ Item {
|
|||
onEditingFinished: {
|
||||
UiLogic.lineEditProtoCloakPortText = text
|
||||
}
|
||||
enabled: UiLogic.lineEditProtoCloakPortEnabled
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_cloak_site
|
||||
|
|
@ -116,8 +121,8 @@ Item {
|
|||
width: 321
|
||||
height: 40
|
||||
from: 0
|
||||
to: 100
|
||||
value: 0
|
||||
to: UiLogic.progressBarProtoCloakResetMaximium
|
||||
value: UiLogic.progressBarProtoCloakResetValue
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
|
|
@ -135,6 +140,7 @@ Item {
|
|||
color: Qt.rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
}
|
||||
visible: UiLogic.progressBarProtoCloakResetVisible
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
|
@ -142,6 +148,10 @@ Item {
|
|||
width: 321
|
||||
height: 40
|
||||
text: qsTr("Save and restart VPN")
|
||||
visible: UiLogic.pushButtonProtoCloakSaveVisible
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoCloakSaveClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ Item {
|
|||
id: root
|
||||
width: GC.screenWidth
|
||||
height: GC.screenHeight
|
||||
enabled: UiLogic.pageProtoOpenvpnEnabled
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
|
|
@ -22,6 +23,7 @@ Item {
|
|||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: UiLogic.widgetProtoOpenvpnEnabled
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 280
|
||||
|
|
@ -32,6 +34,9 @@ Item {
|
|||
onCheckedChanged: {
|
||||
UiLogic.checkBoxProtoOpenvpnAutoEncryptionChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.checkBoxProtoOpenvpnAutoEncryptionClicked()
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
|
|
@ -84,6 +89,7 @@ Item {
|
|||
onCurrentTextChanged: {
|
||||
UiLogic.comboBoxProtoOpenvpnCipherText = currentText
|
||||
}
|
||||
enabled: UiLogic.comboBoxProtoOpenvpnCipherEnabled
|
||||
}
|
||||
ComboBoxType {
|
||||
x: 200
|
||||
|
|
@ -113,6 +119,7 @@ Item {
|
|||
onCurrentTextChanged: {
|
||||
UiLogic.comboBoxProtoOpenvpnHashText = currentText
|
||||
}
|
||||
enabled: UiLogic.comboBoxProtoOpenvpnHashEnabled
|
||||
}
|
||||
Rectangle {
|
||||
x: 30
|
||||
|
|
@ -128,6 +135,11 @@ Item {
|
|||
width: 171
|
||||
height: 19
|
||||
text: qsTr("TCP")
|
||||
enabled: UiLogic.radioButtonProtoOpenvpnTcpEnabled
|
||||
checked: UiLogic.radioButtonProtoOpenvpnTcpChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonProtoOpenvpnTcpChecked = checked
|
||||
}
|
||||
}
|
||||
RadioButtonType {
|
||||
x: 10
|
||||
|
|
@ -139,6 +151,7 @@ Item {
|
|||
onCheckedChanged: {
|
||||
UiLogic.radioButtonProtoOpenvpnUdpChecked = checked
|
||||
}
|
||||
enabled: UiLogic.radioButtonProtoOpenvpnUdpEnabled
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
|
|
@ -195,6 +208,8 @@ Item {
|
|||
y: 550
|
||||
width: 321
|
||||
height: 41
|
||||
visible: UiLogic.labelProtoOpenvpnInfoVisible
|
||||
text: UiLogic.labelProtoOpenvpnInfoText
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_openvpn_port
|
||||
|
|
@ -206,6 +221,7 @@ Item {
|
|||
onEditingFinished: {
|
||||
UiLogic.lineEditProtoOpenvpnPortText = text
|
||||
}
|
||||
enabled: UiLogic.lineEditProtoOpenvpnPortEnabled
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_openvpn_subnet
|
||||
|
|
@ -225,8 +241,9 @@ Item {
|
|||
width: 321
|
||||
height: 40
|
||||
from: 0
|
||||
to: 100
|
||||
value: 0
|
||||
to: UiLogic.progressBarProtoOpenvpnResetMaximium
|
||||
value: UiLogic.progressBarProtoOpenvpnResetValue
|
||||
visible: UiLogic.progressBarProtoOpenvpnResetVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
|
|
@ -251,6 +268,10 @@ Item {
|
|||
width: 321
|
||||
height: 40
|
||||
text: qsTr("Save and restart VPN")
|
||||
visible: UiLogic.pushButtonProtoOpenvpnSaveVisible
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoOpenvpnSaveClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ Item {
|
|||
id: root
|
||||
width: GC.screenWidth
|
||||
height: GC.screenHeight
|
||||
enabled: UiLogic.pageProtoShadowsocksEnabled
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
|
|
@ -22,6 +23,7 @@ Item {
|
|||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: UiLogic.widgetProtoSsEnabled
|
||||
ComboBoxType {
|
||||
x: 190
|
||||
y: 60
|
||||
|
|
@ -77,6 +79,8 @@ Item {
|
|||
y: 550
|
||||
width: 321
|
||||
height: 41
|
||||
visible: UiLogic.labelProtoShadowsocksInfoVisible
|
||||
text: UiLogic.labelProtoShadowsocksInfoText
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_shadowsocks_port
|
||||
|
|
@ -88,6 +92,7 @@ Item {
|
|||
onEditingFinished: {
|
||||
UiLogic.lineEditProtoShadowsocksPortText = text
|
||||
}
|
||||
enabled: UiLogic.lineEditProtoShadowsocksPortEnabled
|
||||
}
|
||||
ProgressBar {
|
||||
id: progressBar_proto_shadowsocks_reset
|
||||
|
|
@ -96,8 +101,9 @@ Item {
|
|||
width: 321
|
||||
height: 40
|
||||
from: 0
|
||||
to: 100
|
||||
value: 0
|
||||
to: UiLogic.progressBarProtoShadowsocksResetMaximium
|
||||
value: UiLogic.progressBarProtoShadowsocksResetValue
|
||||
visible: UiLogic.progressBarProtoShadowsocksResetVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
|
|
@ -122,6 +128,10 @@ Item {
|
|||
width: 321
|
||||
height: 40
|
||||
text: qsTr("Save and restart VPN")
|
||||
visible: UiLogic.pushButtonProtoShadowsocksSaveVisible
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoShadowsocksSaveClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import QtQuick 2.12
|
|||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import QtGraphicalEffects 1.12
|
||||
import PageEnum 1.0
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
|
@ -37,34 +38,38 @@ Item {
|
|||
width: 24
|
||||
height: 24
|
||||
icon.source: "qrc:/images/plus.png"
|
||||
}
|
||||
ListModel {
|
||||
id: md
|
||||
ListElement {
|
||||
description: "Bill Smith"
|
||||
address: "555 3264"
|
||||
}
|
||||
ListElement {
|
||||
description: "John Brown"
|
||||
address: "555 8426"
|
||||
}
|
||||
ListElement {
|
||||
description: "Sam Wise"
|
||||
address: "555 0473"
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Start);
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: listWidget_servers
|
||||
x: 20
|
||||
y: 90
|
||||
width: 340
|
||||
height: 501
|
||||
model: md
|
||||
model: UiLogic.serverListModel
|
||||
spacing: 5
|
||||
delegate: Item {
|
||||
height: 60
|
||||
width: 341
|
||||
MouseArea {
|
||||
id: ms
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
listWidget_servers.currentIndex = index
|
||||
mouse.accepted = false
|
||||
}
|
||||
onEntered: {
|
||||
mouseExitAni.stop()
|
||||
mouseEnterAni.start()
|
||||
}
|
||||
onExited: {
|
||||
mouseEnterAni.stop()
|
||||
mouseExitAni.start()
|
||||
}
|
||||
}
|
||||
LinearGradient {
|
||||
visible: !ms.containsMouse
|
||||
anchors.fill: parent
|
||||
|
|
@ -106,7 +111,7 @@ Item {
|
|||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: description
|
||||
text: desc
|
||||
}
|
||||
ImageButtonType {
|
||||
x: 212
|
||||
|
|
@ -117,6 +122,7 @@ Item {
|
|||
iconMargin: 0
|
||||
icon.source: checked ? "qrc:/images/connect_button_connected.png"
|
||||
: "qrc:/images/connect_button_disconnected.png"
|
||||
visible: false
|
||||
}
|
||||
ImageButtonType {
|
||||
x: 300
|
||||
|
|
@ -126,21 +132,39 @@ Item {
|
|||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/check.png"
|
||||
: "qrc:/images/uncheck.png"
|
||||
onClicked: {
|
||||
UiLogic.onServerListPushbuttonDefaultClicked(index)
|
||||
}
|
||||
checked: is_default
|
||||
enabled: !is_default
|
||||
}
|
||||
ImageButtonType {
|
||||
id: pushButtonSetting
|
||||
x: 260
|
||||
y: 25
|
||||
width: 24
|
||||
height: 24
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
}
|
||||
MouseArea {
|
||||
id: ms
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
listWidget_servers.currentIndex = index
|
||||
mouse.accepted = false
|
||||
UiLogic.onServerListPushbuttonSettingsClicked(index)
|
||||
}
|
||||
OpacityAnimator {
|
||||
id: mouseEnterAni
|
||||
target: pushButtonSetting;
|
||||
from: 0;
|
||||
to: 1;
|
||||
duration: 150
|
||||
running: false
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
OpacityAnimator {
|
||||
id: mouseExitAni
|
||||
target: pushButtonSetting;
|
||||
from: 1;
|
||||
to: 0;
|
||||
duration: 150
|
||||
running: false
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ Item {
|
|||
id: root
|
||||
width: GC.screenWidth
|
||||
height: GC.screenHeight
|
||||
enabled: UiLogic.pageServerProtocolsEnabled
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
|
|
@ -37,8 +38,9 @@ Item {
|
|||
width: 301
|
||||
height: 40
|
||||
from: 0
|
||||
to: 100
|
||||
value: 0
|
||||
to: UiLogic.progressBarProtocolsContainerReinstallMaximium
|
||||
value: UiLogic.progressBarProtocolsContainerReinstallValue
|
||||
visible: UiLogic.progressBarProtocolsContainerReinstallVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
|
|
@ -83,6 +85,7 @@ Item {
|
|||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
visible: UiLogic.frameOpenvpnSsCloakSettingsVisible
|
||||
Item {
|
||||
x: 5
|
||||
y: 5
|
||||
|
|
@ -102,6 +105,15 @@ Item {
|
|||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
width: 24
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoCloakOpenvpnContDefaultChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContDefaultChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContDefaultClicked(checked)
|
||||
}
|
||||
|
||||
visible: UiLogic.pushButtonProtoCloakOpenvpnContDefaultVisible
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
|
|
@ -111,6 +123,10 @@ Item {
|
|||
icon.source: "qrc:/images/share.png"
|
||||
width: 24
|
||||
height: 24
|
||||
visible: UiLogic.pushButtonProtoCloakOpenvpnContShareVisible
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContShareClicked(false)
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: cn1
|
||||
|
|
@ -120,6 +136,14 @@ Item {
|
|||
: "qrc:/images/connect_button_disconnected.png"
|
||||
width: 36
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoCloakOpenvpnContInstallChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContInstallChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContInstallClicked(checked)
|
||||
}
|
||||
enabled: UiLogic.pushButtonProtoCloakOpenvpnContInstallEnabled
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
|
|
@ -137,6 +161,9 @@ Item {
|
|||
height: 24
|
||||
text: qsTr("OpenVPN settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContOpenvpnConfigClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
|
|
@ -145,6 +172,9 @@ Item {
|
|||
height: 24
|
||||
text: qsTr("ShadowSocks settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContSsConfigClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
|
|
@ -153,6 +183,9 @@ Item {
|
|||
height: 24
|
||||
text: qsTr("Cloak settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContCloakConfigClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -164,6 +197,7 @@ Item {
|
|||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
visible: UiLogic.frameOpenvpnSsSettingsVisible
|
||||
Item {
|
||||
x: 5
|
||||
y: 5
|
||||
|
|
@ -183,6 +217,15 @@ Item {
|
|||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
width: 24
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoSsOpenvpnContDefaultChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContDefaultChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContDefaultClicked(checked)
|
||||
}
|
||||
|
||||
visible: UiLogic.pushButtonProtoSsOpenvpnContDefaultVisible
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
|
|
@ -192,6 +235,10 @@ Item {
|
|||
icon.source: "qrc:/images/share.png"
|
||||
width: 24
|
||||
height: 24
|
||||
visible: UiLogic.pushButtonProtoSsOpenvpnContShareVisible
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContShareClicked(false)
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: cn2
|
||||
|
|
@ -201,6 +248,14 @@ Item {
|
|||
: "qrc:/images/connect_button_disconnected.png"
|
||||
width: 36
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoSsOpenvpnContInstallChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContInstallChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContInstallClicked(checked)
|
||||
}
|
||||
enabled: UiLogic.pushButtonProtoSsOpenvpnContInstallEnabled
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
|
|
@ -218,6 +273,9 @@ Item {
|
|||
height: 24
|
||||
text: qsTr("OpenVPN settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContOpenvpnConfigClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
|
|
@ -226,6 +284,9 @@ Item {
|
|||
height: 24
|
||||
text: qsTr("ShadowSocks settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContSsConfigClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -237,6 +298,7 @@ Item {
|
|||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
visible: UiLogic.frameOpenvpnSettingsVisible
|
||||
Item {
|
||||
x: 5
|
||||
y: 5
|
||||
|
|
@ -256,6 +318,15 @@ Item {
|
|||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
width: 24
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoOpenvpnContDefaultChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoOpenvpnContDefaultChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoOpenvpnContDefaultClicked(checked)
|
||||
}
|
||||
|
||||
visible: UiLogic.pushButtonProtoOpenvpnContDefaultVisible
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
|
|
@ -265,6 +336,10 @@ Item {
|
|||
icon.source: "qrc:/images/share.png"
|
||||
width: 24
|
||||
height: 24
|
||||
visible: UiLogic.pushButtonProtoOpenvpnContShareVisible
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoOpenvpnContShareClicked(false)
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: cn3
|
||||
|
|
@ -274,6 +349,14 @@ Item {
|
|||
: "qrc:/images/connect_button_disconnected.png"
|
||||
width: 36
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoOpenvpnContInstallChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoOpenvpnContInstallChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoOpenvpnContInstallClicked(checked)
|
||||
}
|
||||
enabled: UiLogic.pushButtonProtoOpenvpnContInstallEnabled
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
|
|
@ -291,6 +374,9 @@ Item {
|
|||
height: 24
|
||||
text: qsTr("OpenVPN settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoOpenvpnContOpenvpnConfigClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -322,6 +408,15 @@ Item {
|
|||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
width: 24
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoWireguardContDefaultChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoWireguardContDefaultChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoWireguardContDefaultClicked(checked)
|
||||
}
|
||||
|
||||
visible: UiLogic.pushButtonProtoWireguardContDefaultVisible
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
|
|
@ -331,6 +426,10 @@ Item {
|
|||
icon.source: "qrc:/images/share.png"
|
||||
width: 24
|
||||
height: 24
|
||||
visible: UiLogic.pushButtonProtoWireguardContShareVisible
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoWireguardContShareClicked(false)
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: cn4
|
||||
|
|
@ -340,6 +439,14 @@ Item {
|
|||
: "qrc:/images/connect_button_disconnected.png"
|
||||
width: 36
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoWireguardContInstallChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoWireguardContInstallChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoWireguardContInstallClicked(checked)
|
||||
}
|
||||
enabled: UiLogic.pushButtonProtoWireguardContInstallEnabled
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import PageEnum 1.0
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: GC.screenWidth
|
||||
height: GC.screenHeight
|
||||
enabled: UiLogic.pageServerSettingsEnabled
|
||||
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
|
|
@ -72,6 +75,7 @@ Item {
|
|||
text: UiLogic.lineEditServerSettingsDescriptionText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditServerSettingsDescriptionText = text
|
||||
UiLogic.onLineEditServerSettingsDescriptionEditingFinished()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
|
|
@ -79,16 +83,22 @@ Item {
|
|||
y: 410
|
||||
width: 300
|
||||
height: 40
|
||||
text: qsTr("Clear server from Amnezia software")
|
||||
text: UiLogic.pushButtonServerSettingsClearText
|
||||
visible: UiLogic.pushButtonServerSettingsClearVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonClearServer()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 350
|
||||
width: 300
|
||||
height: 40
|
||||
text: qsTr("Clear client cached profile")
|
||||
text: UiLogic.pushButtonServerSettingsClearClientCacheText
|
||||
visible: UiLogic.pushButtonServerSettingsClearClientCacheVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonServerSettingsClearClientCacheClicked()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
|
@ -96,6 +106,9 @@ Item {
|
|||
width: 300
|
||||
height: 40
|
||||
text: qsTr("Forget this server")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonForgetServer()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
|
@ -103,6 +116,9 @@ Item {
|
|||
width: 300
|
||||
height: 40
|
||||
text: qsTr("VPN protocols")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ServerVpnProtocols)
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
|
@ -111,5 +127,8 @@ Item {
|
|||
height: 40
|
||||
text: qsTr("Share Server (FULL ACCESS)")
|
||||
visible: UiLogic.pushButtonServerSettingsShareFullVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonServerSettingsShareFullClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Page 1.0
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
|
||||
Item {
|
||||
|
|
@ -74,11 +74,11 @@ Item {
|
|||
text: qsTr("Next")
|
||||
onClicked: {
|
||||
if (radioButton_setup_wizard_high.checked) {
|
||||
UiLogic.goToPage(Page.WizardHigh);
|
||||
UiLogic.goToPage(PageEnum.WizardHigh);
|
||||
} else if (radioButton_setup_wizard_medium.checked) {
|
||||
UiLogic.goToPage(Page.WizardMedium);
|
||||
UiLogic.goToPage(PageEnum.WizardMedium);
|
||||
} else if (radioButton_setup_wizard_low.checked) {
|
||||
UiLogic.goToPage(Page.WizardLow);
|
||||
UiLogic.goToPage(PageEnum.WizardLow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Page 1.0
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
|
||||
Item {
|
||||
|
|
@ -90,7 +90,7 @@ Item {
|
|||
if (!domain || !domain.includes(".")) {
|
||||
return
|
||||
}
|
||||
UiLogic.goToPage(Page.WizardVpnMode)
|
||||
UiLogic.goToPage(PageEnum.WizardVpnMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Page 1.0
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
|
||||
Item {
|
||||
|
|
@ -60,7 +60,7 @@ Item {
|
|||
height: 40
|
||||
text: qsTr("Next")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(Page.WizardVpnMode)
|
||||
UiLogic.goToPage(PageEnum.WizardVpnMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,10 +34,23 @@ Item {
|
|||
share_shadowshock,
|
||||
share_cloak
|
||||
]
|
||||
property int currentIndex: UiLogic.toolBoxShareConnectionCurrentIndex
|
||||
onCurrentIndexChanged: {
|
||||
UiLogic.toolBoxShareConnectionCurrentIndex = currentIndex
|
||||
for (let i = 0; i < contentList.length; ++i) {
|
||||
if (i == currentIndex) {
|
||||
contentList[i].active = true
|
||||
} else {
|
||||
contentList[i].active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clearActive() {
|
||||
for (let i = 0; i < contentList.length; ++i) {
|
||||
contentList[i].active = false
|
||||
}
|
||||
currentIndex = -1;
|
||||
}
|
||||
Column {
|
||||
spacing: 5
|
||||
|
|
@ -45,6 +58,7 @@ Item {
|
|||
id: full_access
|
||||
x: 0
|
||||
text: qsTr("Full access")
|
||||
visible: UiLogic.pageShareFullAccessVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
|
|
@ -68,7 +82,10 @@ Item {
|
|||
y: 130
|
||||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Copy")
|
||||
text: UiLogic.pushButtonShareFullCopyText
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareFullCopyClicked()
|
||||
}
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
|
|
@ -76,6 +93,9 @@ Item {
|
|||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Save file")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareFullSaveClicked()
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
x: 10
|
||||
|
|
@ -83,15 +103,19 @@ Item {
|
|||
width: 341
|
||||
height: 100
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: UiLogic.textEditShareFullCodeText
|
||||
onEditingFinished: {
|
||||
UiLogic.textEditShareFullCodeText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
active = false
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
active = true
|
||||
ct.currentIndex = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -99,6 +123,7 @@ Item {
|
|||
id: share_amezia
|
||||
x: 0
|
||||
text: qsTr("Share for Amnezia client")
|
||||
visible: UiLogic.pageShareAmneziaVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
|
|
@ -122,14 +147,22 @@ Item {
|
|||
y: 180
|
||||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Copy")
|
||||
text: UiLogic.pushButtonShareAmneziaCopyText
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareAmneziaCopyClicked()
|
||||
}
|
||||
enabled: UiLogic.pushButtonShareAmneziaCopyEnabled
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 130
|
||||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Generate config")
|
||||
text: UiLogic.pushButtonShareAmneziaGenerateText
|
||||
enabled: UiLogic.pushButtonShareAmneziaGenerateEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareAmneziaGenerateClicked()
|
||||
}
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
|
|
@ -137,6 +170,9 @@ Item {
|
|||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Save file")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareAmneziaSaveClicked()
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
x: 10
|
||||
|
|
@ -144,15 +180,19 @@ Item {
|
|||
width: 341
|
||||
height: 100
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: UiLogic.textEditShareAmneziaCodeText
|
||||
onEditingFinished: {
|
||||
UiLogic.textEditShareAmneziaCodeText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
active = false
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
active = true
|
||||
ct.currentIndex = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -160,6 +200,7 @@ Item {
|
|||
id: share_openvpn
|
||||
x: 0
|
||||
text: qsTr("Share for OpenVPN client")
|
||||
visible: UiLogic.pageShareOpenvpnVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
|
|
@ -169,14 +210,22 @@ Item {
|
|||
y: 180
|
||||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Copy")
|
||||
text: UiLogic.pushButtonShareOpenvpnCopyText
|
||||
enabled: UiLogic.pushButtonShareOpenvpnCopyEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareOpenvpnCopyClicked()
|
||||
}
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 130
|
||||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Generate config")
|
||||
text: UiLogic.pushButtonShareOpenvpnGenerateText
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareOpenvpnGenerateClicked()
|
||||
}
|
||||
enabled: UiLogic.pushButtonShareOpenvpnGenerateEnabled
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
|
|
@ -184,6 +233,10 @@ Item {
|
|||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Save file")
|
||||
enabled: UiLogic.pushButtonShareOpenvpnSaveEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareOpenvpnSaveClicked()
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
x: 10
|
||||
|
|
@ -191,15 +244,19 @@ Item {
|
|||
width: 341
|
||||
height: 100
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: UiLogic.textEditShareOpenvpnCodeText
|
||||
onEditingFinished: {
|
||||
UiLogic.textEditShareOpenvpnCodeText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
active = false
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
active = true
|
||||
ct.currentIndex = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -207,6 +264,7 @@ Item {
|
|||
id: share_shadowshock
|
||||
x: 0
|
||||
text: qsTr("Share for ShadowSocks client")
|
||||
visible: UiLogic.pageShareShadowsocksVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
|
|
@ -251,28 +309,28 @@ Item {
|
|||
y: 70
|
||||
width: 100
|
||||
height: 20
|
||||
text: qsTr("Password")
|
||||
text: UiLogic.labelShareSsPasswordText
|
||||
}
|
||||
LabelType {
|
||||
x: 130
|
||||
y: 10
|
||||
width: 100
|
||||
height: 20
|
||||
text: qsTr("Server:")
|
||||
text: UiLogic.labelShareSsServerText
|
||||
}
|
||||
LabelType {
|
||||
x: 130
|
||||
y: 50
|
||||
width: 100
|
||||
height: 20
|
||||
text: qsTr("Encryption:")
|
||||
text: UiLogic.labelShareSsMethodText
|
||||
}
|
||||
LabelType {
|
||||
x: 130
|
||||
y: 30
|
||||
width: 100
|
||||
height: 20
|
||||
text: qsTr("Port:")
|
||||
text: UiLogic.labelShareSsPortText
|
||||
}
|
||||
Image {
|
||||
id: label_share_ss_qr_code
|
||||
|
|
@ -280,15 +338,18 @@ Item {
|
|||
y: 235
|
||||
width: 200
|
||||
height: 200
|
||||
|
||||
// source: "file"
|
||||
source: UiLogic.labelShareSsQrCodeText == "" ? "" : "data:image/png;base64," + UiLogic.labelShareSsQrCodeText
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 180
|
||||
width: 331
|
||||
height: 40
|
||||
text: qsTr("Copy")
|
||||
text: UiLogic.pushButtonShareSsCopyText
|
||||
enabled: UiLogic.pushButtonShareSsCopyEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareSsCopyClicked()
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
x: 10
|
||||
|
|
@ -296,15 +357,19 @@ Item {
|
|||
width: 331
|
||||
height: 100
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: UiLogic.lineEditShareSsStringText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditShareSsStringText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
active = false
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
active = true
|
||||
ct.currentIndex = 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -312,6 +377,7 @@ Item {
|
|||
id: share_cloak
|
||||
x: 0
|
||||
text: qsTr("Share for Cloak client")
|
||||
visible: UiLogic.pageShareCloakVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
|
|
@ -321,22 +387,30 @@ Item {
|
|||
y: 290
|
||||
width: 331
|
||||
height: 40
|
||||
text: qsTr("Copy")
|
||||
text: UiLogic.pushButtonShareCloakCopyText
|
||||
enabled: UiLogic.pushButtonShareCloakCopyEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareCloakCopyClicked()
|
||||
}
|
||||
}
|
||||
TextInput {
|
||||
x: 10
|
||||
y: 30
|
||||
width: 331
|
||||
height: 100
|
||||
text: UiLogic.plainTextEditShareCloakText
|
||||
onEditingFinished: {
|
||||
UiLogic.plainTextEditShareCloakText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
active = false
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
active = true
|
||||
ct.currentIndex = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import Qt.labs.qmlmodels 1.0
|
||||
import Qt.labs.platform 1.0
|
||||
import QtQuick.Dialogs 1.0
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: GC.screenWidth
|
||||
|
|
@ -26,7 +28,7 @@ Item {
|
|||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: qsTr("These sites will be opened using VPN")
|
||||
text: UiLogic.labelSitesAddCustomText
|
||||
x: 20
|
||||
y: 40
|
||||
width: 340
|
||||
|
|
@ -38,6 +40,13 @@ Item {
|
|||
width: 231
|
||||
height: 31
|
||||
placeholderText: qsTr("yousite.com or IP address")
|
||||
text: UiLogic.lineEditSitesAddCustomText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditSitesAddCustomText = text
|
||||
}
|
||||
onAccepted: {
|
||||
UiLogic.onPushButtonAddCustomSitesClicked()
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: back
|
||||
|
|
@ -58,6 +67,9 @@ Item {
|
|||
height: 31
|
||||
font.pixelSize: 24
|
||||
text: "+"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonAddCustomSitesClicked()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: sites_delete
|
||||
|
|
@ -67,6 +79,9 @@ Item {
|
|||
height: 31
|
||||
font.pixelSize: 16
|
||||
text: qsTr("Delete selected")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonSitesDeleteClicked(tb.currentRow)
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
|
|
@ -92,6 +107,18 @@ Item {
|
|||
}
|
||||
}
|
||||
antialiasing: true
|
||||
onClicked: {
|
||||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
title: qsTr("Import IP addresses")
|
||||
visible: false
|
||||
folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
|
||||
onAccepted: {
|
||||
UiLogic.onPushButtonSitesImportClicked(fileUrl)
|
||||
}
|
||||
}
|
||||
TableView {
|
||||
id: tb
|
||||
|
|
@ -103,25 +130,7 @@ Item {
|
|||
clip: true
|
||||
property int currentRow: -1
|
||||
columnSpacing: 0
|
||||
model: TableModel {
|
||||
TableModelColumn { display: "name" }
|
||||
TableModelColumn { display: "color" }
|
||||
|
||||
rows: [
|
||||
{
|
||||
"name": "cat",
|
||||
"color": "black"
|
||||
},
|
||||
{
|
||||
"name": "dog",
|
||||
"color": "brown"
|
||||
},
|
||||
{
|
||||
"name": "bird",
|
||||
"color": "white"
|
||||
}
|
||||
]
|
||||
}
|
||||
model: UiLogic.tableViewSitesModel
|
||||
|
||||
delegate: Item {
|
||||
implicitWidth: 170
|
||||
|
|
|
|||
|
|
@ -25,15 +25,16 @@ Item {
|
|||
checked: false
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
// if (checked){
|
||||
// ui->stackedWidget_start->setCurrentWidget(ui->page_start_new_server);
|
||||
// ui->pushButton_start_switch_page->setText(tr("Import connection"));
|
||||
// }
|
||||
// else {
|
||||
// ui->stackedWidget_start->setCurrentWidget(ui->page_start_import);
|
||||
// ui->pushButton_start_switch_page->setText(tr("Set up your own server"));
|
||||
// }
|
||||
|
||||
if (checked) {
|
||||
page_start_new_server.visible = true
|
||||
page_start_import.visible = false
|
||||
text = qsTr("Import connection");
|
||||
}
|
||||
else {
|
||||
page_start_new_server.visible = false
|
||||
page_start_import.visible = true
|
||||
text = qsTr("Set up your own server");
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
|
|
@ -57,20 +58,14 @@ Item {
|
|||
|
||||
}
|
||||
|
||||
StackView {
|
||||
id: page_start_stack_view
|
||||
x: 0
|
||||
y: 35
|
||||
width: 380
|
||||
height: 481
|
||||
initialItem: page_start_new_server
|
||||
}
|
||||
|
||||
Component {
|
||||
id: page_start_import
|
||||
Item {
|
||||
id: page_start_import
|
||||
width: 380
|
||||
height: 481
|
||||
x: 0
|
||||
y: 35
|
||||
visible: true
|
||||
Text {
|
||||
x: 0
|
||||
y: 20
|
||||
|
|
@ -120,13 +115,15 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: page_start_new_server
|
||||
|
||||
Item {
|
||||
id: page_start_new_server
|
||||
width: 380
|
||||
height: 481
|
||||
x: 0
|
||||
y: 35
|
||||
visible: false
|
||||
Label {
|
||||
x:10
|
||||
y:0
|
||||
|
|
@ -157,6 +154,7 @@ Item {
|
|||
text: qsTr("Login to connect via SSH")
|
||||
}
|
||||
LabelType {
|
||||
id: label_new_server_password
|
||||
x: 40
|
||||
y: 230
|
||||
width: 171
|
||||
|
|
@ -212,11 +210,12 @@ Item {
|
|||
y: 350
|
||||
width: 301
|
||||
height: 40
|
||||
text: qsTr("Connect")
|
||||
text: UiLogic.pushButtonNewServerConnectText
|
||||
visible: UiLogic.pushButtonNewServerConnectVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonNewServerConnect()
|
||||
}
|
||||
enabled: UiLogic.pushButtonNewServerConnectEnabled
|
||||
}
|
||||
BasicButtonType {
|
||||
id: new_sever_connect_key
|
||||
|
|
@ -244,6 +243,10 @@ Item {
|
|||
checked: UiLogic.pushButtonNewServerConnectKeyChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonNewServerConnectKeyChecked = checked
|
||||
label_new_server_password.text = checked ? qsTr("Private key") : qsTr("Password")
|
||||
new_sever_connect_key.text = checked ? qsTr("Connect using SSH password") : qsTr("Connect using SSH key")
|
||||
new_server_password.visible = !checked
|
||||
new_server_ssh_key.visible = checked
|
||||
}
|
||||
}
|
||||
BasicButtonType {
|
||||
|
|
@ -287,9 +290,10 @@ Item {
|
|||
onEditingFinished: {
|
||||
UiLogic.textEditNewServerSshKeyText = text
|
||||
}
|
||||
visible: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ImageButtonType {
|
||||
id: back_from_start
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Page 1.0
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
|
||||
Item {
|
||||
|
|
@ -37,7 +37,7 @@ Item {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: qsTr("Error text")
|
||||
text: UiLogic.labelErrorText
|
||||
}
|
||||
Text {
|
||||
x: 0
|
||||
|
|
@ -51,7 +51,7 @@ Item {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: qsTr("Connected")
|
||||
text: UiLogic.labelStateText
|
||||
}
|
||||
Image {
|
||||
x: 0
|
||||
|
|
@ -79,6 +79,7 @@ Item {
|
|||
}
|
||||
contentItem: Item {}
|
||||
antialiasing: true
|
||||
enabled: UiLogic.pushButtonConnectEnabled
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
|
|
@ -87,6 +88,9 @@ Item {
|
|||
width: 31
|
||||
height: 31
|
||||
icon.source: "qrc:/images/settings_grey.png"
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.GeneralSettings)
|
||||
}
|
||||
}
|
||||
BasicButtonType {
|
||||
id: button_add_site
|
||||
|
|
@ -122,7 +126,7 @@ Item {
|
|||
}
|
||||
antialiasing: true
|
||||
onClicked: {
|
||||
UiLogic.goToPage(Page.Sites)
|
||||
UiLogic.goToPage(PageEnum.Sites)
|
||||
}
|
||||
}
|
||||
Item {
|
||||
|
|
@ -156,7 +160,7 @@ Item {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: qsTr("0 Mbps")
|
||||
text: UiLogic.labelSpeedReceivedText
|
||||
}
|
||||
Text {
|
||||
x: 260
|
||||
|
|
@ -170,7 +174,7 @@ Item {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: qsTr("0 Mbps")
|
||||
text: UiLogic.labelSpeedSentText
|
||||
}
|
||||
}
|
||||
Item {
|
||||
|
|
@ -178,6 +182,7 @@ Item {
|
|||
y: 470
|
||||
width: 351
|
||||
height: 91
|
||||
enabled: UiLogic.widgetVpnModeEnabled
|
||||
RadioButtonType {
|
||||
x: 0
|
||||
y: 0
|
||||
|
|
@ -215,6 +220,5 @@ Item {
|
|||
UiLogic.onRadioButtonVpnModeForwardSitesToggled(checked)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import QtQuick 2.14
|
||||
import QtQuick.Window 2.14
|
||||
import QtQuick.Controls 2.12
|
||||
import Page 1.0
|
||||
import PageEnum 1.0
|
||||
import Qt.labs.platform 1.1
|
||||
import QtQuick.Dialogs 1.1
|
||||
import "./"
|
||||
|
|
@ -11,51 +11,55 @@ Window {
|
|||
visible: true
|
||||
width: GC.screenWidth
|
||||
height: GC.isDesktop() ? GC.screenHeight + titleBar.height : GC.screenHeight
|
||||
onClosing: {
|
||||
UiLogic.onCloseWindow()
|
||||
}
|
||||
|
||||
// flags: Qt.FramelessWindowHint
|
||||
title: "AmneziaVPN"
|
||||
function getPageComponent(page) {
|
||||
switch (page) {
|
||||
case Page.Start:
|
||||
case PageEnum.Start:
|
||||
return page_start;
|
||||
case Page.NewServer:
|
||||
case PageEnum.NewServer:
|
||||
return page_new_server
|
||||
case Page.NewServerProtocols:
|
||||
case PageEnum.NewServerProtocols:
|
||||
return page_new_server_protocols
|
||||
case Page.Wizard:
|
||||
case PageEnum.Wizard:
|
||||
return page_setup_wizard
|
||||
case Page.WizardHigh:
|
||||
case PageEnum.WizardHigh:
|
||||
return page_setup_wizard_high_level
|
||||
case Page.WizardLow:
|
||||
case PageEnum.WizardLow:
|
||||
return page_setup_wizard_low_level
|
||||
case Page.WizardMedium:
|
||||
case PageEnum.WizardMedium:
|
||||
return page_setup_wizard_medium_level
|
||||
case Page.WizardVpnMode:
|
||||
case PageEnum.WizardVpnMode:
|
||||
return page_setup_wizard_vpn_mode
|
||||
case Page.ServerConfiguring:
|
||||
case PageEnum.ServerConfiguring:
|
||||
return page_new_server_configuring
|
||||
case Page.Vpn:
|
||||
case PageEnum.Vpn:
|
||||
return page_vpn
|
||||
case Page.GeneralSettings:
|
||||
case PageEnum.GeneralSettings:
|
||||
return page_general_settings
|
||||
case Page.AppSettings:
|
||||
case PageEnum.AppSettings:
|
||||
return page_app_settings
|
||||
case Page.NetworkSettings:
|
||||
case PageEnum.NetworkSettings:
|
||||
return page_network_settings
|
||||
case Page.ServerSettings:
|
||||
case PageEnum.ServerSettings:
|
||||
return page_server_settings
|
||||
case Page.ServerVpnProtocols:
|
||||
case PageEnum.ServerVpnProtocols:
|
||||
return page_server_protocols
|
||||
case Page.ServersList:
|
||||
case PageEnum.ServersList:
|
||||
return page_servers
|
||||
case Page.ShareConnection:
|
||||
case PageEnum.ShareConnection:
|
||||
return page_share_connection
|
||||
case Page.Sites:
|
||||
case PageEnum.Sites:
|
||||
return page_sites
|
||||
case Page.OpenVpnSettings:
|
||||
case PageEnum.OpenVpnSettings:
|
||||
return page_proto_openvpn
|
||||
case Page.ShadowSocksSettings:
|
||||
case PageEnum.ShadowSocksSettings:
|
||||
return page_proto_shadowsocks
|
||||
case Page.CloakSettings:
|
||||
case PageEnum.CloakSettings:
|
||||
return page_proto_cloak
|
||||
}
|
||||
return undefined;
|
||||
|
|
@ -63,113 +67,114 @@ Window {
|
|||
|
||||
function getPageEnum(item) {
|
||||
if (item instanceof PageStart) {
|
||||
return Page.Start
|
||||
return PageEnum.Start
|
||||
}
|
||||
if (item instanceof PageNewServer) {
|
||||
return Page.NewServer
|
||||
return PageEnum.NewServer
|
||||
}
|
||||
if (item instanceof PageNewServerProtocol) {
|
||||
return Page.NewServerProtocols
|
||||
return PageEnum.NewServerProtocols
|
||||
}
|
||||
if (item instanceof PageSetupWizard) {
|
||||
return Page.Wizard
|
||||
return PageEnum.Wizard
|
||||
}
|
||||
if (item instanceof PageSetupWizardHighLevel) {
|
||||
return Page.WizardHigh
|
||||
return PageEnum.WizardHigh
|
||||
}
|
||||
if (item instanceof PageSetupWizardLowLevel) {
|
||||
return Page.WizardLow
|
||||
return PageEnum.WizardLow
|
||||
}
|
||||
if (item instanceof PageSetupWizardMediumLevel) {
|
||||
return Page.WizardMedium
|
||||
return PageEnum.WizardMedium
|
||||
}
|
||||
if (item instanceof PageSetupWizardVPNMode) {
|
||||
return Page.WizardVpnMode
|
||||
return PageEnum.WizardVpnMode
|
||||
}
|
||||
if (item instanceof PageNewServerConfiguring) {
|
||||
return Page.ServerConfiguring
|
||||
return PageEnum.ServerConfiguring
|
||||
}
|
||||
if (item instanceof PageVPN) {
|
||||
return Page.Vpn
|
||||
return PageEnum.Vpn
|
||||
}
|
||||
if (item instanceof PageGeneralSettings) {
|
||||
return Page.GeneralSettings
|
||||
return PageEnum.GeneralSettings
|
||||
}
|
||||
if (item instanceof PageAppSetting) {
|
||||
return Page.AppSettings
|
||||
return PageEnum.AppSettings
|
||||
}
|
||||
if (item instanceof PageNetworkSetting) {
|
||||
return Page.NetworkSettings
|
||||
return PageEnum.NetworkSettings
|
||||
}
|
||||
if (item instanceof PageServerSetting) {
|
||||
return Page.ServerSettings
|
||||
return PageEnum.ServerSettings
|
||||
}
|
||||
if (item instanceof PageServerProtocols) {
|
||||
return Page.ServerVpnProtocols
|
||||
return PageEnum.ServerVpnProtocols
|
||||
}
|
||||
if (item instanceof PageServer) {
|
||||
return Page.ServersList
|
||||
return PageEnum.ServersList
|
||||
}
|
||||
if (item instanceof PageShareConnection) {
|
||||
return Page.ShareConnection
|
||||
return PageEnum.ShareConnection
|
||||
}
|
||||
if (item instanceof PageSites) {
|
||||
return Page.Sites
|
||||
return PageEnum.Sites
|
||||
}
|
||||
if (item instanceof PageProtoOpenVPN) {
|
||||
return Page.OpenVpnSettings
|
||||
return PageEnum.OpenVpnSettings
|
||||
}
|
||||
if (item instanceof PageProtoShadowSock) {
|
||||
return Page.ShadowSocksSettings
|
||||
return PageEnum.ShadowSocksSettings
|
||||
}
|
||||
if (item instanceof PageProtoCloak) {
|
||||
return Page.CloakSettings
|
||||
return PageEnum.CloakSettings
|
||||
}
|
||||
return Page.Start
|
||||
return PageEnum.Start
|
||||
}
|
||||
|
||||
function gotoPage(page, reset, slide) {
|
||||
let pageComponent = getPageComponent(page)
|
||||
console.debug(pageComponent)
|
||||
if (reset) {
|
||||
if (page === Page.ServerSettings) {
|
||||
if (page === PageEnum.ServerSettings) {
|
||||
UiLogic.updateServerPage();
|
||||
}
|
||||
if (page === Page.ShareConnection) {}
|
||||
if (page === Page.Wizard) {
|
||||
if (page === PageEnum.ShareConnection) {}
|
||||
if (page === PageEnum.Wizard) {
|
||||
UiLogic.radioButtonSetupWizardMediumChecked = true
|
||||
}
|
||||
if (page === Page.WizardHigh) {
|
||||
if (page === PageEnum.WizardHigh) {
|
||||
UiLogic.updateWizardHighPage();
|
||||
}
|
||||
if (page === Page.ServerConfiguring) {
|
||||
if (page === PageEnum.ServerConfiguring) {
|
||||
UiLogic.progressBarNewServerConfiguringValue = 0;
|
||||
}
|
||||
if (page === Page.GeneralSettings) {
|
||||
if (page === PageEnum.GeneralSettings) {
|
||||
UiLogic.updateGeneralSettingPage();
|
||||
}
|
||||
if (page === Page.ServersList) {
|
||||
if (page === PageEnum.ServersList) {
|
||||
UiLogic.updateServersListPage();
|
||||
}
|
||||
if (page === Page.Start) {
|
||||
if (page === PageEnum.Start) {
|
||||
UiLogic.pushButtonBackFromStartVisible = !pageLoader.empty
|
||||
UiLogic.updateStartPage();
|
||||
}
|
||||
if (page === Page.NewServerProtocols) {
|
||||
if (page === PageEnum.NewServerProtocols) {
|
||||
UiLogic.updateNewServerProtocolsPage()
|
||||
}
|
||||
if (page === Page.ServerVpnProtocols) {
|
||||
if (page === PageEnum.ServerVpnProtocols) {
|
||||
UiLogic.updateProtocolsPage()
|
||||
}
|
||||
if (page === Page.AppSettings) {
|
||||
if (page === PageEnum.AppSettings) {
|
||||
UiLogic.updateAppSettingsPage()
|
||||
}
|
||||
if (page === Page.NetworkSettings) {
|
||||
if (page === PageEnum.NetworkSettings) {
|
||||
UiLogic.updateAppSettingsPage()
|
||||
}
|
||||
if (page === Page.Sites) {
|
||||
if (page === PageEnum.Sites) {
|
||||
UiLogic.updateSitesPage()
|
||||
}
|
||||
if (page === Page.Vpn) {
|
||||
if (page === PageEnum.Vpn) {
|
||||
UiLogic.updateVpnPage()
|
||||
}
|
||||
UiLogic.pushButtonNewServerConnectKeyChecked = false
|
||||
|
|
@ -196,7 +201,7 @@ Window {
|
|||
} else {
|
||||
pageLoader.push(pageComponent, {}, StackView.Immediate)
|
||||
}
|
||||
if (page === Page.Start) {
|
||||
if (page === PageEnum.Start) {
|
||||
UiLogic.pushButtonBackFromStartVisible = !pageLoader.empty
|
||||
UiLogic.updateStartPage();
|
||||
}
|
||||
|
|
@ -216,8 +221,8 @@ Window {
|
|||
target: null
|
||||
}
|
||||
onCloseButtonClicked: {
|
||||
if (UiLogic.currentPageValue === Page.Start ||
|
||||
UiLogic.currentPageValue === Page.NewServer) {
|
||||
if (UiLogic.currentPageValue === PageEnum.Start ||
|
||||
UiLogic.currentPageValue === PageEnum.NewServer) {
|
||||
Qt.quit()
|
||||
} else {
|
||||
root.hide()
|
||||
|
|
@ -237,10 +242,9 @@ Window {
|
|||
y: GC.isDesktop() ? titleBar.height : 0
|
||||
width: GC.screenWidth
|
||||
height: GC.screenHeight
|
||||
initialItem: page_vpn
|
||||
// initialItem: page_servers
|
||||
onCurrentItemChanged: {
|
||||
let pageEnum = root.getPageEnum(currentItem)
|
||||
console.debug(pageEnum)
|
||||
UiLogic.currentPageValue = pageEnum
|
||||
}
|
||||
}
|
||||
|
|
@ -345,6 +349,18 @@ Window {
|
|||
onSetStartPage: {
|
||||
root.set_start_page(page, slide)
|
||||
}
|
||||
onShowPublicKeyWarning: {
|
||||
publicKeyWarning.visible = true
|
||||
}
|
||||
onShowConnectErrorDialog: {
|
||||
connectErrorDialog.visible = true
|
||||
}
|
||||
onShow: {
|
||||
root.show()
|
||||
}
|
||||
onHide: {
|
||||
root.hide()
|
||||
}
|
||||
}
|
||||
MessageDialog {
|
||||
id: closePrompt
|
||||
|
|
@ -414,4 +430,17 @@ Window {
|
|||
}
|
||||
}
|
||||
}
|
||||
MessageDialog {
|
||||
id: publicKeyWarning
|
||||
title: "AmneziaVPN"
|
||||
text: qsTr("It's public key. Private key required")
|
||||
visible: false
|
||||
}
|
||||
MessageDialog {
|
||||
id: connectErrorDialog
|
||||
title: "AmneziaVPN"
|
||||
text: UiLogic.dialogConnectErrorText
|
||||
visible: false
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue