Merge branch 'qt_migration' of github.com:amnezia-vpn/desktop-client into feature/qt6-client-management-panel

This commit is contained in:
vladimir.kuznetsov 2023-01-12 20:28:13 +03:00
commit f24df9fb05
51 changed files with 1044 additions and 906 deletions

View file

@ -6,7 +6,9 @@ Item {
readonly property string screenHomeIntroGifEx1: "qrc:/ScreenHomeIntroGifEx1.qml"
readonly property int screenWidth: 380
readonly property int screenHeight: 640
readonly property int screenHeight: 680
readonly property int defaultMargin: 20
function isMobile() {
if (Qt.platform.os == "android" ||
@ -24,20 +26,4 @@ Item {
}
return false
}
function trX(x) {
return x
}
function trY(y) {
return y
}
function trW(w) {
return w
}
function trH(h) {
return h
}
}

View file

@ -1,11 +1,12 @@
import QtQuick
import QtQuick.Controls
import "../Config"
BasicButtonType {
id: root
width: parent.width - 80
height: 40
width: parent.width - 2 * GC.defaultMargin
implicitHeight: 40
background: Rectangle {
anchors.fill: parent

View file

@ -0,0 +1,26 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import "../Config"
Flickable {
id: fl
clip: true
width: parent.width
anchors.topMargin: GC.defaultMargin
anchors.bottom: parent.bottom
anchors.bottomMargin: GC.defaultMargin
anchors.left: root.left
anchors.leftMargin: GC.defaultMargin
anchors.right: root.right
anchors.rightMargin: 1
Keys.onUpPressed: scrollBar.decrease()
Keys.onDownPressed: scrollBar.increase()
ScrollBar.vertical: ScrollBar {
id: scrollBar
policy: fl.height >= fl.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
}
}

View file

@ -1,9 +1,9 @@
import QtQuick
import "../Config"
Text {
id: root
x: 40
width: parent.width
width: parent.width - 2 * GC.defaultMargin
anchors.topMargin: 10
font.family: "Lato"

View file

@ -1,19 +1,20 @@
import QtQuick
import QtQuick.Controls
import Qt.labs.platform
import "../Config"
TextField {
id: root
property bool error: false
width: parent.width - 80
width: parent.width - 2 * GC.defaultMargin
height: 40
anchors.topMargin: 5
selectByMouse: true
selectionColor: "darkgray"
font.pixelSize: 16
color: "#333333"
background: Rectangle {
implicitWidth: 200
implicitHeight: 40

View file

@ -0,0 +1,25 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
BasicButtonType {
property alias label: lbl
id: root
antialiasing: true
height: 21
background: Item {}
contentItem: Text {
id: lbl
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 18
font.underline: true
text: root.text
color: "#3045ee"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}

View file

@ -48,8 +48,7 @@ Drawer {
}
Flickable {
clip: true
FlickableType {
anchors.fill: parent
contentHeight: col.height

View file

@ -19,20 +19,10 @@ PageBase {
text: qsTr("Application Settings")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: logo.top
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -40,6 +30,7 @@ PageBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
CheckBoxType {
visible: !GC.isMobile()
@ -79,7 +70,6 @@ PageBase {
BlueButtonType {
visible: !GC.isMobile()
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Check for updates")
onClicked: {
Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest")
@ -98,7 +88,6 @@ PageBase {
}
BlueButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Open logs folder")
onClicked: {
AppSettingsLogic.onPushButtonOpenLogsClicked()
@ -108,7 +97,6 @@ PageBase {
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
Layout.preferredHeight: 41
text: qsTr("Export logs")
onClicked: {
AppSettingsLogic.onPushButtonExportLogsClicked()
@ -118,7 +106,6 @@ PageBase {
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
Layout.preferredHeight: 41
property string start_text: qsTr("Clear logs")
property string end_text: qsTr("Cleared")
@ -162,9 +149,4 @@ PageBase {
}
}
}
Logo {
id: logo
anchors.bottom: parent.bottom
}
}

View file

@ -17,8 +17,4 @@ Item {
onActivated: pageActive = true
onDeactivated: pageActive = false
// width: GC.screenWidth
// height: GC.screenHeight
}

View file

@ -16,20 +16,12 @@ PageBase {
z: -1
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: back.bottom
anchors.topMargin: 0
anchors.bottom: root.bottom
anchors.bottomMargin: 10
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -38,6 +30,7 @@ PageBase {
anchors.topMargin: 10
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin
spacing: 15

View file

@ -1,5 +1,6 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
@ -18,108 +19,95 @@ PageBase {
text: qsTr("DNS Servers")
}
CheckBoxType {
id: cb_amnezia_dns
FlickableType {
id: fl
anchors.top: caption.bottom
x: 30
width: parent.width - 60
text: qsTr("Use AmneziaDNS service (recommended)")
checked: NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked
onCheckedChanged: {
NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked = checked
NetworkSettingsLogic.onCheckBoxUseAmneziaDnsToggled(checked)
UiLogic.onUpdateAllPages()
}
}
contentHeight: content.height
LabelType {
id: lb_amnezia_dns
x: 30
anchors.top: cb_amnezia_dns.bottom
width: parent.width - 60
text: qsTr("Use AmneziaDNS container on your server, when it installed.\n
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
CheckBoxType {
Layout.preferredWidth: parent.width
text: qsTr("Use AmneziaDNS service (recommended)")
checked: NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked
onCheckedChanged: {
NetworkSettingsLogic.checkBoxUseAmneziaDnsChecked = checked
NetworkSettingsLogic.onCheckBoxUseAmneziaDnsToggled(checked)
UiLogic.onUpdateAllPages()
}
}
LabelType {
Layout.preferredWidth: parent.width
text: qsTr("Use AmneziaDNS container on your server, when it installed.\n
Your AmneziaDNS server available only when it installed and VPN connected, it has internal IP address 172.29.172.254\n
If AmneziaDNS service is not installed on the same server, or this option is unchecked, the following DNS servers will be used:")
}
}
LabelType {
id: l1
x: 30
anchors.top: lb_amnezia_dns.bottom
width: parent.width - 30
height: 21
text: qsTr("Primary DNS server")
}
TextFieldType {
id: dns1
x: 30
anchors.top: l1.bottom
width: parent.width - 90
height: 40
text: NetworkSettingsLogic.lineEditDns1Text
onEditingFinished: {
NetworkSettingsLogic.lineEditDns1Text = text
NetworkSettingsLogic.onLineEditDns1EditFinished(text)
UiLogic.onUpdateAllPages()
}
validator: RegularExpressionValidator {
regularExpression: NetworkSettingsLogic.ipAddressRegex
}
}
SvgButtonType {
id: resetDNS1
anchors. left: dns1.right
anchors.leftMargin: 10
anchors.verticalCenter: dns1.verticalCenter
width: 24
height: 24
icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
onClicked: {
NetworkSettingsLogic.onPushButtonResetDns1Clicked()
UiLogic.onUpdateAllPages()
}
}
LabelType {
Layout.topMargin: 15
text: qsTr("Primary DNS server")
}
TextFieldType {
height: 40
implicitWidth: parent.width
text: NetworkSettingsLogic.lineEditDns1Text
onEditingFinished: {
NetworkSettingsLogic.lineEditDns1Text = text
NetworkSettingsLogic.onLineEditDns1EditFinished(text)
UiLogic.onUpdateAllPages()
}
validator: RegularExpressionValidator {
regularExpression: NetworkSettingsLogic.ipAddressRegex
}
}
LabelType {
id: l2
x: 30
anchors.top: dns1.bottom
anchors.topMargin: 20
width: parent.width - 60
height: 21
text: qsTr("Secondary DNS server")
}
TextFieldType {
id: dns2
x: 30
anchors.top: l2.bottom
width: parent.width - 90
height: 40
text: NetworkSettingsLogic.lineEditDns2Text
onEditingFinished: {
NetworkSettingsLogic.lineEditDns2Text = text
NetworkSettingsLogic.onLineEditDns2EditFinished(text)
UiLogic.onUpdateAllPages()
}
validator: RegularExpressionValidator {
regularExpression: NetworkSettingsLogic.ipAddressRegex
}
}
SvgButtonType {
id: resetDNS2
anchors. left: dns2.right
anchors.leftMargin: 10
anchors.verticalCenter: dns2.verticalCenter
width: 24
height: 24
icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
onClicked: {
NetworkSettingsLogic.onPushButtonResetDns2Clicked()
UiLogic.onUpdateAllPages()
}
}
UrlButtonType {
text: qsTr("Reset to default")
label.horizontalAlignment: Text.AlignLeft
label.verticalAlignment: Text.AlignTop
label.font.pixelSize: 14
icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
onClicked: {
NetworkSettingsLogic.onPushButtonResetDns1Clicked()
UiLogic.onUpdateAllPages()
}
}
Logo {
anchors.bottom: parent.bottom
LabelType {
text: qsTr("Secondary DNS server")
}
TextFieldType {
height: 40
implicitWidth: parent.width
text: NetworkSettingsLogic.lineEditDns2Text
onEditingFinished: {
NetworkSettingsLogic.lineEditDns2Text = text
NetworkSettingsLogic.onLineEditDns2EditFinished(text)
UiLogic.onUpdateAllPages()
}
validator: RegularExpressionValidator {
regularExpression: NetworkSettingsLogic.ipAddressRegex
}
}
UrlButtonType {
text: qsTr("Reset to default")
label.horizontalAlignment: Text.AlignLeft
label.verticalAlignment: Text.AlignTop
label.font.pixelSize: 14
icon.source: "qrc:/images/svg/refresh_black_24dp.svg"
onClicked: {
NetworkSettingsLogic.onPushButtonResetDns2Clicked()
UiLogic.onUpdateAllPages()
}
}
}
}
}

View file

@ -8,7 +8,6 @@ import "../Config"
PageBase {
id: root
page: PageEnum.NewServer
//logic: {}
BackButton {
id: back_from_new_server
@ -22,15 +21,15 @@ PageBase {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: qsTr("If you want easily configure your server just run Wizard")
width: parent.width - 80
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: caption.bottom
anchors.topMargin: 30
}
BlueButtonType {
id: pushButtonWizard
text: qsTr("Run Setup Wizard")
anchors.top: labelWizard.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: labelWizard.bottom
anchors.topMargin: 10
onClicked: {
UiLogic.goToPage(PageEnum.Wizard);
@ -41,14 +40,13 @@ PageBase {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: qsTr("Press configure manually to choose VPN protocols you want to install")
width: parent.width - 80
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: pushButtonWizard.bottom
anchors.topMargin: 40
}
BlueButtonType {
text: qsTr("Configure VPN protocols manually")
text: qsTr("Configure")
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: labelManual.bottom
anchors.topMargin: 10

View file

@ -32,6 +32,7 @@ PageBase {
BackButton {
id: back
onClicked: tb_c.currentIndex = -1
}
Caption {
id: caption
@ -174,11 +175,7 @@ PageBase {
}
}
Flickable {
FlickableType {
visible: container_selector.selectedIndex <= 0
clip: true
width: parent.width
@ -224,7 +221,6 @@ PageBase {
ListView {
id: tb_c
x: 10
width: parent.width - 10
height: tb_c.contentItem.height
currentIndex: -1
@ -293,7 +289,7 @@ PageBase {
ImageButtonType {
id: button_remove
visible: index === tb_c.currentIndex
visible: (index === tb_c.currentIndex) && ServerContainersLogic.isManagedServer
Layout.alignment: Qt.AlignRight
checkable: true
icon.source: "qrc:/images/delete.png"
@ -320,7 +316,7 @@ PageBase {
ImageButtonType {
id: button_share
visible: index === tb_c.currentIndex
visible: (index === tb_c.currentIndex) && ServerContainersLogic.isManagedServer
Layout.alignment: Qt.AlignRight
icon.source: "qrc:/images/share.png"
implicitWidth: 30
@ -431,7 +427,7 @@ PageBase {
width: parent.width - 40
height: 40
text: qsTr("Install new protocols container")
text: qsTr("Install new service")
font.pixelSize: 16
onClicked: container_selector.visible ? container_selector.close() : container_selector.open()

View file

@ -35,10 +35,10 @@ PageBase {
ListView {
id: listWidget_servers
x: 20
x: GC.defaultMargin
anchors.top: caption.bottom
anchors.topMargin: 15
width: parent.width
width: parent.width - GC.defaultMargin - 1
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
model: ServerListLogic.serverListModel
@ -49,7 +49,7 @@ PageBase {
clip: true
delegate: Item {
height: 60
width: root.width - 40
width: listWidget_servers.width - 15
MouseArea {
id: ms
anchors.fill: parent
@ -96,14 +96,14 @@ PageBase {
id: label_address
x: 20
y: 40
width: 141
width: listWidget_servers.width - 100
height: 16
text: address
}
Text {
x: 10
y: 10
width: 181
width: listWidget_servers.width - 100
height: 21
font.family: "Lato"
font.styleName: "normal"
@ -177,5 +177,9 @@ PageBase {
}
}
}
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
}
}
}

View file

@ -23,20 +23,11 @@ PageBase {
anchors.horizontalCenter: parent.horizontalCenter
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: logo.top
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -44,16 +35,13 @@ PageBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
TextFieldType {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 251
Layout.preferredHeight: 31
text: ServerSettingsLogic.lineEditDescriptionText
onEditingFinished: {
ServerSettingsLogic.lineEditDescriptionText = text
ServerSettingsLogic.onLineEditDescriptionEditingFinished()
}
LabelType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ServerSettingsLogic.labelCurrentVpnProtocolText
}
TextFieldType {
@ -67,25 +55,29 @@ PageBase {
LabelType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ServerSettingsLogic.labelCurrentVpnProtocolText
text: ServerSettingsLogic.labelWaitInfoText
visible: ServerSettingsLogic.labelWaitInfoVisible
}
BlueButtonType {
Layout.topMargin: 15
TextFieldType {
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Protocols and Services")
onClicked: {
UiLogic.goToPage(PageEnum.ServerContainers)
text: ServerSettingsLogic.lineEditDescriptionText
onEditingFinished: {
ServerSettingsLogic.lineEditDescriptionText = text
ServerSettingsLogic.onLineEditDescriptionEditingFinished()
}
}
BlueButtonType {
Layout.topMargin: 10
text: qsTr("Protocols and Services")
Layout.topMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: 41
onClicked: {
UiLogic.goToPage(PageEnum.ServerContainers)
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: qsTr("Share Server (FULL ACCESS)")
visible: ServerSettingsLogic.pushButtonShareFullVisible
onClicked: {
@ -94,57 +86,46 @@ PageBase {
}
BlueButtonType {
Layout.topMargin: 10
Layout.topMargin: 60
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Clients Management")
onClicked: {
UiLogic.goToPage(PageEnum.ClientManagement)
}
}
BlueButtonType {
Layout.topMargin: 30
Layout.fillWidth: true
Layout.preferredHeight: 41
text: ServerSettingsLogic.pushButtonClearClientCacheText
visible: ServerSettingsLogic.pushButtonClearClientCacheVisible
onClicked: {
ServerSettingsLogic.onPushButtonClearClientCacheClicked()
}
}
BlueButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 41
text: ServerSettingsLogic.pushButtonClearText
visible: ServerSettingsLogic.pushButtonClearVisible
onClicked: {
ServerSettingsLogic.onPushButtonClearServer()
}
}
BlueButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 41
Layout.topMargin: 10
text: ServerSettingsLogic.pushButtonClearClientCacheText
visible: ServerSettingsLogic.pushButtonClearClientCacheVisible
onClicked: {
ServerSettingsLogic.onPushButtonClearClientCacheClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: qsTr("Forget this server")
onClicked: {
ServerSettingsLogic.onPushButtonForgetServer()
}
}
LabelType {
Layout.fillWidth: true
text: ServerSettingsLogic.labelWaitInfoText
visible: ServerSettingsLogic.labelWaitInfoVisible
}
}
}
Logo {
id: logo
id : logo
anchors.bottom: parent.bottom
}
}

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup your server to use VPN")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
anchors.bottom: next_button.top
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
RadioButtonType {
id: radioButton_setup_wizard_high
@ -93,21 +85,23 @@ OpenVPN over ShadowSocks profile will be installed.\n")
text: qsTr("I want to improve my privacy on the internet.
OpenVPN profile will be installed.\n")
}
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Next")
onClicked: {
if (radioButton_setup_wizard_high.checked) {
UiLogic.goToPage(PageEnum.WizardHigh, false);
} else if (radioButton_setup_wizard_medium.checked) {
UiLogic.goToPage(PageEnum.WizardMedium, false);
} else if (radioButton_setup_wizard_low.checked) {
UiLogic.goToPage(PageEnum.WizardLow, false);
}
}
BlueButtonType {
id: next_button
anchors.bottom: parent.bottom
anchors.bottomMargin: GC.defaultMargin
x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Next")
onClicked: {
if (radioButton_setup_wizard_high.checked) {
UiLogic.goToPage(PageEnum.WizardHigh, false);
} else if (radioButton_setup_wizard_medium.checked) {
UiLogic.goToPage(PageEnum.WizardMedium, false);
} else if (radioButton_setup_wizard_low.checked) {
UiLogic.goToPage(PageEnum.WizardLow, false);
}
}
}

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup Wizard")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
anchors.bottom: next_button.top
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
Layout.fillWidth: true
@ -83,22 +75,22 @@ You SHOULD set this website address to some foreign website which is not blocked
This protocol support exporting connection profiles to mobile devices by exporting ShadowSocks and Cloak configs (you should launch the 3rd party open source VPN client - ShadowSocks VPN and install Cloak plugin).")
}
BlueButtonType {
id: next_button
Layout.fillWidth: true
Layout.topMargin: 15
Layout.preferredHeight: 41
text: qsTr("Next")
onClicked: {
let domain = website_masking.text;
if (!domain || !domain.includes(".")) {
return
}
UiLogic.goToPage(PageEnum.WizardVpnMode, false)
}
}
}
}
BlueButtonType {
id: next_button
anchors.bottom: parent.bottom
anchors.bottomMargin: GC.defaultMargin
x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Next")
onClicked: {
let domain = website_masking.text;
if (!domain || !domain.includes(".")) {
return
}
UiLogic.goToPage(PageEnum.WizardVpnMode, false)
}
}
}

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup Wizard")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
anchors.bottom: next_button.top
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
Layout.fillWidth: true
@ -56,16 +48,18 @@ We recommend not to use messaging applications for sending the connection profil
text: qsTr('OpenVPN profile will be installed')
verticalAlignment: Text.AlignBottom
}
BlueButtonType {
id: next_button
Layout.fillWidth: true
Layout.topMargin: 15
Layout.preferredHeight: 41
text: qsTr("Start configuring")
onClicked: {
WizardLogic.onPushButtonLowFinishClicked()
}
}
}
}
BlueButtonType {
id: next_button
anchors.bottom: parent.bottom
anchors.bottomMargin: GC.defaultMargin
x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Start configuring")
onClicked: {
WizardLogic.onPushButtonLowFinishClicked()
}
}
}

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup Wizard")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
anchors.bottom: next_button.top
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
Layout.fillWidth: true
@ -51,16 +43,18 @@ PageBase {
Layout.topMargin: 15
text: qsTr('OpenVPN over ShadowSocks profile will be installed')
}
BlueButtonType {
id: next_button
Layout.fillWidth: true
Layout.topMargin: 15
Layout.preferredHeight: 41
text: qsTr("Next")
onClicked: {
UiLogic.goToPage(PageEnum.WizardVpnMode, false)
}
}
}
}
BlueButtonType {
id: next_button
anchors.bottom: parent.bottom
anchors.bottomMargin: GC.defaultMargin
x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Next")
onClicked: {
UiLogic.goToPage(PageEnum.WizardVpnMode, false)
}
}
}

View file

@ -19,20 +19,11 @@ PageBase {
text: qsTr("Setup Wizard")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
anchors.bottom: vpn_mode_finish.top
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -40,6 +31,7 @@ PageBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
Layout.fillWidth: true
@ -56,17 +48,18 @@ You can enable VPN mode "For selected sites" and add blocked sites you need to v
WizardLogic.checkBoxVpnModeChecked = checked
}
}
}
}
BlueButtonType {
id: vpn_mode_finish
Layout.fillWidth: true
Layout.topMargin: 15
Layout.preferredHeight: 41
text: qsTr("Start configuring")
onClicked: {
WizardLogic.onPushButtonVpnModeFinishClicked()
}
}
BlueButtonType {
id: vpn_mode_finish
anchors.bottom: parent.bottom
anchors.bottomMargin: GC.defaultMargin
x: GC.defaultMargin
width: parent.width - 2 * GC.defaultMargin
text: qsTr("Start configuring")
onClicked: {
WizardLogic.onPushButtonVpnModeFinishClicked()
}
}
}

View file

@ -27,12 +27,11 @@ PageBase {
}
Flickable {
FlickableType {
clip: true
width: parent.width
anchors.top: caption.bottom
anchors.bottom: root.bottom
contentHeight: col.height
boundsBehavior: Flickable.StopAtBounds
Column {
id: col
@ -54,7 +53,6 @@ PageBase {
ShareConnectionContent {
x: 10
text: qsTr("Share for Amnezia")
height: 40
width: tb_c.width - 10
@ -63,7 +61,6 @@ PageBase {
ListView {
id: tb_c
x: 10
width: parent.width - 10
height: tb_c.contentItem.height
currentIndex: -1

View file

@ -46,12 +46,12 @@ PageBase {
BasicButtonType {
id: start_switch_page
width: parent.width - 2 * GC.defaultMargin
implicitHeight: 40
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: logo.top
anchors.bottomMargin: 10
width: parent.width - 80
height: 40
anchors.topMargin: 20
text: qsTr("Set up your own server")
@ -88,7 +88,6 @@ PageBase {
verticalAlignment: Text.AlignVCenter
}
antialiasing: true
}
Item {
@ -104,6 +103,7 @@ PageBase {
id: label_connection_code
anchors.top: parent.top
anchors.topMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Connection code")
}
TextFieldType {
@ -303,7 +303,8 @@ PageBase {
}
enabled: StartPageLogic.pushButtonConnectEnabled
}
BasicButtonType {
UrlButtonType {
id: new_sever_connect_key
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: new_sever_connect.bottom
@ -311,21 +312,8 @@ PageBase {
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
label.font.pixelSize: 16
checkable: true
checked: StartPageLogic.pushButtonConnectKeyChecked
onCheckedChanged: {

View file

@ -30,27 +30,12 @@ PageBase {
font.pixelSize: 12
}
BasicButtonType {
UrlButtonType {
y: 10
anchors.horizontalCenter: parent.horizontalCenter
height: 21
background: Item {}
contentItem: Text {
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 18
font.underline: true
text: qsTr("Donate")
color: "#D4D4D4"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
label.color: "#D4D4D4"
label.text: qsTr("Donate")
onClicked: {
UiLogic.goToPage(PageEnum.About)

View file

@ -20,20 +20,10 @@ PageBase {
text: qsTr("Check config")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -41,6 +31,7 @@ PageBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
TextAreaType {
id: ta_config
@ -124,7 +115,7 @@ AmneziaVPN detected this profile may contain malicious scripts. Please, carefull
BasicButtonType {
Layout.preferredWidth: (content.width - parent.spacing) /2
Layout.preferredHeight: 41
Layout.preferredHeight: 40
font.pixelSize: btn_import.font.pixelSize
text: qsTr("Cancel")
onClicked: {
@ -135,7 +126,6 @@ AmneziaVPN detected this profile may contain malicious scripts. Please, carefull
BlueButtonType {
id: btn_import
Layout.preferredWidth: (content.width - parent.spacing) /2
Layout.preferredHeight: 41
text: qsTr("Import config")
onClicked: {
logic.importConfig()

View file

@ -19,387 +19,398 @@ PageProtocolBase {
text: qsTr("OpenVPN Settings")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin - 1
ColumnLayout {
visible: !logic.isThirdPartyConfig
enabled: logic.pageEnabled
LabelType {
id: lb_subnet
height: 21
text: qsTr("VPN Addresses Subnet")
}
TextFieldType {
id: tf_subnet
implicitWidth: parent.width
height: 31
text: logic.lineEditSubnetText
onEditingFinished: {
logic.lineEditSubnetText = text
}
}
//
LabelType {
id: lb_proto
Layout.topMargin: 20
height: 21
text: qsTr("Network protocol")
}
Rectangle {
id: rect_proto
implicitWidth: root.width - 60
height: 71
border.width: 1
border.color: "lightgray"
radius: 2
RadioButtonType {
x: 10
y: 40
width: 171
height: 19
text: qsTr("TCP")
enabled: logic.radioButtonTcpEnabled
checked: logic.radioButtonTcpChecked
onCheckedChanged: {
UiLogic.radioButtonTcpChecked = checked
}
}
RadioButtonType {
x: 10
y: 10
width: 171
height: 19
text: qsTr("UDP")
checked: logic.radioButtonUdpChecked
onCheckedChanged: {
logic.radioButtonUdpChecked = checked
}
enabled: logic.radioButtonUdpEnabled
}
}
//
RowLayout {
Layout.topMargin: 10
Layout.fillWidth: true
LabelType {
id: lb_port
height: 31
text: qsTr("Port")
Layout.preferredWidth: root.width / 2 - 10
id: lb_subnet
height: 21
text: qsTr("VPN Addresses Subnet")
}
TextFieldType {
id: tf_port
id: tf_subnet
implicitWidth: parent.width
height: 31
text: logic.lineEditSubnetText
onEditingFinished: {
logic.lineEditSubnetText = text
}
}
//
LabelType {
id: lb_proto
Layout.topMargin: 20
height: 21
text: qsTr("Network protocol")
}
Rectangle {
id: rect_proto
implicitWidth: parent.width
height: 71
border.width: 1
border.color: "lightgray"
radius: 2
RadioButtonType {
x: 10
y: 40
width: 171
height: 19
text: qsTr("TCP")
enabled: logic.radioButtonTcpEnabled
checked: logic.radioButtonTcpChecked
onCheckedChanged: {
logic.radioButtonTcpChecked = checked
}
}
RadioButtonType {
x: 10
y: 10
width: 171
height: 19
text: qsTr("UDP")
checked: logic.radioButtonUdpChecked
onCheckedChanged: {
logic.radioButtonUdpChecked = checked
}
enabled: logic.radioButtonUdpEnabled
}
}
//
RowLayout {
Layout.topMargin: 10
Layout.fillWidth: true
LabelType {
id: lb_port
height: 31
text: qsTr("Port")
Layout.preferredWidth: root.width / 2 - 10
}
TextFieldType {
id: tf_port
Layout.fillWidth: true
height: 31
text: logic.lineEditPortText
onEditingFinished: {
logic.lineEditPortText = text
}
enabled: logic.lineEditPortEnabled
}
}
//
CheckBoxType {
id: check_auto_enc
implicitWidth: parent.width
height: 21
text: qsTr("Auto-negotiate encryption")
checked: logic.checkBoxAutoEncryptionChecked
onCheckedChanged: {
logic.checkBoxAutoEncryptionChecked = checked
}
onClicked: {
logic.checkBoxAutoEncryptionClicked()
}
}
//
LabelType {
id: lb_cipher
height: 21
text: qsTr("Cipher")
}
ComboBoxType {
id: cb_cipher
implicitWidth: parent.width
height: 31
text: logic.lineEditPortText
onEditingFinished: {
logic.lineEditPortText = text
}
enabled: logic.lineEditPortEnabled
}
}
//
CheckBoxType {
id: check_auto_enc
implicitWidth: parent.width
height: 21
text: qsTr("Auto-negotiate encryption")
checked: logic.checkBoxAutoEncryptionChecked
onCheckedChanged: {
logic.checkBoxAutoEncryptionChecked = checked
}
onClicked: {
logic.checkBoxAutoEncryptionClicked()
}
}
//
LabelType {
id: lb_cipher
height: 21
text: qsTr("Cipher")
}
ComboBoxType {
id: cb_cipher
implicitWidth: parent.width
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 (logic.comboBoxVpnCipherText === model[i]) {
return i
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 (logic.comboBoxVpnCipherText === model[i]) {
return i
}
}
return -1
}
return -1
onCurrentTextChanged: {
logic.comboBoxVpnCipherText = currentText
}
enabled: !check_auto_enc.checked
}
onCurrentTextChanged: {
logic.comboBoxVpnCipherText = currentText
}
enabled: !check_auto_enc.checked
}
//
LabelType {
id: lb_hash
height: 21
Layout.topMargin: 20
text: qsTr("Hash")
}
ComboBoxType {
id: cb_hash
height: 31
implicitWidth: parent.width
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 (logic.comboBoxVpnHashText === model[i]) {
return i
//
LabelType {
id: lb_hash
height: 21
Layout.topMargin: 20
text: qsTr("Hash")
}
ComboBoxType {
id: cb_hash
height: 31
implicitWidth: parent.width
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 (logic.comboBoxVpnHashText === model[i]) {
return i
}
}
return -1
}
return -1
}
onCurrentTextChanged: {
logic.comboBoxVpnHashText = currentText
}
enabled: !check_auto_enc.checked
}
CheckBoxType {
id: check_tls
implicitWidth: parent.width
Layout.topMargin: 20
height: 21
text: qsTr("Enable TLS auth")
checked: logic.checkBoxTlsAuthChecked
onCheckedChanged: {
logic.checkBoxTlsAuthChecked = checked
onCurrentTextChanged: {
logic.comboBoxVpnHashText = currentText
}
enabled: !check_auto_enc.checked
}
}
CheckBoxType {
id: check_tls
implicitWidth: parent.width
Layout.topMargin: 20
height: 21
text: qsTr("Enable TLS auth")
checked: logic.checkBoxTlsAuthChecked
onCheckedChanged: {
logic.checkBoxTlsAuthChecked = checked
}
CheckBoxType {
id: check_block_dns
implicitWidth: parent.width
height: 21
text: qsTr("Block DNS requests outside of VPN")
checked: logic.checkBoxBlockDnsChecked
onCheckedChanged: {
logic.checkBoxBlockDnsChecked = checked
}
}
BasicButtonType {
id: pb_client_config
implicitWidth: parent.width
height: 21
text: qsTr("Additional client config commands →")
background: Item {
anchors.fill: parent
}
contentItem: Text {
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#15CDCB";
text: pb_client_config.text
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
CheckBoxType {
id: check_block_dns
implicitWidth: parent.width
height: 21
text: qsTr("Block DNS requests outside of VPN")
checked: logic.checkBoxBlockDnsChecked
onCheckedChanged: {
logic.checkBoxBlockDnsChecked = checked
}
}
antialiasing: true
checkable: true
checked: StartPageLogic.pushButtonConnectKeyChecked
}
Rectangle {
id: rect_client_conf
implicitWidth: root.width - 60
height: 101
border.width: 1
border.color: "lightgray"
radius: 2
visible: pb_client_config.checked
ScrollView {
anchors.fill: parent
TextArea {
id: te_client_config
BasicButtonType {
id: pb_client_config
implicitWidth: parent.width
height: 21
text: qsTr("Additional client config commands →")
background: Item {
anchors.fill: parent
}
contentItem: Text {
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
text: logic.textAreaAdditionalClientConfig
onEditingFinished: {
logic.textAreaAdditionalClientConfig = text
color: "#15CDCB";
text: pb_client_config.text
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
antialiasing: true
checkable: true
checked: StartPageLogic.pushButtonConnectKeyChecked
}
Rectangle {
id: rect_client_conf
implicitWidth: root.width - 60
height: 101
border.width: 1
border.color: "lightgray"
radius: 2
visible: pb_client_config.checked
ScrollView {
anchors.fill: parent
TextArea {
id: te_client_config
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
text: logic.textAreaAdditionalClientConfig
onEditingFinished: {
logic.textAreaAdditionalClientConfig = text
}
}
}
}
}
BasicButtonType {
id: pb_server_config
implicitWidth: parent.width
height: 21
text: qsTr("Additional server config commands →")
background: Item {
anchors.fill: parent
}
BasicButtonType {
id: pb_server_config
implicitWidth: parent.width
height: 21
text: qsTr("Additional server config commands →")
background: Item {
anchors.fill: parent
}
contentItem: Text {
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#15CDCB";
text: pb_server_config.text
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
antialiasing: true
checkable: true
checked: StartPageLogic.pushButtonConnectKeyChecked
}
Rectangle {
id: rect_server_conf
implicitWidth: root.width - 60
height: 101
border.width: 1
border.color: "lightgray"
radius: 2
visible: pb_server_config.checked
ScrollView {
anchors.fill: parent
TextArea {
id: te_server_config
contentItem: Text {
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
text: logic.textAreaAdditionalServerConfig
onEditingFinished: {
logic.textAreaAdditionalServerConfig = text
}
color: "#15CDCB";
text: pb_server_config.text
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
antialiasing: true
checkable: true
checked: StartPageLogic.pushButtonConnectKeyChecked
}
Rectangle {
id: rect_server_conf
implicitWidth: root.width - 60
height: 101
border.width: 1
border.color: "lightgray"
radius: 2
visible: pb_server_config.checked
}
ScrollView {
anchors.fill: parent
TextArea {
id: te_server_config
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
text: logic.textAreaAdditionalServerConfig
onEditingFinished: {
logic.textAreaAdditionalServerConfig = text
}
}
}
LabelType {
id: label_proto_openvpn_info
height: 41
visible: logic.labelProtoOpenVpnInfoVisible
text: logic.labelProtoOpenVpnInfoText
}
}
Rectangle {
id: it_save
implicitWidth: parent.width
Layout.topMargin: 20
height: 40
LabelType {
id: label_proto_openvpn_info
BlueButtonType {
id: pb_save
z: 1
height: 41
visible: logic.labelProtoOpenVpnInfoVisible
text: logic.labelProtoOpenVpnInfoText
}
Rectangle {
id: it_save
implicitWidth: parent.width
Layout.topMargin: 20
height: 40
text: qsTr("Save and restart VPN")
width: parent.width
visible: logic.pushButtonSaveVisible
onClicked: {
logic.onPushButtonProtoOpenVpnSaveClicked()
}
}
ProgressBar {
id: progress_save
anchors.fill: pb_save
from: 0
to: logic.progressBarResetMaximium
value: logic.progressBarResetValue
visible: logic.progressBarResetVisible
background: Rectangle {
implicitWidth: parent.width
implicitHeight: parent.height
color: "#100A44"
radius: 4
}
contentItem: Item {
implicitWidth: parent.width
implicitHeight: parent.height
Rectangle {
width: progress_save.visualPosition * parent.width
height: parent.height
radius: 4
color: Qt.rgba(255, 255, 255, 0.15);
BlueButtonType {
id: pb_save
z: 1
height: 40
text: qsTr("Save and restart VPN")
width: parent.width
visible: logic.pushButtonSaveVisible
onClicked: {
logic.onPushButtonProtoOpenVpnSaveClicked()
}
}
ProgressBar {
id: progress_save
anchors.fill: pb_save
from: 0
to: logic.progressBarResetMaximium
value: logic.progressBarResetValue
visible: logic.progressBarResetVisible
background: Rectangle {
implicitWidth: parent.width
implicitHeight: parent.height
color: "#100A44"
radius: 4
}
contentItem: Item {
implicitWidth: parent.width
implicitHeight: parent.height
Rectangle {
width: progress_save.visualPosition * parent.width
height: parent.height
radius: 4
color: Qt.rgba(255, 255, 255, 0.15);
}
}
}
}
}
}
ColumnLayout {
visible: logic.isThirdPartyConfig
TextAreaType {
id: ta_config
Layout.topMargin: 5
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.leftMargin: 1
Layout.rightMargin: 1
Layout.preferredHeight: fl.height - 70
flickableDirection: Flickable.AutoFlickIfNeeded
textArea.readOnly: true
textArea.text: logic.openVpnLastConfigText
}
}
}
}
}

View file

@ -0,0 +1,60 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.15
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageProtocolBase {
id: root
protocol: ProtocolEnum.WireGuard
logic: UiLogic.protocolLogic(protocol)
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("WireGuard Settings")
}
Flickable {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
TextAreaType {
id: ta_config
Layout.topMargin: 5
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.leftMargin: 1
Layout.rightMargin: 1
Layout.preferredHeight: fl.height - 70
flickableDirection: Flickable.AutoFlickIfNeeded
textArea.readOnly: true
textArea.text: logic.wireGuardLastConfigText
}
}
}
}

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share for Amnezia")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height + 20
clip: true
Behavior on contentY{
NumberAnimation {
@ -46,6 +36,7 @@ PageShareProtocolBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
Text {
id: lb_desc

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share Cloak Settings")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -39,7 +29,7 @@ PageShareProtocolBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
id: lb_desc

View file

@ -42,20 +42,10 @@ PageShareProtocolBase {
visible: false
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -63,6 +53,7 @@ PageShareProtocolBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
// LabelType {
// id: lb_desc

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share OpenVPN Settings")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -39,7 +29,7 @@ PageShareProtocolBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
id: lb_desc

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share ShadowSocks Settings")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -39,6 +29,7 @@ PageShareProtocolBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
id: lb_desc

View file

@ -18,20 +18,10 @@ PageShareProtocolBase {
text: qsTr("Share WireGuard Settings")
}
Flickable {
FlickableType {
id: fl
width: root.width
anchors.top: caption.bottom
anchors.topMargin: 20
anchors.bottom: root.bottom
anchors.bottomMargin: 20
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
contentHeight: content.height
clip: true
ColumnLayout {
id: content
@ -39,6 +29,7 @@ PageShareProtocolBase {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
id: lb_desc

View file

@ -8,7 +8,6 @@ import Qt.labs.platform
import Qt.labs.folderlistmodel
import QtQuick.Dialogs
import QtQuick.Controls.Basic
import "./"
import "Controls"
import "Pages"
import "Pages/Protocols"
@ -25,10 +24,10 @@ Window {
id: root
visible: true
width: GC.screenWidth
height: GC.isDesktop() ? GC.screenHeight + titleBar.height : GC.screenHeight
minimumWidth: 360
height: GC.screenHeight
minimumWidth: GC.isDesktop() ? 360 : 0
minimumHeight: GC.isDesktop() ? 640 : 0
onClosing: {
onClosing: function() {
console.debug("QML onClosing signal")
UiLogic.onCloseWindow()
}
@ -88,29 +87,6 @@ Window {
}
}
TitleBar {
id: titleBar
anchors.top: root.top
visible: GC.isDesktop()
DragHandler {
grabPermissions: TapHandler.CanTakeOverFromAnything
onActiveChanged: {
if (active) {
root.startSystemMove();
}
}
target: null
}
onCloseButtonClicked: {
if (UiLogic.currentPageValue === PageEnum.Start ||
UiLogic.currentPageValue === PageEnum.NewServer) {
Qt.quit()
} else {
root.hide()
}
}
}
Rectangle {
y: GC.isDesktop() ? titleBar.height : 0
anchors.fill: parent
@ -123,16 +99,15 @@ Window {
anchors.fill: parent
focus: true
onCurrentItemChanged: {
//console.debug("QML onCurrentItemChanged " + pageLoader.currentItem)
onCurrentItemChanged: function() {
UiLogic.currentPageValue = currentItem.page
}
onDepthChanged: {
onDepthChanged: function() {
UiLogic.pagesStackDepth = depth
}
Keys.onPressed: {
Keys.onPressed: function(event) {
UiLogic.keyPressEvent(event.key)
event.accepted = true
}