qml ui fixes
This commit is contained in:
parent
57234bc793
commit
27171ed974
43 changed files with 311 additions and 262 deletions
103
client/ui/qml/Pages/PageAppSetting.qml
Normal file
103
client/ui/qml/Pages/PageAppSetting.qml
Normal file
|
@ -0,0 +1,103 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
PageBase {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Application Settings")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 140
|
||||
width: 211
|
||||
height: 31
|
||||
text: qsTr("Auto connect")
|
||||
checked: UiLogic.checkBoxAppSettingsAutoconnectChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxAppSettingsAutoconnectChecked = checked
|
||||
UiLogic.onCheckBoxAppSettingsAutoconnectToggled(checked)
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 100
|
||||
width: 211
|
||||
height: 31
|
||||
text: qsTr("Auto start")
|
||||
checked: UiLogic.checkBoxAppSettingsAutostartChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxAppSettingsAutostartChecked = checked
|
||||
UiLogic.onCheckBoxAppSettingsAutostartToggled(checked)
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 180
|
||||
width: 211
|
||||
height: 31
|
||||
text: qsTr("Start minimized")
|
||||
checked: UiLogic.checkBoxAppSettingsStartMinimizedChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxAppSettingsStartMinimizedChecked = checked
|
||||
UiLogic.onCheckBoxAppSettingsStartMinimizedToggled(checked)
|
||||
}
|
||||
}
|
||||
Image {
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: GC.trW(150)
|
||||
height: GC.trH(22)
|
||||
y: GC.trY(590)
|
||||
source: "qrc:/images/AmneziaVPN.png"
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 240
|
||||
width: 281
|
||||
height: 21
|
||||
text: UiLogic.labelAppSettingsVersionText
|
||||
}
|
||||
BlueButtonType {
|
||||
x: 30
|
||||
y: 280
|
||||
width: 321
|
||||
height: 41
|
||||
text: qsTr("Check for updates")
|
||||
onClicked: {
|
||||
Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest")
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
x: 30
|
||||
y: 340
|
||||
width: 321
|
||||
height: 41
|
||||
text: qsTr("Open logs folder")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonAppSettingsOpenLogsChecked()
|
||||
}
|
||||
}
|
||||
}
|
13
client/ui/qml/Pages/PageBase.qml
Normal file
13
client/ui/qml/Pages/PageBase.qml
Normal file
|
@ -0,0 +1,13 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
// width: GC.screenWidth
|
||||
// height: GC.screenHeight
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
150
client/ui/qml/Pages/PageGeneralSettings.qml
Normal file
150
client/ui/qml/Pages/PageGeneralSettings.qml
Normal file
|
@ -0,0 +1,150 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
y: 40
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
Rectangle {
|
||||
y: 100
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
Rectangle {
|
||||
y: 160
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
Rectangle {
|
||||
y: 220
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
Rectangle {
|
||||
y: 280
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
Rectangle {
|
||||
y: 340
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
Rectangle {
|
||||
y: 400
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
y: 355
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/plus.png"
|
||||
text: qsTr("Add server")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Start)
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
y: 55
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
text: qsTr("App settings")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.AppSettings)
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
y: 115
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
text: qsTr("Network settings")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.NetworkSettings)
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
y: 175
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/server_settings.png"
|
||||
text: qsTr("Server management")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonGeneralSettingsServerSettingsClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
y: 295
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/server_settings.png"
|
||||
text: qsTr("Servers")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ServersList)
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
y: 235
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/share.png"
|
||||
text: qsTr("Share connection")
|
||||
enabled: UiLogic.pushButtonGeneralSettingsShareConnectionEnable
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonGeneralSettingsShareConnectionClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 20
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
text: qsTr("Exit")
|
||||
onClicked: {
|
||||
Qt.quit()
|
||||
}
|
||||
}
|
||||
}
|
106
client/ui/qml/Pages/PageNetworkSetting.qml
Normal file
106
client/ui/qml/Pages/PageNetworkSetting.qml
Normal file
|
@ -0,0 +1,106 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("DNS Servers")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
Image {
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: GC.trW(150)
|
||||
height: GC.trH(22)
|
||||
y: GC.trY(590)
|
||||
source: "qrc:/images/AmneziaVPN.png"
|
||||
}
|
||||
LabelType {
|
||||
x: 40
|
||||
y: 95
|
||||
width: 291
|
||||
height: 21
|
||||
text: qsTr("Primary DNS server")
|
||||
}
|
||||
LabelType {
|
||||
x: 40
|
||||
y: 175
|
||||
width: 291
|
||||
height: 21
|
||||
text: qsTr("Secondray DNS server")
|
||||
}
|
||||
TextFieldType {
|
||||
id: dns1
|
||||
x: 40
|
||||
y: 120
|
||||
width: 271
|
||||
height: 40
|
||||
text: UiLogic.lineEditNetworkSettingsDns1Text
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNetworkSettingsDns1Text = text
|
||||
UiLogic.onLineEditNetworkSettingsDns1EditFinished(text)
|
||||
}
|
||||
validator: RegExpValidator {
|
||||
regExp: UiLogic.ipAddressValidatorRegex
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
id: dns2
|
||||
x: 40
|
||||
y: 200
|
||||
width: 271
|
||||
height: 40
|
||||
text: UiLogic.lineEditNetworkSettingsDns2Text
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNetworkSettingsDns2Text = text
|
||||
UiLogic.onLineEditNetworkSettingsDns2EditFinished(text)
|
||||
}
|
||||
validator: RegExpValidator {
|
||||
regExp: UiLogic.ipAddressValidatorRegex
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: resetDNS1
|
||||
x: 320
|
||||
y: 127
|
||||
width: 24
|
||||
height: 24
|
||||
icon.source: "qrc:/images/reload.png"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonNetworkSettingsResetdns1Clicked()
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: resetDNS2
|
||||
x: 320
|
||||
y: 207
|
||||
width: 24
|
||||
height: 24
|
||||
icon.source: "qrc:/images/reload.png"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonNetworkSettingsResetdns2Clicked()
|
||||
}
|
||||
}
|
||||
}
|
83
client/ui/qml/Pages/PageNewServer.qml
Normal file
83
client/ui/qml/Pages/PageNewServer.qml
Normal file
|
@ -0,0 +1,83 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Setup your server to use VPN")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
LabelType {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("If you want easily configure your server just run Wizard")
|
||||
wrapMode: Text.Wrap
|
||||
x: 40
|
||||
y: 100
|
||||
width: 301
|
||||
height: 41
|
||||
}
|
||||
LabelType {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Press configure manually to choose VPN protocols you want to install")
|
||||
wrapMode: Text.Wrap
|
||||
x: 40
|
||||
y: 260
|
||||
width: 301
|
||||
height: 41
|
||||
}
|
||||
BlueButtonType {
|
||||
text: qsTr("Run Setup Wizard")
|
||||
y: 150
|
||||
width: 301
|
||||
height: 40
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Wizard);
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
text: qsTr("Configure VPN protocols manually")
|
||||
y: 310
|
||||
width: 301
|
||||
height: 40
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.NewServerProtocols);
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: GC.trW(150)
|
||||
height: GC.trH(22)
|
||||
y: GC.trY(590)
|
||||
source: "qrc:/images/AmneziaVPN.png"
|
||||
}
|
||||
ImageButtonType {
|
||||
id: back_from_new_server
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
77
client/ui/qml/Pages/PageNewServerConfiguring.qml
Normal file
77
client/ui/qml/Pages/PageNewServerConfiguring.qml
Normal file
|
@ -0,0 +1,77 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
enabled: UiLogic.pageNewServerConfiguringEnabled
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Configuring...")
|
||||
x: 0
|
||||
y: 35
|
||||
width: 381
|
||||
height: 31
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 90
|
||||
width: 321
|
||||
height: 31
|
||||
text: qsTr("Please wait.")
|
||||
}
|
||||
LabelType {
|
||||
x: 40
|
||||
y: 560
|
||||
width: 301
|
||||
height: 41
|
||||
text: UiLogic.labelNewServerConfiguringWaitInfoText
|
||||
visible: UiLogic.labelNewServerConfiguringWaitInfoVisible
|
||||
}
|
||||
ProgressBar {
|
||||
id: pr
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 510
|
||||
width: 301
|
||||
height: 40
|
||||
from: 0
|
||||
to: UiLogic.progressBarNewServerConfiguringMaximium
|
||||
value: UiLogic.progressBarNewServerConfiguringValue
|
||||
visible: UiLogic.progressBarNewServerConfiguringVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
color: "#100A44"
|
||||
radius: 4
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
Rectangle {
|
||||
width: pr.visualPosition * parent.width
|
||||
height: parent.height
|
||||
radius: 4
|
||||
color: Qt.rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
LabelType {
|
||||
anchors.fill: parent
|
||||
text: UiLogic.progressBarNewServerConfiguringText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#D4D4D4"
|
||||
visible: UiLogic.progressBarNewServerConfiguringTextVisible
|
||||
}
|
||||
}
|
||||
}
|
451
client/ui/qml/Pages/PageNewServerProtocol.qml
Normal file
451
client/ui/qml/Pages/PageNewServerProtocol.qml
Normal file
|
@ -0,0 +1,451 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Select VPN protocols")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
ProgressBar {
|
||||
id: progress_bar_new_server_connection
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 570
|
||||
width: 301
|
||||
height: 40
|
||||
from: UiLogic.progressBarNewServerConnectionMinimum
|
||||
to: UiLogic.progressBarNewServerConnectionMaximum
|
||||
value: 0
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
color: "#100A44"
|
||||
radius: 4
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
Rectangle {
|
||||
width: progress_bar_new_server_connection.visualPosition * parent.width
|
||||
height: parent.height
|
||||
radius: 4
|
||||
color: Qt.rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
LabelType {
|
||||
anchors.fill: parent
|
||||
text: qsTr("Configuring...")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#D4D4D4"
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 570
|
||||
width: 301
|
||||
height: 40
|
||||
text: qsTr("Setup server")
|
||||
onClicked: {
|
||||
UiLogic.pushButtonNewServerConnectConfigureClicked()
|
||||
}
|
||||
}
|
||||
ScrollView {
|
||||
x: 0
|
||||
y: 70
|
||||
width: 380
|
||||
height: 471
|
||||
clip: true
|
||||
Column {
|
||||
spacing: 5
|
||||
Rectangle {
|
||||
x: 5
|
||||
y: 5
|
||||
width: 368
|
||||
height: frame_new_server_setting_cloak.visible ? 140 : 72
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
Rectangle {
|
||||
id: frame_new_server_setting_cloak
|
||||
height: 77
|
||||
width: 353
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: false
|
||||
radius: 2
|
||||
Grid {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
horizontalItemAlignment: Grid.AlignHCenter
|
||||
verticalItemAlignment: Grid.AlignVCenter
|
||||
topPadding: 5
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
LabelType {
|
||||
width: 130
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: qsTr("Port (TCP)")
|
||||
}
|
||||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: UiLogic.lineEditNewServerCloakPortText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNewServerCloakPortText = text
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
width: 130
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: qsTr("Fake Web Site")
|
||||
}
|
||||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: UiLogic.lineEditNewServerCloakSiteText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNewServerCloakSiteText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 5
|
||||
leftPadding: 15
|
||||
rightPadding: 5
|
||||
height: 55
|
||||
width: parent.width
|
||||
CheckBoxType {
|
||||
text: qsTr("OpenVPN and ShadowSocks\n with masking using Cloak plugin")
|
||||
height: parent.height
|
||||
width: 308
|
||||
checked: UiLogic.checkBoxNewServerCloakChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxNewServerCloakChecked = checked
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
width: 35
|
||||
height: 35
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
checkable: true
|
||||
checked: UiLogic.pushButtonNewServerSettingsCloakChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonNewServerSettingsCloakChecked = checked
|
||||
if (checked) {
|
||||
frame_new_server_setting_cloak.visible = true
|
||||
} else {
|
||||
frame_new_server_setting_cloak.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
x: 5
|
||||
y: 5
|
||||
width: 368
|
||||
height: frame_new_server_settings_ss.visible ? 140 : 72
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
Rectangle {
|
||||
id: frame_new_server_settings_ss
|
||||
height: 77
|
||||
width: 353
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
radius: 2
|
||||
visible: false
|
||||
Grid {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
horizontalItemAlignment: Grid.AlignHCenter
|
||||
verticalItemAlignment: Grid.AlignVCenter
|
||||
topPadding: 5
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
LabelType {
|
||||
width: 130
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: qsTr("Port (TCP)")
|
||||
}
|
||||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: UiLogic.lineEditNewServerSsPortText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNewServerSsPortText = text
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
width: 130
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: qsTr("Encryption")
|
||||
}
|
||||
ComboBoxType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
model: [
|
||||
qsTr("chacha20-ietf-poly1305"),
|
||||
qsTr("xchacha20-ietf-poly1305"),
|
||||
qsTr("aes-256-gcm"),
|
||||
qsTr("aes-192-gcm"),
|
||||
qsTr("aes-128-gcm")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (UiLogic.comboBoxNewServerSsCipherText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
UiLogic.comboBoxNewServerSsCipherText = currentText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 5
|
||||
leftPadding: 15
|
||||
rightPadding: 5
|
||||
height: 55
|
||||
width: parent.width
|
||||
CheckBoxType {
|
||||
text: qsTr("ShadowSocks")
|
||||
height: parent.height
|
||||
width: 308
|
||||
checked: UiLogic.checkBoxNewServerSsChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxNewServerSsChecked = checked
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
width: 35
|
||||
height: 35
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
x: 5
|
||||
y: 5
|
||||
width: 368
|
||||
height: frame_new_server_settings_openvpn.visible ? 140 : 72
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
Rectangle {
|
||||
id: frame_new_server_settings_openvpn
|
||||
height: 77
|
||||
width: 353
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
radius: 2
|
||||
visible: false
|
||||
Grid {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
horizontalItemAlignment: Grid.AlignHCenter
|
||||
verticalItemAlignment: Grid.AlignVCenter
|
||||
topPadding: 5
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
LabelType {
|
||||
width: 130
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: qsTr("Port (TCP)")
|
||||
}
|
||||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: UiLogic.lineEditNewServerOpenvpnPortText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNewServerOpenvpnPortText = text
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
width: 130
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: qsTr("Protocol")
|
||||
}
|
||||
ComboBoxType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
model: [
|
||||
qsTr("udp"),
|
||||
qsTr("tcp"),
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (UiLogic.comboBoxNewServerOpenvpnProtoText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
UiLogic.comboBoxNewServerOpenvpnProtoText = currentText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 5
|
||||
leftPadding: 15
|
||||
rightPadding: 5
|
||||
height: 55
|
||||
width: parent.width
|
||||
CheckBoxType {
|
||||
text: qsTr("OpenVPN")
|
||||
height: parent.height
|
||||
width: 308
|
||||
checked: UiLogic.checkBoxNewServerOpenvpnChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxNewServerOpenvpnChecked = checked
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
width: 35
|
||||
height: 35
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: frame_new_server_settings_parent_wireguard
|
||||
visible: UiLogic.frameNewServerSettingsParentWireguardVisible
|
||||
x: 5
|
||||
y: 5
|
||||
width: 368
|
||||
height: frame_new_server_settings_wireguard.visible ? 109 : 72
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
Rectangle {
|
||||
id: frame_new_server_settings_wireguard
|
||||
height: 46
|
||||
width: 353
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
radius: 2
|
||||
visible: false
|
||||
Grid {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
horizontalItemAlignment: Grid.AlignHCenter
|
||||
verticalItemAlignment: Grid.AlignVCenter
|
||||
topPadding: 5
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
LabelType {
|
||||
width: 130
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2)
|
||||
text: qsTr("Port (TCP)")
|
||||
}
|
||||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2)
|
||||
text: "32767"
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 5
|
||||
leftPadding: 15
|
||||
rightPadding: 5
|
||||
height: 55
|
||||
width: parent.width
|
||||
CheckBoxType {
|
||||
text: qsTr("WireGuard")
|
||||
height: parent.height
|
||||
width: 308
|
||||
}
|
||||
ImageButtonType {
|
||||
width: 35
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
157
client/ui/qml/Pages/PageProtoCloak.qml
Normal file
157
client/ui/qml/Pages/PageProtoCloak.qml
Normal file
|
@ -0,0 +1,157 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
enabled: UiLogic.pageProtoCloakEnabled
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Item {
|
||||
x: 0
|
||||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: UiLogic.widgetProtoCloakEnabled
|
||||
ComboBoxType {
|
||||
x: 190
|
||||
y: 60
|
||||
width: 151
|
||||
height: 31
|
||||
model: [
|
||||
qsTr("chacha20-poly1305"),
|
||||
qsTr("aes-256-gcm"),
|
||||
qsTr("aes-192-gcm"),
|
||||
qsTr("aes-128-gcm")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (UiLogic.comboBoxProtoCloakCipherText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
UiLogic.comboBoxProtoCloakCipherText = currentText
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 60
|
||||
width: 151
|
||||
height: 31
|
||||
text: qsTr("Cipher")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 160
|
||||
width: 151
|
||||
height: 31
|
||||
text: qsTr("Port")
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Cloak Settings")
|
||||
x: 20
|
||||
y: 0
|
||||
width: 340
|
||||
height: 30
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 110
|
||||
width: 151
|
||||
height: 31
|
||||
text: qsTr("Fake Web Site")
|
||||
}
|
||||
|
||||
LabelType {
|
||||
id: label_proto_cloak_info
|
||||
x: 30
|
||||
y: 550
|
||||
width: 321
|
||||
height: 41
|
||||
visible: UiLogic.labelProtoCloakInfoVisible
|
||||
text: UiLogic.labelProtoCloakInfoText
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_cloak_port
|
||||
x: 190
|
||||
y: 160
|
||||
width: 151
|
||||
height: 31
|
||||
text: UiLogic.lineEditProtoCloakPortText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditProtoCloakPortText = text
|
||||
}
|
||||
enabled: UiLogic.lineEditProtoCloakPortEnabled
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_cloak_site
|
||||
x: 190
|
||||
y: 110
|
||||
width: 151
|
||||
height: 31
|
||||
text: UiLogic.lineEditProtoCloakSiteText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditProtoCloakSiteText = text
|
||||
}
|
||||
}
|
||||
ProgressBar {
|
||||
id: progressBar_proto_cloak_reset
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 500
|
||||
width: 321
|
||||
height: 40
|
||||
from: 0
|
||||
to: UiLogic.progressBarProtoCloakResetMaximium
|
||||
value: UiLogic.progressBarProtoCloakResetValue
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
color: "#100A44"
|
||||
radius: 4
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
Rectangle {
|
||||
width: progressBar_proto_cloak_reset.visualPosition * parent.width
|
||||
height: parent.height
|
||||
radius: 4
|
||||
color: Qt.rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
}
|
||||
visible: UiLogic.progressBarProtoCloakResetVisible
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 500
|
||||
width: 321
|
||||
height: 40
|
||||
text: qsTr("Save and restart VPN")
|
||||
visible: UiLogic.pushButtonProtoCloakSaveVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoCloakSaveClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
277
client/ui/qml/Pages/PageProtoOpenVPN.qml
Normal file
277
client/ui/qml/Pages/PageProtoOpenVPN.qml
Normal file
|
@ -0,0 +1,277 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
enabled: UiLogic.pageProtoOpenvpnEnabled
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Item {
|
||||
x: 0
|
||||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: UiLogic.widgetProtoOpenvpnEnabled
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 280
|
||||
width: 321
|
||||
height: 21
|
||||
text: qsTr("Auto-negotiate encryption")
|
||||
checked: UiLogic.checkBoxProtoOpenvpnAutoEncryptionChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxProtoOpenvpnAutoEncryptionChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.checkBoxProtoOpenvpnAutoEncryptionClicked()
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 430
|
||||
width: 321
|
||||
height: 21
|
||||
text: qsTr("Block DNS requests outside of VPN")
|
||||
checked: UiLogic.checkBoxProtoOpenvpnBlockDnsChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxProtoOpenvpnBlockDnsChecked = checked
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 390
|
||||
width: 321
|
||||
height: 21
|
||||
text: qsTr("Enable TLS auth")
|
||||
checked: UiLogic.checkBoxProtoOpenvpnTlsAuthChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxProtoOpenvpnTlsAuthChecked = checked
|
||||
}
|
||||
|
||||
}
|
||||
ComboBoxType {
|
||||
x: 30
|
||||
y: 340
|
||||
width: 151
|
||||
height: 31
|
||||
model: [
|
||||
qsTr("AES-256-GCM"),
|
||||
qsTr("AES-192-GCM"),
|
||||
qsTr("AES-128-GCM"),
|
||||
qsTr("AES-256-CBC"),
|
||||
qsTr("AES-192-CBC"),
|
||||
qsTr("AES-128-CBC"),
|
||||
qsTr("ChaCha20-Poly1305"),
|
||||
qsTr("ARIA-256-CBC"),
|
||||
qsTr("CAMELLIA-256-CBC"),
|
||||
qsTr("none")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (UiLogic.comboBoxProtoOpenvpnCipherText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
UiLogic.comboBoxProtoOpenvpnCipherText = currentText
|
||||
}
|
||||
enabled: UiLogic.comboBoxProtoOpenvpnCipherEnabled
|
||||
}
|
||||
ComboBoxType {
|
||||
x: 200
|
||||
y: 340
|
||||
width: 151
|
||||
height: 31
|
||||
model: [
|
||||
qsTr("SHA512"),
|
||||
qsTr("SHA384"),
|
||||
qsTr("SHA256"),
|
||||
qsTr("SHA3-512"),
|
||||
qsTr("SHA3-384"),
|
||||
qsTr("SHA3-256"),
|
||||
qsTr("whirlpool"),
|
||||
qsTr("BLAKE2b512"),
|
||||
qsTr("BLAKE2s256"),
|
||||
qsTr("SHA1")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (UiLogic.comboBoxProtoOpenvpnHashText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
UiLogic.comboBoxProtoOpenvpnHashText = currentText
|
||||
}
|
||||
enabled: UiLogic.comboBoxProtoOpenvpnHashEnabled
|
||||
}
|
||||
Rectangle {
|
||||
x: 30
|
||||
y: 140
|
||||
width: 321
|
||||
height: 71
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
RadioButtonType {
|
||||
x: 10
|
||||
y: 40
|
||||
width: 171
|
||||
height: 19
|
||||
text: qsTr("TCP")
|
||||
enabled: UiLogic.radioButtonProtoOpenvpnTcpEnabled
|
||||
checked: UiLogic.radioButtonProtoOpenvpnTcpChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonProtoOpenvpnTcpChecked = checked
|
||||
}
|
||||
}
|
||||
RadioButtonType {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 171
|
||||
height: 19
|
||||
text: qsTr("UDP")
|
||||
checked: UiLogic.radioButtonProtoOpenvpnUdpChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonProtoOpenvpnUdpChecked = checked
|
||||
}
|
||||
enabled: UiLogic.radioButtonProtoOpenvpnUdpEnabled
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 110
|
||||
width: 151
|
||||
height: 21
|
||||
text: qsTr("Network protocol")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 230
|
||||
width: 151
|
||||
height: 31
|
||||
text: qsTr("Port")
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("OpenVPN Settings")
|
||||
x: 10
|
||||
y: 0
|
||||
width: 340
|
||||
height: 30
|
||||
}
|
||||
LabelType {
|
||||
x: 200
|
||||
y: 310
|
||||
width: 151
|
||||
height: 21
|
||||
text: qsTr("Hash")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 40
|
||||
width: 291
|
||||
height: 21
|
||||
text: qsTr("VPN Addresses Subnet")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 310
|
||||
width: 151
|
||||
height: 21
|
||||
text: qsTr("Cipher")
|
||||
}
|
||||
LabelType {
|
||||
id: label_proto_openvpn_info
|
||||
x: 30
|
||||
y: 550
|
||||
width: 321
|
||||
height: 41
|
||||
visible: UiLogic.labelProtoOpenvpnInfoVisible
|
||||
text: UiLogic.labelProtoOpenvpnInfoText
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_openvpn_port
|
||||
x: 200
|
||||
y: 230
|
||||
width: 151
|
||||
height: 31
|
||||
text: UiLogic.lineEditProtoOpenvpnPortText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditProtoOpenvpnPortText = text
|
||||
}
|
||||
enabled: UiLogic.lineEditProtoOpenvpnPortEnabled
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_openvpn_subnet
|
||||
x: 30
|
||||
y: 65
|
||||
width: 321
|
||||
height: 31
|
||||
text: UiLogic.lineEditProtoOpenvpnSubnetText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditProtoOpenvpnSubnetText = text
|
||||
}
|
||||
}
|
||||
ProgressBar {
|
||||
id: progressBar_proto_openvpn_reset
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 500
|
||||
width: 321
|
||||
height: 40
|
||||
from: 0
|
||||
to: UiLogic.progressBarProtoOpenvpnResetMaximium
|
||||
value: UiLogic.progressBarProtoOpenvpnResetValue
|
||||
visible: UiLogic.progressBarProtoOpenvpnResetVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
color: "#100A44"
|
||||
radius: 4
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
Rectangle {
|
||||
width: progressBar_proto_openvpn_reset.visualPosition * parent.width
|
||||
height: parent.height
|
||||
radius: 4
|
||||
color: Qt.rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 500
|
||||
width: 321
|
||||
height: 40
|
||||
text: qsTr("Save and restart VPN")
|
||||
visible: UiLogic.pushButtonProtoOpenvpnSaveVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoOpenvpnSaveClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
137
client/ui/qml/Pages/PageProtoShadowSock.qml
Normal file
137
client/ui/qml/Pages/PageProtoShadowSock.qml
Normal file
|
@ -0,0 +1,137 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
enabled: UiLogic.pageProtoShadowsocksEnabled
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Item {
|
||||
x: 0
|
||||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: UiLogic.widgetProtoSsEnabled
|
||||
ComboBoxType {
|
||||
x: 190
|
||||
y: 60
|
||||
width: 151
|
||||
height: 31
|
||||
model: [
|
||||
qsTr("chacha20-poly1305"),
|
||||
qsTr("aes-256-gcm"),
|
||||
qsTr("aes-128-gcm")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (UiLogic.comboBoxProtoShadowsocksCipherText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
UiLogic.comboBoxProtoShadowsocksCipherText = currentText
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 60
|
||||
width: 151
|
||||
height: 31
|
||||
text: qsTr("Cipher")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 110
|
||||
width: 151
|
||||
height: 31
|
||||
text: qsTr("Port")
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("ShadowSocks Settings")
|
||||
x: 30
|
||||
y: 0
|
||||
width: 340
|
||||
height: 30
|
||||
}
|
||||
LabelType {
|
||||
id: label_proto_shadowsocks_info
|
||||
x: 30
|
||||
y: 550
|
||||
width: 321
|
||||
height: 41
|
||||
visible: UiLogic.labelProtoShadowsocksInfoVisible
|
||||
text: UiLogic.labelProtoShadowsocksInfoText
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_shadowsocks_port
|
||||
x: 190
|
||||
y: 110
|
||||
width: 151
|
||||
height: 31
|
||||
text: UiLogic.lineEditProtoShadowsocksPortText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditProtoShadowsocksPortText = text
|
||||
}
|
||||
enabled: UiLogic.lineEditProtoShadowsocksPortEnabled
|
||||
}
|
||||
ProgressBar {
|
||||
id: progressBar_proto_shadowsocks_reset
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 500
|
||||
width: 321
|
||||
height: 40
|
||||
from: 0
|
||||
to: UiLogic.progressBarProtoShadowsocksResetMaximium
|
||||
value: UiLogic.progressBarProtoShadowsocksResetValue
|
||||
visible: UiLogic.progressBarProtoShadowsocksResetVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
color: "#100A44"
|
||||
radius: 4
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
Rectangle {
|
||||
width: progressBar_proto_shadowsocks_reset.visualPosition * parent.width
|
||||
height: parent.height
|
||||
radius: 4
|
||||
color: Qt.rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 500
|
||||
width: 321
|
||||
height: 40
|
||||
text: qsTr("Save and restart VPN")
|
||||
visible: UiLogic.pushButtonProtoShadowsocksSaveVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoShadowsocksSaveClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
172
client/ui/qml/Pages/PageServer.qml
Normal file
172
client/ui/qml/Pages/PageServer.qml
Normal file
|
@ -0,0 +1,172 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtGraphicalEffects 1.12
|
||||
import PageEnum 1.0
|
||||
import "../Controls"
|
||||
import "./"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Servers list")
|
||||
x: 50
|
||||
y: 30
|
||||
width: 171
|
||||
height: 40
|
||||
}
|
||||
ImageButtonType {
|
||||
x: 240
|
||||
y: 39
|
||||
width: 24
|
||||
height: 24
|
||||
icon.source: "qrc:/images/plus.png"
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Start);
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
id: listWidget_servers
|
||||
x: 20
|
||||
y: 90
|
||||
width: 340
|
||||
height: 501
|
||||
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
|
||||
start: Qt.point(0, 0)
|
||||
end: Qt.point(0, height)
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: "#FAFBFE" }
|
||||
GradientStop { position: 1.0; color: "#ECEEFF" }
|
||||
}
|
||||
}
|
||||
LinearGradient {
|
||||
visible: ms.containsMouse
|
||||
anchors.fill: parent
|
||||
start: Qt.point(0, 0)
|
||||
end: Qt.point(0, height)
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: "#FAFBFE" }
|
||||
GradientStop { position: 1.0; color: "#DCDEDF" }
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
id: label_address
|
||||
x: 20
|
||||
y: 40
|
||||
width: 141
|
||||
height: 16
|
||||
text: address
|
||||
}
|
||||
Text {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 181
|
||||
height: 21
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
font.bold: true
|
||||
color: "#181922"
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: desc
|
||||
}
|
||||
ImageButtonType {
|
||||
x: 212
|
||||
y: 25
|
||||
width: 32
|
||||
height: 24
|
||||
checkable: true
|
||||
iconMargin: 0
|
||||
icon.source: checked ? "qrc:/images/connect_button_connected.png"
|
||||
: "qrc:/images/connect_button_disconnected.png"
|
||||
visible: false
|
||||
}
|
||||
ImageButtonType {
|
||||
x: 300
|
||||
y: 25
|
||||
width: 24
|
||||
height: 24
|
||||
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"
|
||||
onClicked: {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
474
client/ui/qml/Pages/PageServerProtocols.qml
Normal file
474
client/ui/qml/Pages/PageServerProtocols.qml
Normal file
|
@ -0,0 +1,474 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
enabled: UiLogic.pageServerProtocolsEnabled
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Protocols")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
ProgressBar {
|
||||
id: progress_bar
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 570
|
||||
width: 301
|
||||
height: 40
|
||||
from: 0
|
||||
to: UiLogic.progressBarProtocolsContainerReinstallMaximium
|
||||
value: UiLogic.progressBarProtocolsContainerReinstallValue
|
||||
visible: UiLogic.progressBarProtocolsContainerReinstallVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
color: "#100A44"
|
||||
radius: 4
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
Rectangle {
|
||||
width: progress_bar.visualPosition * parent.width
|
||||
height: parent.height
|
||||
radius: 4
|
||||
color: Qt.rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
LabelType {
|
||||
anchors.fill: parent
|
||||
text: qsTr("Configuring...")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#D4D4D4"
|
||||
}
|
||||
}
|
||||
ScrollView {
|
||||
x: 0
|
||||
y: 70
|
||||
width: 380
|
||||
height: 471
|
||||
clip: true
|
||||
Column {
|
||||
spacing: 5
|
||||
Rectangle {
|
||||
id: frame_openvpn_ss_cloak
|
||||
x: 9
|
||||
height: 135
|
||||
width: 363
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
visible: UiLogic.frameOpenvpnSsCloakSettingsVisible
|
||||
Item {
|
||||
x: 5
|
||||
y: 5
|
||||
width: parent.width - 10
|
||||
height: parent.height - 10
|
||||
LabelType {
|
||||
anchors.left: parent.left
|
||||
width: 239
|
||||
height: 24
|
||||
text: qsTr("Cloak container")
|
||||
leftPadding: 5
|
||||
}
|
||||
ImageButtonType {
|
||||
anchors.right: sr1.left
|
||||
anchors.rightMargin: 5
|
||||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
width: 24
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoCloakOpenvpnContDefaultChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContDefaultChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoCloakOpenvpnContDefaultClicked(checked)
|
||||
}
|
||||
|
||||
visible: UiLogic.pushButtonProtoCloakOpenvpnContDefaultVisible
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: sr1
|
||||
anchors.right: cn1.left
|
||||
anchors.rightMargin: 5
|
||||
icon.source: "qrc:/images/share.png"
|
||||
width: 24
|
||||
height: 24
|
||||
visible: UiLogic.pushButtonProtoCloakOpenvpnContShareVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoCloakOpenvpnContShareClicked(false)
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: cn1
|
||||
anchors.right: parent.right
|
||||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/connect_button_connected.png"
|
||||
: "qrc:/images/connect_button_disconnected.png"
|
||||
width: 36
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoCloakOpenvpnContInstallChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContInstallChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoCloakOpenvpnContInstallClicked(checked)
|
||||
}
|
||||
enabled: UiLogic.pushButtonProtoCloakOpenvpnContInstallEnabled
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
x: 10
|
||||
y: 42
|
||||
height: 83
|
||||
width: 343
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 323
|
||||
height: 24
|
||||
text: qsTr("OpenVPN settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoCloakOpenvpnContOpenvpnConfigClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
y: 33
|
||||
width: 323
|
||||
height: 24
|
||||
text: qsTr("ShadowSocks settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.pushButtonProtoCloakOpenvpnContSsConfigClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
y: 56
|
||||
width: 323
|
||||
height: 24
|
||||
text: qsTr("Cloak settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoCloakOpenvpnContCloakConfigClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: frame_openvpn_ss
|
||||
x: 9
|
||||
height: 105
|
||||
width: 363
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
visible: UiLogic.frameOpenvpnSsSettingsVisible
|
||||
Item {
|
||||
x: 5
|
||||
y: 5
|
||||
width: parent.width - 10
|
||||
height: parent.height - 10
|
||||
LabelType {
|
||||
anchors.left: parent.left
|
||||
width: 239
|
||||
height: 24
|
||||
text: qsTr("ShadowSocks container")
|
||||
leftPadding: 5
|
||||
}
|
||||
ImageButtonType {
|
||||
anchors.right: sr2.left
|
||||
anchors.rightMargin: 5
|
||||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
width: 24
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoSsOpenvpnContDefaultChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContDefaultChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoSsOpenvpnContDefaultClicked(checked)
|
||||
}
|
||||
|
||||
visible: UiLogic.pushButtonProtoSsOpenvpnContDefaultVisible
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: sr2
|
||||
anchors.right: cn2.left
|
||||
anchors.rightMargin: 5
|
||||
icon.source: "qrc:/images/share.png"
|
||||
width: 24
|
||||
height: 24
|
||||
visible: UiLogic.pushButtonProtoSsOpenvpnContShareVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoSsOpenvpnContShareClicked(false)
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: cn2
|
||||
anchors.right: parent.right
|
||||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/connect_button_connected.png"
|
||||
: "qrc:/images/connect_button_disconnected.png"
|
||||
width: 36
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoSsOpenvpnContInstallChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoSsOpenvpnContInstallChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoSsOpenvpnContInstallClicked(checked)
|
||||
}
|
||||
enabled: UiLogic.pushButtonProtoSsOpenvpnContInstallEnabled
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
x: 10
|
||||
y: 42
|
||||
height: 53
|
||||
width: 343
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
y: 5
|
||||
width: 323
|
||||
height: 24
|
||||
text: qsTr("OpenVPN settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoSsOpenvpnContOpenvpnConfigClicked()
|
||||
}
|
||||
}
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
y: 27
|
||||
width: 323
|
||||
height: 24
|
||||
text: qsTr("ShadowSocks settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoSsOpenvpnContSsConfigClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: frame_openvpn
|
||||
x: 9
|
||||
height: 100
|
||||
width: 363
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
visible: UiLogic.frameOpenvpnSettingsVisible
|
||||
Item {
|
||||
x: 5
|
||||
y: 5
|
||||
width: parent.width - 10
|
||||
height: parent.height - 10
|
||||
LabelType {
|
||||
anchors.left: parent.left
|
||||
width: 239
|
||||
height: 24
|
||||
text: qsTr("OpenVPN container")
|
||||
leftPadding: 5
|
||||
}
|
||||
ImageButtonType {
|
||||
anchors.right: sr3.left
|
||||
anchors.rightMargin: 5
|
||||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
width: 24
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoOpenvpnContDefaultChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoOpenvpnContDefaultChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoOpenvpnContDefaultClicked(checked)
|
||||
}
|
||||
|
||||
visible: UiLogic.pushButtonProtoOpenvpnContDefaultVisible
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: sr3
|
||||
anchors.right: cn3.left
|
||||
anchors.rightMargin: 5
|
||||
icon.source: "qrc:/images/share.png"
|
||||
width: 24
|
||||
height: 24
|
||||
visible: UiLogic.pushButtonProtoOpenvpnContShareVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoOpenvpnContShareClicked(false)
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: cn3
|
||||
anchors.right: parent.right
|
||||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/connect_button_connected.png"
|
||||
: "qrc:/images/connect_button_disconnected.png"
|
||||
width: 36
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoOpenvpnContInstallChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoOpenvpnContInstallChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoOpenvpnContInstallClicked(checked)
|
||||
}
|
||||
enabled: UiLogic.pushButtonProtoOpenvpnContInstallEnabled
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
x: 10
|
||||
y: 42
|
||||
height: 44
|
||||
width: 343
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 323
|
||||
height: 24
|
||||
text: qsTr("OpenVPN settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoOpenvpnContOpenvpnConfigClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: frame_wireguard
|
||||
x: 9
|
||||
height: 100
|
||||
width: 363
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
visible: UiLogic.frameFireguardVisible
|
||||
Item {
|
||||
x: 5
|
||||
y: 5
|
||||
width: parent.width - 10
|
||||
height: parent.height - 10
|
||||
LabelType {
|
||||
anchors.left: parent.left
|
||||
width: 239
|
||||
height: 24
|
||||
text: qsTr("WireGuard container")
|
||||
leftPadding: 5
|
||||
}
|
||||
ImageButtonType {
|
||||
anchors.right: sr4.left
|
||||
anchors.rightMargin: 5
|
||||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||
width: 24
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoWireguardContDefaultChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoWireguardContDefaultChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoWireguardContDefaultClicked(checked)
|
||||
}
|
||||
|
||||
visible: UiLogic.pushButtonProtoWireguardContDefaultVisible
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: sr4
|
||||
anchors.right: cn4.left
|
||||
anchors.rightMargin: 5
|
||||
icon.source: "qrc:/images/share.png"
|
||||
width: 24
|
||||
height: 24
|
||||
visible: UiLogic.pushButtonProtoWireguardContShareVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoWireguardContShareClicked(false)
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: cn4
|
||||
anchors.right: parent.right
|
||||
checkable: true
|
||||
icon.source: checked ? "qrc:/images/connect_button_connected.png"
|
||||
: "qrc:/images/connect_button_disconnected.png"
|
||||
width: 36
|
||||
height: 24
|
||||
checked: UiLogic.pushButtonProtoWireguardContInstallChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonProtoWireguardContInstallChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonProtoWireguardContInstallClicked(checked)
|
||||
}
|
||||
enabled: UiLogic.pushButtonProtoWireguardContInstallEnabled
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: frame_wireguard_settings
|
||||
visible: UiLogic.frameWireguardSettingsVisible
|
||||
x: 10
|
||||
y: 42
|
||||
height: 44
|
||||
width: 343
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
radius: 2
|
||||
SettingButtonType {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 323
|
||||
height: 24
|
||||
text: qsTr("WireGuard settings")
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
133
client/ui/qml/Pages/PageServerSetting.qml
Normal file
133
client/ui/qml/Pages/PageServerSetting.qml
Normal file
|
@ -0,0 +1,133 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
enabled: UiLogic.pageServerSettingsEnabled
|
||||
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Server settings")
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
Image {
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: GC.trW(150)
|
||||
height: GC.trH(22)
|
||||
y: GC.trY(590)
|
||||
source: "qrc:/images/AmneziaVPN.png"
|
||||
}
|
||||
LabelType {
|
||||
x: 20
|
||||
y: 150
|
||||
width: 341
|
||||
height: 31
|
||||
font.pixelSize: 20
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: UiLogic.labelServerSettingsCurrentVpnProtocolText
|
||||
}
|
||||
LabelType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 120
|
||||
width: 341
|
||||
height: 31
|
||||
font.pixelSize: 20
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: UiLogic.labelServerSettingsServerText
|
||||
}
|
||||
LabelType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 530
|
||||
width: 301
|
||||
height: 41
|
||||
text: UiLogic.labelServerSettingsWaitInfoText
|
||||
visible: UiLogic.labelServerSettingsWaitInfoVisible
|
||||
}
|
||||
TextFieldType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 80
|
||||
width: 251
|
||||
height: 31
|
||||
text: UiLogic.lineEditServerSettingsDescriptionText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditServerSettingsDescriptionText = text
|
||||
UiLogic.onLineEditServerSettingsDescriptionEditingFinished()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 410
|
||||
width: 300
|
||||
height: 40
|
||||
text: UiLogic.pushButtonServerSettingsClearText
|
||||
visible: UiLogic.pushButtonServerSettingsClearVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonClearServer()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 350
|
||||
width: 300
|
||||
height: 40
|
||||
text: UiLogic.pushButtonServerSettingsClearClientCacheText
|
||||
visible: UiLogic.pushButtonServerSettingsClearClientCacheVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonServerSettingsClearClientCacheClicked()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 470
|
||||
width: 300
|
||||
height: 40
|
||||
text: qsTr("Forget this server")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonForgetServer()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 210
|
||||
width: 300
|
||||
height: 40
|
||||
text: qsTr("VPN protocols")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ServerVpnProtocols)
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 260
|
||||
width: 300
|
||||
height: 40
|
||||
text: qsTr("Share Server (FULL ACCESS)")
|
||||
visible: UiLogic.pushButtonServerSettingsShareFullVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonServerSettingsShareFullClicked()
|
||||
}
|
||||
}
|
||||
}
|
122
client/ui/qml/Pages/PageSetupWizard.qml
Normal file
122
client/ui/qml/Pages/PageSetupWizard.qml
Normal file
|
@ -0,0 +1,122 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back_from_setup_wizard
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Setup your server to use VPN")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
Item {
|
||||
x: 10
|
||||
y: 70
|
||||
width: 361
|
||||
height: 561
|
||||
LabelType {
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: qsTr("I'm living in country with high censorship level. Many of foreign web sites and VPNs blocked by my government. I want to setup reliable VPN, which is invisible for government.")
|
||||
wrapMode: Text.Wrap
|
||||
x: 30
|
||||
y: 40
|
||||
width: 321
|
||||
height: 121
|
||||
}
|
||||
LabelType {
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: qsTr("I'm living in country with medium censorship level. Some web sites blocked by my government, but VPNs are not blocked at all. I want to setup flexible solution.")
|
||||
wrapMode: Text.Wrap
|
||||
x: 30
|
||||
y: 210
|
||||
width: 321
|
||||
height: 121
|
||||
}
|
||||
LabelType {
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: qsTr("I just want to improve my privacy in internet.")
|
||||
wrapMode: Text.Wrap
|
||||
x: 30
|
||||
y: 360
|
||||
width: 321
|
||||
height: 121
|
||||
}
|
||||
BlueButtonType {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 490
|
||||
width: 321
|
||||
height: 40
|
||||
text: qsTr("Next")
|
||||
onClicked: {
|
||||
if (radioButton_setup_wizard_high.checked) {
|
||||
UiLogic.goToPage(PageEnum.WizardHigh);
|
||||
} else if (radioButton_setup_wizard_medium.checked) {
|
||||
UiLogic.goToPage(PageEnum.WizardMedium);
|
||||
} else if (radioButton_setup_wizard_low.checked) {
|
||||
UiLogic.goToPage(PageEnum.WizardLow);
|
||||
}
|
||||
}
|
||||
}
|
||||
RadioButtonType {
|
||||
id: radioButton_setup_wizard_high
|
||||
x: 10
|
||||
y: 10
|
||||
width: 331
|
||||
height: 25
|
||||
text: qsTr("High censorship level")
|
||||
checked: UiLogic.radioButtonSetupWizardHighChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonSetupWizardHighChecked = checked
|
||||
}
|
||||
}
|
||||
RadioButtonType {
|
||||
id: radioButton_setup_wizard_medium
|
||||
x: 10
|
||||
y: 330
|
||||
width: 331
|
||||
height: 25
|
||||
text: qsTr("Low censorship level")
|
||||
checked: UiLogic.radioButtonSetupWizardLowChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonSetupWizardLowChecked = checked
|
||||
}
|
||||
}
|
||||
RadioButtonType {
|
||||
id: radioButton_setup_wizard_low
|
||||
x: 10
|
||||
y: 180
|
||||
width: 331
|
||||
height: 25
|
||||
text: qsTr("Medium censorship level")
|
||||
checked: UiLogic.radioButtonSetupWizardMediumChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonSetupWizardMediumChecked = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
97
client/ui/qml/Pages/PageSetupWizardHighLevel.qml
Normal file
97
client/ui/qml/Pages/PageSetupWizardHighLevel.qml
Normal file
|
@ -0,0 +1,97 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back_from_setup_wizard
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Setup Wizard")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
Item {
|
||||
x: 10
|
||||
y: 70
|
||||
width: 361
|
||||
height: 561
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 10
|
||||
width: 321
|
||||
height: 321
|
||||
text: qsTr("AmneziaVPN will install VPN protocol which is not visible for your internet provider and government firewall. Your VPN connection will be detected by your provider as regular web traffic to particular web site.\n\nYou SHOULD set this web site address to some foreign web site which is updatesnot blocked by your internet provider. Other words you need to type below some foreign web site address which is accessible without VPN.\n\nPlease note, this protocol still does not support export connection profile to mobile devices. Keep for updates.")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 400
|
||||
width: 321
|
||||
height: 71
|
||||
text: qsTr("OpenVPN over Cloak (VPN obfuscation) profile will be installed")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 330
|
||||
width: 291
|
||||
height: 21
|
||||
text: qsTr("Type web site address for mask")
|
||||
}
|
||||
TextFieldType {
|
||||
id: website_masking
|
||||
x: 30
|
||||
y: 360
|
||||
width: 301
|
||||
height: 41
|
||||
text: UiLogic.lineEditSetupWizardHighWebsiteMaskingText
|
||||
onEditingFinished: {
|
||||
let _text = website_masking.text
|
||||
_text.replace("http://", "");
|
||||
_text.replace("https://", "");
|
||||
if (!_text) {
|
||||
return
|
||||
}
|
||||
_text = _text.split("/").first();
|
||||
UiLogic.lineEditSetupWizardHighWebsiteMaskingText = _text
|
||||
}
|
||||
onAccepted: {
|
||||
next_button.clicked()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: next_button
|
||||
x: 30
|
||||
y: 490
|
||||
width: 301
|
||||
height: 40
|
||||
text: qsTr("Next")
|
||||
onClicked: {
|
||||
let domain = website_masking.text;
|
||||
if (!domain || !domain.includes(".")) {
|
||||
return
|
||||
}
|
||||
UiLogic.goToPage(PageEnum.WizardVpnMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
66
client/ui/qml/Pages/PageSetupWizardLowLevel.qml
Normal file
66
client/ui/qml/Pages/PageSetupWizardLowLevel.qml
Normal file
|
@ -0,0 +1,66 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back_from_setup_wizard
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Setup Wizard")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
Item {
|
||||
x: 10
|
||||
y: 70
|
||||
width: 361
|
||||
height: 561
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 10
|
||||
width: 321
|
||||
height: 341
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: qsTr('AmneziaVPN will install OpenVPN protocol with public/private key pairs generated on server and client sides. You can also configure connection on your mobile device by copying exported ".ovpn" file to your device and setting up official OpenVPN client. We recommend do not use messengers for sending connection profile - it contains VPN private keys.')
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 400
|
||||
width: 321
|
||||
height: 71
|
||||
text: qsTr('OpenVPN profile will be installed')
|
||||
verticalAlignment: Text.AlignBottom
|
||||
}
|
||||
BlueButtonType {
|
||||
id: next_button
|
||||
x: 30
|
||||
y: 490
|
||||
width: 301
|
||||
height: 40
|
||||
text: qsTr("Start configuring")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonSetupWizardLowFinishClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
67
client/ui/qml/Pages/PageSetupWizardMediumLevel.qml
Normal file
67
client/ui/qml/Pages/PageSetupWizardMediumLevel.qml
Normal file
|
@ -0,0 +1,67 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back_from_setup_wizard
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Setup Wizard")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
Item {
|
||||
x: 10
|
||||
y: 70
|
||||
width: 361
|
||||
height: 561
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 10
|
||||
width: 321
|
||||
height: 341
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: qsTr('AmneziaVPN will install VPN protocol which is difficult to detect by your internet provider and government firewall (but possible). In most cases, this is the most suitable protocol. This protocol is faster compared to the VPN protocols with "web traffic masking".\n\nThis protocol support export connection profile to mobile devices using QR code (you should launch 3rd party opensource VPN client - ShadowSocks VPN).')
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 400
|
||||
width: 321
|
||||
height: 71
|
||||
text: qsTr('OpenVPN over ShadowSocks profile will be installed')
|
||||
verticalAlignment: Text.AlignBottom
|
||||
}
|
||||
BlueButtonType {
|
||||
id: next_button
|
||||
x: 30
|
||||
y: 490
|
||||
width: 301
|
||||
height: 40
|
||||
text: qsTr("Next")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.WizardVpnMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
68
client/ui/qml/Pages/PageSetupWizardVPNMode.qml
Normal file
68
client/ui/qml/Pages/PageSetupWizardVPNMode.qml
Normal file
|
@ -0,0 +1,68 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back_from_setup_wizard
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Setup Wizard")
|
||||
x: 10
|
||||
y: 35
|
||||
width: 361
|
||||
height: 31
|
||||
}
|
||||
Item {
|
||||
x: 10
|
||||
y: 70
|
||||
width: 361
|
||||
height: 561
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 350
|
||||
width: 301
|
||||
height: 71
|
||||
text: qsTr('Turn on mode "VPN for selected sites"')
|
||||
checked: UiLogic.checkBoxSetupWizardVpnModeChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.checkBoxSetupWizardVpnModeChecked = checked
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 10
|
||||
width: 321
|
||||
height: 341
|
||||
text: qsTr('Optional.\n\nWe recommend to enable VPN mode "For selected sites" and add blocked sites you need to visit manually. If you will choose this option, you will need add every bloked site you want to visit to the access list. You may switch between modes later.\n\nPlease note, you should add addresses to the list after VPN connection established. You may add any domain, URL or IP address, it will be resolved to IP address.')
|
||||
}
|
||||
BlueButtonType {
|
||||
id: vpn_mode_finish
|
||||
x: 30
|
||||
y: 490
|
||||
width: 301
|
||||
height: 40
|
||||
text: qsTr("Start configuring")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonSetupWizardVpnModeFinishClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
420
client/ui/qml/Pages/PageShareConnection.qml
Normal file
420
client/ui/qml/Pages/PageShareConnection.qml
Normal file
|
@ -0,0 +1,420 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
x: 10
|
||||
y: 40
|
||||
width: 360
|
||||
height: 580
|
||||
Item {
|
||||
id: ct
|
||||
width: parent.width
|
||||
height: childrenRect.height + 10
|
||||
property var contentList: [
|
||||
full_access,
|
||||
share_amezia,
|
||||
share_openvpn,
|
||||
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
|
||||
ShareConnectionContent {
|
||||
id: full_access
|
||||
x: 0
|
||||
text: qsTr("Full access")
|
||||
visible: UiLogic.pageShareFullAccessVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
height: 380
|
||||
Text {
|
||||
x: 10
|
||||
y: 250
|
||||
width: 341
|
||||
height: 111
|
||||
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 have the same permissions to use VPN and your server as you. \nThis code includes your server credentials!\nProvide this code only to TRUSTED users.")
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 130
|
||||
width: 341
|
||||
height: 40
|
||||
text: UiLogic.pushButtonShareFullCopyText
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareFullCopyClicked()
|
||||
}
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 180
|
||||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Save file")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareFullSaveClicked()
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 341
|
||||
height: 100
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: UiLogic.textEditShareFullCodeText
|
||||
onEditingFinished: {
|
||||
UiLogic.textEditShareFullCodeText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
ct.currentIndex = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
ShareConnectionContent {
|
||||
id: share_amezia
|
||||
x: 0
|
||||
text: qsTr("Share for Amnezia client")
|
||||
visible: UiLogic.pageShareAmneziaVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
height: 380
|
||||
Text {
|
||||
x: 10
|
||||
y: 280
|
||||
width: 341
|
||||
height: 111
|
||||
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.")
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 180
|
||||
width: 341
|
||||
height: 40
|
||||
text: UiLogic.pushButtonShareAmneziaCopyText
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareAmneziaCopyClicked()
|
||||
}
|
||||
enabled: UiLogic.pushButtonShareAmneziaCopyEnabled
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 130
|
||||
width: 341
|
||||
height: 40
|
||||
text: UiLogic.pushButtonShareAmneziaGenerateText
|
||||
enabled: UiLogic.pushButtonShareAmneziaGenerateEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareAmneziaGenerateClicked()
|
||||
}
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 230
|
||||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Save file")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareAmneziaSaveClicked()
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 341
|
||||
height: 100
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: UiLogic.textEditShareAmneziaCodeText
|
||||
onEditingFinished: {
|
||||
UiLogic.textEditShareAmneziaCodeText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
ct.currentIndex = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
ShareConnectionContent {
|
||||
id: share_openvpn
|
||||
x: 0
|
||||
text: qsTr("Share for OpenVPN client")
|
||||
visible: UiLogic.pageShareOpenvpnVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
height: 380
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 180
|
||||
width: 341
|
||||
height: 40
|
||||
text: UiLogic.pushButtonShareOpenvpnCopyText
|
||||
enabled: UiLogic.pushButtonShareOpenvpnCopyEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareOpenvpnCopyClicked()
|
||||
}
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 130
|
||||
width: 341
|
||||
height: 40
|
||||
text: UiLogic.pushButtonShareOpenvpnGenerateText
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareOpenvpnGenerateClicked()
|
||||
}
|
||||
enabled: UiLogic.pushButtonShareOpenvpnGenerateEnabled
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 230
|
||||
width: 341
|
||||
height: 40
|
||||
text: qsTr("Save file")
|
||||
enabled: UiLogic.pushButtonShareOpenvpnSaveEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareOpenvpnSaveClicked()
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 341
|
||||
height: 100
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: UiLogic.textEditShareOpenvpnCodeText
|
||||
onEditingFinished: {
|
||||
UiLogic.textEditShareOpenvpnCodeText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
ct.currentIndex = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
ShareConnectionContent {
|
||||
id: share_shadowshock
|
||||
x: 0
|
||||
text: qsTr("Share for ShadowSocks client")
|
||||
visible: UiLogic.pageShareShadowsocksVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
height: 380
|
||||
LabelType {
|
||||
x: 10
|
||||
y: 70
|
||||
width: 100
|
||||
height: 20
|
||||
text: qsTr("Password")
|
||||
}
|
||||
LabelType {
|
||||
x: 10
|
||||
y: 10
|
||||
width: 100
|
||||
height: 20
|
||||
text: qsTr("Server:")
|
||||
}
|
||||
LabelType {
|
||||
x: 10
|
||||
y: 50
|
||||
width: 100
|
||||
height: 20
|
||||
text: qsTr("Encryption:")
|
||||
}
|
||||
LabelType {
|
||||
x: 10
|
||||
y: 30
|
||||
width: 100
|
||||
height: 20
|
||||
text: qsTr("Port:")
|
||||
}
|
||||
LabelType {
|
||||
x: 10
|
||||
y: 100
|
||||
width: 191
|
||||
height: 20
|
||||
text: qsTr("Connection string")
|
||||
}
|
||||
LabelType {
|
||||
x: 130
|
||||
y: 70
|
||||
width: 100
|
||||
height: 20
|
||||
text: UiLogic.labelShareSsPasswordText
|
||||
}
|
||||
LabelType {
|
||||
x: 130
|
||||
y: 10
|
||||
width: 100
|
||||
height: 20
|
||||
text: UiLogic.labelShareSsServerText
|
||||
}
|
||||
LabelType {
|
||||
x: 130
|
||||
y: 50
|
||||
width: 100
|
||||
height: 20
|
||||
text: UiLogic.labelShareSsMethodText
|
||||
}
|
||||
LabelType {
|
||||
x: 130
|
||||
y: 30
|
||||
width: 100
|
||||
height: 20
|
||||
text: UiLogic.labelShareSsPortText
|
||||
}
|
||||
Image {
|
||||
id: label_share_ss_qr_code
|
||||
x: 85
|
||||
y: 235
|
||||
width: 200
|
||||
height: 200
|
||||
source: UiLogic.labelShareSsQrCodeText == "" ? "" : "data:image/png;base64," + UiLogic.labelShareSsQrCodeText
|
||||
}
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 180
|
||||
width: 331
|
||||
height: 40
|
||||
text: UiLogic.pushButtonShareSsCopyText
|
||||
enabled: UiLogic.pushButtonShareSsCopyEnabled
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonShareSsCopyClicked()
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
x: 10
|
||||
y: 130
|
||||
width: 331
|
||||
height: 100
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: UiLogic.lineEditShareSsStringText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditShareSsStringText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (active) {
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
ct.currentIndex = 3
|
||||
}
|
||||
}
|
||||
}
|
||||
ShareConnectionContent {
|
||||
id: share_cloak
|
||||
x: 0
|
||||
text: qsTr("Share for Cloak client")
|
||||
visible: UiLogic.pageShareCloakVisible
|
||||
content: Component {
|
||||
Item {
|
||||
width: 360
|
||||
height: 380
|
||||
ShareConnectionButtonType {
|
||||
x: 10
|
||||
y: 290
|
||||
width: 331
|
||||
height: 40
|
||||
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) {
|
||||
ct.currentIndex = -1
|
||||
} else {
|
||||
ct.clearActive()
|
||||
ct.currentIndex = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
194
client/ui/qml/Pages/PageSites.qml
Normal file
194
client/ui/qml/Pages/PageSites.qml
Normal file
|
@ -0,0 +1,194 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Qt.labs.platform 1.0
|
||||
import QtQuick.Dialogs 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#333333"
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Web site/Hostname/IP address/Subnet")
|
||||
x: 20
|
||||
y: 110
|
||||
width: 311
|
||||
height: 21
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 20
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: UiLogic.labelSitesAddCustomText
|
||||
x: 20
|
||||
y: 40
|
||||
width: 340
|
||||
height: 60
|
||||
}
|
||||
TextFieldType {
|
||||
x: 20
|
||||
y: 140
|
||||
width: 231
|
||||
height: 31
|
||||
placeholderText: qsTr("yousite.com or IP address")
|
||||
text: UiLogic.lineEditSitesAddCustomText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditSitesAddCustomText = text
|
||||
}
|
||||
onAccepted: {
|
||||
UiLogic.onPushButtonAddCustomSitesClicked()
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
id: back
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: sites_add
|
||||
x: 260
|
||||
y: 140
|
||||
width: 51
|
||||
height: 31
|
||||
font.pixelSize: 24
|
||||
text: "+"
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonAddCustomSitesClicked()
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: sites_delete
|
||||
x: 80
|
||||
y: 589
|
||||
width: 231
|
||||
height: 31
|
||||
font.pixelSize: 16
|
||||
text: qsTr("Delete selected")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonSitesDeleteClicked(tb.currentRow)
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
id: sites_import
|
||||
x: 320
|
||||
y: 140
|
||||
width: 51
|
||||
height: 31
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 4
|
||||
color: parent.containsMouse ? "#211966" : "#100A44"
|
||||
}
|
||||
font.pixelSize: 16
|
||||
contentItem: Item {
|
||||
anchors.fill: parent
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
width: 20
|
||||
height: 20
|
||||
source: "qrc:/images/folder.png"
|
||||
fillMode: Image.Stretch
|
||||
}
|
||||
}
|
||||
antialiasing: true
|
||||
onClicked: {
|
||||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
title: qsTr("Import IP addresses")
|
||||
visible: false
|
||||
folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
|
||||
onAccepted: {
|
||||
UiLogic.onPushButtonSitesImportClicked(fileUrl)
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
id: tb
|
||||
x: 20
|
||||
y: 200
|
||||
width: 341
|
||||
height: 371
|
||||
spacing: 1
|
||||
clip: true
|
||||
property int currentRow: -1
|
||||
model: UiLogic.tableViewSitesModel
|
||||
|
||||
delegate: Item {
|
||||
implicitWidth: 170 * 2
|
||||
implicitHeight: 30
|
||||
Item {
|
||||
width: 170
|
||||
height: 30
|
||||
anchors.left: parent.left
|
||||
id: c1
|
||||
Rectangle {
|
||||
anchors.top: parent.top
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: "lightgray"
|
||||
visible: index !== tb.currentRow
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#63B4FB"
|
||||
visible: index === tb.currentRow
|
||||
|
||||
}
|
||||
Text {
|
||||
text: url_path
|
||||
anchors.fill: parent
|
||||
leftPadding: 10
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
Item {
|
||||
anchors.left: c1.right
|
||||
width: 170
|
||||
height: 30
|
||||
Rectangle {
|
||||
anchors.top: parent.top
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: "lightgray"
|
||||
visible: index !== tb.currentRow
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#63B4FB"
|
||||
visible: index === tb.currentRow
|
||||
|
||||
}
|
||||
Text {
|
||||
text: ip
|
||||
anchors.fill: parent
|
||||
leftPadding: 10
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
tb.currentRow = index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
309
client/ui/qml/Pages/PageStart.qml
Normal file
309
client/ui/qml/Pages/PageStart.qml
Normal file
|
@ -0,0 +1,309 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
Image {
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
width: GC.trW(150)
|
||||
height: GC.trH(22)
|
||||
y: GC.trY(590)
|
||||
source: "qrc:/images/AmneziaVPN.png"
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
id: start_switch_page
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 530
|
||||
width: 301
|
||||
height: 40
|
||||
text: qsTr("Set up your own server")
|
||||
checked: false
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
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 {
|
||||
anchors.fill: parent
|
||||
border.width: 1
|
||||
border.color: "#211C4A"
|
||||
radius: 4
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
anchors.fill: parent
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#100A44"
|
||||
text: start_switch_page.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
antialiasing: true
|
||||
|
||||
}
|
||||
|
||||
|
||||
Item {
|
||||
id: page_start_import
|
||||
width: 380
|
||||
height: 481
|
||||
x: 0
|
||||
y: 35
|
||||
visible: true
|
||||
Text {
|
||||
x: 0
|
||||
y: 20
|
||||
width: 381
|
||||
height: 71
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
font.bold: true
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Connect to the already created VPN server")
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
LabelType {
|
||||
x: 40
|
||||
y: 110
|
||||
width: 301
|
||||
height: 21
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Connection code")
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_start_existing_code
|
||||
x: 40
|
||||
y: 140
|
||||
width: 300
|
||||
height: 40
|
||||
placeholderText: "vpn://..."
|
||||
text: UiLogic.lineEditStartExistingCodeText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditStartExistingCodeText = text
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: new_sever_import
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 210
|
||||
width: 301
|
||||
height: 40
|
||||
text: qsTr("Connect")
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonNewServerImport()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Item {
|
||||
id: page_start_new_server
|
||||
width: 380
|
||||
height: 481
|
||||
x: 0
|
||||
y: 35
|
||||
visible: false
|
||||
Label {
|
||||
x:10
|
||||
y:0
|
||||
width: 361
|
||||
height: 31
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
font.bold: true
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Setup your server to use VPN")
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
LabelType {
|
||||
x: 40
|
||||
y: 70
|
||||
width: 171
|
||||
height: 21
|
||||
text: qsTr("Server IP address")
|
||||
}
|
||||
LabelType {
|
||||
x: 40
|
||||
y: 150
|
||||
width: 261
|
||||
height: 21
|
||||
text: qsTr("Login to connect via SSH")
|
||||
}
|
||||
LabelType {
|
||||
id: label_new_server_password
|
||||
x: 40
|
||||
y: 230
|
||||
width: 171
|
||||
height: 21
|
||||
text: qsTr("Password")
|
||||
}
|
||||
LabelType {
|
||||
x: 40
|
||||
y: 390
|
||||
width: 301
|
||||
height: 41
|
||||
text: UiLogic.labelNewServerWaitInfoText
|
||||
visible: UiLogic.labelNewServerWaitInfoVisible
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
TextFieldType {
|
||||
id: new_server_ip
|
||||
x: 40
|
||||
y: 100
|
||||
width: 300
|
||||
height: 40
|
||||
text: UiLogic.lineEditNewServerIpText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNewServerIpText = text
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
id: new_server_login
|
||||
x: 40
|
||||
y: 180
|
||||
width: 300
|
||||
height: 40
|
||||
text: UiLogic.lineEditNewServerLoginText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNewServerLoginText = text
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
id: new_server_password
|
||||
x: 40
|
||||
y: 260
|
||||
width: 300
|
||||
height: 40
|
||||
echoMode: TextInput.Password
|
||||
text: UiLogic.lineEditNewServerPasswordText
|
||||
onEditingFinished: {
|
||||
UiLogic.lineEditNewServerPasswordText = text
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: new_sever_connect
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 350
|
||||
width: 301
|
||||
height: 40
|
||||
text: UiLogic.pushButtonNewServerConnectText
|
||||
visible: UiLogic.pushButtonNewServerConnectVisible
|
||||
onClicked: {
|
||||
UiLogic.onPushButtonNewServerConnect()
|
||||
}
|
||||
enabled: UiLogic.pushButtonNewServerConnectEnabled
|
||||
}
|
||||
BasicButtonType {
|
||||
id: new_sever_connect_key
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 450
|
||||
width: 281
|
||||
height: 21
|
||||
text: qsTr("Connect using SSH key")
|
||||
background: Item {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
anchors.fill: parent
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#15CDCB";
|
||||
text: new_sever_connect_key.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
antialiasing: true
|
||||
checkable: true
|
||||
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 {
|
||||
id: new_sever_get_info
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 40
|
||||
width: 281
|
||||
height: 21
|
||||
text: qsTr("Where to get connection data →")
|
||||
background: Item {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
anchors.fill: parent
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#15CDCB";
|
||||
text: new_sever_get_info.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
antialiasing: true
|
||||
checkable: true
|
||||
checked: true
|
||||
onClicked: {
|
||||
Qt.openUrlExternally("https://amnezia.org")
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
id: new_server_ssh_key
|
||||
x: 40
|
||||
y: 260
|
||||
width: 300
|
||||
height: 71
|
||||
echoMode: TextInput.Password
|
||||
font.pixelSize: 9
|
||||
verticalAlignment: Text.AlignTop
|
||||
text: UiLogic.textEditNewServerSshKeyText
|
||||
onEditingFinished: {
|
||||
UiLogic.textEditNewServerSshKeyText = text
|
||||
}
|
||||
visible: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ImageButtonType {
|
||||
id: back_from_start
|
||||
x: 10
|
||||
y: 10
|
||||
width: 26
|
||||
height: 20
|
||||
icon.source: "qrc:/images/arrow_left.png"
|
||||
visible: UiLogic.pushButtonBackFromStartVisible
|
||||
onClicked: {
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
}
|
243
client/ui/qml/Pages/PageVPN.qml
Normal file
243
client/ui/qml/Pages/PageVPN.qml
Normal file
|
@ -0,0 +1,243 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
Image {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 0
|
||||
width: parent.width
|
||||
|
||||
// width: 380
|
||||
// height: 325
|
||||
source: "qrc:/images/background_connected.png"
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
x: parent.width - 40
|
||||
y: 10
|
||||
width: 31
|
||||
height: 31
|
||||
icon.source: "qrc:/images/settings_grey.png"
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.GeneralSettings)
|
||||
}
|
||||
}
|
||||
|
||||
LabelType {
|
||||
id: error_text
|
||||
x: 0
|
||||
y: 280
|
||||
width: 381
|
||||
height: 61
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: UiLogic.labelErrorText
|
||||
}
|
||||
Text {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 250
|
||||
width: 380
|
||||
height: 31
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 15
|
||||
color: "#181922"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: UiLogic.labelStateText
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
id: button_connect
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 200
|
||||
width: 80
|
||||
height: 40
|
||||
checkable: true
|
||||
checked: UiLogic.pushButtonConnectChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.pushButtonConnectChecked = checked
|
||||
UiLogic.onPushButtonConnectClicked(checked)
|
||||
}
|
||||
background: Image {
|
||||
anchors.fill: parent
|
||||
source: button_connect.checked ? "qrc:/images/connect_button_connected.png"
|
||||
: "qrc:/images/connect_button_disconnected.png"
|
||||
}
|
||||
contentItem: Item {}
|
||||
antialiasing: true
|
||||
enabled: UiLogic.pushButtonConnectEnabled
|
||||
}
|
||||
|
||||
Item {
|
||||
x: 0
|
||||
anchors.bottom: line.top
|
||||
anchors.bottomMargin: 10
|
||||
width: parent.width
|
||||
height: 51
|
||||
Image {
|
||||
anchors.horizontalCenter: upload_label.horizontalCenter
|
||||
y: 10
|
||||
width: 15
|
||||
height: 15
|
||||
source: "qrc:/images/upload.png"
|
||||
}
|
||||
Image {
|
||||
anchors.horizontalCenter: download_label.horizontalCenter
|
||||
y: 10
|
||||
width: 15
|
||||
height: 15
|
||||
source: "qrc:/images/download.png"
|
||||
}
|
||||
Text {
|
||||
id: download_label
|
||||
x: 0
|
||||
y: 20
|
||||
width: 130
|
||||
height: 30
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#4171D6"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: UiLogic.labelSpeedReceivedText
|
||||
}
|
||||
Text {
|
||||
id: upload_label
|
||||
x: parent.width - width
|
||||
y: 20
|
||||
width: 130
|
||||
height: 30
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#42D185"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: UiLogic.labelSpeedSentText
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: line
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
anchors.bottom: conn_type_label.top
|
||||
anchors.bottomMargin: 10
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
|
||||
Text {
|
||||
id: conn_type_label
|
||||
x: 20
|
||||
anchors.bottom: conn_type_group.top
|
||||
anchors.bottomMargin: 10
|
||||
width: 281
|
||||
height: 21
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 15
|
||||
color: "#181922"
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: qsTr("How to use VPN")
|
||||
}
|
||||
|
||||
Item {
|
||||
id: conn_type_group
|
||||
x: 20
|
||||
anchors.bottom: button_add_site.top
|
||||
width: 351
|
||||
height: 91
|
||||
enabled: UiLogic.widgetVpnModeEnabled
|
||||
RadioButtonType {
|
||||
x: 0
|
||||
y: 0
|
||||
width: 341
|
||||
height: 19
|
||||
checked: UiLogic.radioButtonVpnModeAllSitesChecked
|
||||
text: qsTr("For all connections")
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonVpnModeAllSitesChecked = checked
|
||||
button_add_site.enabled = !checked
|
||||
UiLogic.onRadioButtonVpnModeAllSitesToggled(checked)
|
||||
}
|
||||
}
|
||||
RadioButtonType {
|
||||
x: 0
|
||||
y: 60
|
||||
width: 341
|
||||
height: 19
|
||||
text: qsTr("Except selected sites")
|
||||
checked: UiLogic.radioButtonVpnModeExceptSitesChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonVpnModeExceptSitesChecked = checked
|
||||
UiLogic.onRadioButtonVpnModeExceptSitesToggled(checked)
|
||||
}
|
||||
}
|
||||
RadioButtonType {
|
||||
x: 0
|
||||
y: 30
|
||||
width: 341
|
||||
height: 19
|
||||
text: qsTr("For selected sites")
|
||||
checked: UiLogic.radioButtonVpnModeForwardSitesChecked
|
||||
onCheckedChanged: {
|
||||
UiLogic.radioButtonVpnModeForwardSitesChecked = checked
|
||||
UiLogic.onRadioButtonVpnModeForwardSitesToggled(checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
id: button_add_site
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: parent.height - 60
|
||||
//anchors.bottom: parent.bottom
|
||||
width: parent.width - 40
|
||||
height: 40
|
||||
text: qsTr("+ Add site")
|
||||
enabled: UiLogic.pushButtonVpnAddSiteEnabled
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 4
|
||||
color: {
|
||||
if (!button_add_site.enabled) {
|
||||
return "#484952"
|
||||
}
|
||||
if (button_add_site.containsMouse) {
|
||||
return "#282932"
|
||||
}
|
||||
return "#181922"
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
anchors.fill: parent
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#D4D4D4"
|
||||
text: button_add_site.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
antialiasing: true
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Sites)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue