From 95fe09489cd2c187849f4ed80f47aa7d480238a6 Mon Sep 17 00:00:00 2001 From: pokamest Date: Fri, 28 Jan 2022 16:03:21 +0300 Subject: [PATCH] Vpn and wizard pages fixes --- client/resources.qrc | 2 + client/ui/pages.h | 2 +- .../ui/pages_logic/ServerContainersLogic.cpp | 12 ++ client/ui/qml/Controls/RichLabelType.qml | 17 ++ client/ui/qml/Pages/PageAbout.qml | 80 +++++++++ client/ui/qml/Pages/PageAppSetting.qml | 149 ++++++++------- client/ui/qml/Pages/PageServerSettings.qml | 14 +- client/ui/qml/Pages/PageSetupWizard.qml | 169 +++++++++--------- .../ui/qml/Pages/PageSetupWizardHighLevel.qml | 138 ++++++++------ .../ui/qml/Pages/PageSetupWizardLowLevel.qml | 79 ++++---- .../qml/Pages/PageSetupWizardMediumLevel.qml | 74 ++++---- .../ui/qml/Pages/PageSetupWizardVPNMode.qml | 80 +++++---- client/ui/qml/Pages/PageVPN.qml | 29 ++- .../ui/qml/Pages/Protocols/PageProtoSftp.qml | 14 +- 14 files changed, 550 insertions(+), 309 deletions(-) create mode 100644 client/ui/qml/Controls/RichLabelType.qml create mode 100644 client/ui/qml/Pages/PageAbout.qml diff --git a/client/resources.qrc b/client/resources.qrc index b7e499fe3..407fe2273 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -142,5 +142,7 @@ images/connected.png images/disconnected.png ui/qml/Pages/PageQrDecoder.qml + ui/qml/Pages/PageAbout.qml + ui/qml/Controls/RichLabelType.qml diff --git a/client/ui/pages.h b/client/ui/pages.h index 69067e7fa..b111679a6 100644 --- a/client/ui/pages.h +++ b/client/ui/pages.h @@ -24,7 +24,7 @@ enum class Page {Start = 0, NewServer, NewServerProtocols, Vpn, Wizard, WizardLow, WizardMedium, WizardHigh, WizardVpnMode, ServerConfiguringProgress, GeneralSettings, AppSettings, NetworkSettings, ServerSettings, ServerContainers, ServersList, ShareConnection, Sites, - ProtocolSettings, ProtocolShare, QrDecoder}; + ProtocolSettings, ProtocolShare, QrDecoder, About}; Q_ENUM_NS(Page) static void declareQmlPageEnum() { diff --git a/client/ui/pages_logic/ServerContainersLogic.cpp b/client/ui/pages_logic/ServerContainersLogic.cpp index dbcc3b614..e01e1bac9 100644 --- a/client/ui/pages_logic/ServerContainersLogic.cpp +++ b/client/ui/pages_logic/ServerContainersLogic.cpp @@ -12,6 +12,9 @@ #include #include "../uilogic.h" +#include "../pages_logic/VpnLogic.h" +#include "vpnconnection.h" + ServerContainersLogic::ServerContainersLogic(UiLogic *logic, QObject *parent): PageLogicBase(logic, parent) @@ -42,8 +45,17 @@ void ServerContainersLogic::onPushButtonProtoSettingsClicked(DockerContainer c, void ServerContainersLogic::onPushButtonDefaultClicked(DockerContainer c) { + if (m_settings.defaultContainer(uiLogic()->selectedServerIndex) == c) return; + m_settings.setDefaultContainer(uiLogic()->selectedServerIndex, c); uiLogic()->onUpdateAllPages(); + + if (uiLogic()->selectedServerIndex != m_settings.defaultServerIndex()) return; + if (!uiLogic()->m_vpnConnection) return; + if (!uiLogic()->m_vpnConnection->isConnected()) return; + + uiLogic()->vpnLogic()->onDisconnect(); + uiLogic()->vpnLogic()->onConnect(); } void ServerContainersLogic::onPushButtonShareClicked(DockerContainer c) diff --git a/client/ui/qml/Controls/RichLabelType.qml b/client/ui/qml/Controls/RichLabelType.qml new file mode 100644 index 000000000..f7dfdeed9 --- /dev/null +++ b/client/ui/qml/Controls/RichLabelType.qml @@ -0,0 +1,17 @@ +import QtQuick 2.12 + +LabelType { + id: label_connection_code + width: parent.width - 60 + x: 30 + font.pixelSize: 14 + textFormat: Text.RichText + onLinkActivated: Qt.openUrlExternally(link) + + MouseArea { + anchors.fill: parent + cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor + acceptedButtons: Qt.NoButton + } +} + diff --git a/client/ui/qml/Pages/PageAbout.qml b/client/ui/qml/Pages/PageAbout.qml new file mode 100644 index 000000000..7bf406d3d --- /dev/null +++ b/client/ui/qml/Pages/PageAbout.qml @@ -0,0 +1,80 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import PageEnum 1.0 +import "./" +import "../Controls" +import "../Config" + +PageBase { + id: root + page: PageEnum.About + + BackButton { + id: back_from_start + } + + Caption { + id: caption + font.pixelSize: 22 + text: qsTr("About Amnezia") + } + + RichLabelType { + id: label_about + anchors.top: caption.bottom + + text: qsTr("AmneziaVPN is opensource software, it's free forever. Our goal is to make the best VPN client in the world. + +") + } + + Caption { + id: caption2 + anchors.topMargin: 20 + font.pixelSize: 22 + text: qsTr("Support") + anchors.top: label_about.bottom + } + + RichLabelType { + id: label_support + anchors.top: caption2.bottom + + text: qsTr("Have questions? You can get support by: +") + } + + Caption { + id: caption3 + anchors.topMargin: 20 + font.pixelSize: 22 + text: qsTr("Donate") + anchors.top: label_support.bottom + } + + RichLabelType { + id: label_donate + anchors.top: caption3.bottom + + text: qsTr("Please support Amnezia project by donation, we really need it now more than ever. + +") + } + + Logo { + id: logo + anchors.bottom: parent.bottom + } +} diff --git a/client/ui/qml/Pages/PageAppSetting.qml b/client/ui/qml/Pages/PageAppSetting.qml index 8be9274c7..497471b45 100644 --- a/client/ui/qml/Pages/PageAppSetting.qml +++ b/client/ui/qml/Pages/PageAppSetting.qml @@ -1,5 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.15 import PageEnum 1.0 import "./" import "../Controls" @@ -14,75 +15,97 @@ PageBase { id: back } Caption { + id: caption text: qsTr("Application Settings") } - CheckBoxType { - x: 30 - y: 140 - width: 211 - height: 31 - text: qsTr("Auto connect") - checked: AppSettingsLogic.checkBoxAutoConnectChecked - onCheckedChanged: { - AppSettingsLogic.checkBoxAutoConnectChecked = checked - AppSettingsLogic.onCheckBoxAutoconnectToggled(checked) - } - } - CheckBoxType { - x: 30 - y: 100 - width: 211 - height: 31 - text: qsTr("Auto start") - checked: AppSettingsLogic.checkBoxAutostartChecked - onCheckedChanged: { - AppSettingsLogic.checkBoxAutostartChecked = checked - AppSettingsLogic.onCheckBoxAutostartToggled(checked) - } - } - CheckBoxType { - x: 30 - y: 180 - width: 211 - height: 31 - text: qsTr("Start minimized") - checked: AppSettingsLogic.checkBoxStartMinimizedChecked - onCheckedChanged: { - AppSettingsLogic.checkBoxStartMinimizedChecked = checked - AppSettingsLogic.onCheckBoxStartMinimizedToggled(checked) - } - } - LabelType { - x: 30 - y: 240 - width: 281 - height: 21 - text: AppSettingsLogic.labelVersionText - } - BlueButtonType { - x: 30 - y: 280 - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 40 - height: 41 - text: qsTr("Check for updates") - onClicked: { - Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest") - } - } - BlueButtonType { - x: 30 - y: 340 - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 40 - height: 41 - text: qsTr("Open logs folder") - onClicked: { - AppSettingsLogic.onPushButtonOpenLogsClicked() + + Flickable { + 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 + enabled: logic.pageEnabled + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + CheckBoxType { + Layout.fillWidth: true + text: qsTr("Auto connect") + checked: AppSettingsLogic.checkBoxAutoConnectChecked + onCheckedChanged: { + AppSettingsLogic.checkBoxAutoConnectChecked = checked + AppSettingsLogic.onCheckBoxAutoconnectToggled(checked) + } + } + CheckBoxType { + Layout.fillWidth: true + text: qsTr("Auto start") + checked: AppSettingsLogic.checkBoxAutostartChecked + onCheckedChanged: { + AppSettingsLogic.checkBoxAutostartChecked = checked + AppSettingsLogic.onCheckBoxAutostartToggled(checked) + } + } + CheckBoxType { + Layout.fillWidth: true + text: qsTr("Start minimized") + checked: AppSettingsLogic.checkBoxStartMinimizedChecked + onCheckedChanged: { + AppSettingsLogic.checkBoxStartMinimizedChecked = checked + AppSettingsLogic.onCheckBoxStartMinimizedToggled(checked) + } + } + LabelType { + Layout.fillWidth: true + Layout.topMargin: 15 + text: AppSettingsLogic.labelVersionText + } + BlueButtonType { + Layout.fillWidth: true + Layout.preferredHeight: 41 + text: qsTr("Check for updates") + onClicked: { + Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest") + } + } + BlueButtonType { + Layout.fillWidth: true + Layout.topMargin: 15 + Layout.preferredHeight: 41 + text: qsTr("Open logs folder") + onClicked: { + AppSettingsLogic.onPushButtonOpenLogsClicked() + } + } + + BlueButtonType { + Layout.fillWidth: true + Layout.topMargin: 15 + Layout.preferredHeight: 41 + text: qsTr("Export logs") + onClicked: { + AppSettingsLogic.onPushButtonOpenLogsClicked() + } + } + } } Logo { + id: logo anchors.bottom: parent.bottom } } diff --git a/client/ui/qml/Pages/PageServerSettings.qml b/client/ui/qml/Pages/PageServerSettings.qml index 465d13484..143f5374f 100644 --- a/client/ui/qml/Pages/PageServerSettings.qml +++ b/client/ui/qml/Pages/PageServerSettings.qml @@ -28,7 +28,16 @@ PageBase { horizontalAlignment: Text.AlignHCenter text: ServerSettingsLogic.labelCurrentVpnProtocolText } - LabelType { +// LabelType { +// anchors.horizontalCenter: parent.horizontalCenter +// y: 120 +// width: 341 +// height: 31 +// font.pixelSize: 20 +// horizontalAlignment: Text.AlignHCenter +// text: ServerSettingsLogic.labelServerText +// } + TextFieldType { anchors.horizontalCenter: parent.horizontalCenter y: 120 width: 341 @@ -36,7 +45,10 @@ PageBase { font.pixelSize: 20 horizontalAlignment: Text.AlignHCenter text: ServerSettingsLogic.labelServerText + readOnly: true + background: Item {} } + LabelType { anchors.horizontalCenter: parent.horizontalCenter y: 530 diff --git a/client/ui/qml/Pages/PageSetupWizard.qml b/client/ui/qml/Pages/PageSetupWizard.qml index 001443868..8a13d6678 100644 --- a/client/ui/qml/Pages/PageSetupWizard.qml +++ b/client/ui/qml/Pages/PageSetupWizard.qml @@ -1,5 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.15 import PageEnum 1.0 import "./" import "../Controls" @@ -14,93 +15,99 @@ PageBase { id: back_from_setup_wizard } Caption { + id: caption text: qsTr("Setup your server to use VPN") } - 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); + + Flickable { + 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 + enabled: logic.pageEnabled + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + RadioButtonType { + id: radioButton_setup_wizard_high + Layout.fillWidth: true + text: qsTr("High censorship level") + checked: WizardLogic.radioButtonHighChecked + onCheckedChanged: { + WizardLogic.radioButtonHighChecked = checked } } - } - RadioButtonType { - id: radioButton_setup_wizard_high - x: 10 - y: 10 - width: 331 - height: 25 - text: qsTr("High censorship level") - checked: WizardLogic.radioButtonHighChecked - onCheckedChanged: { - WizardLogic.radioButtonHighChecked = checked + LabelType { + Layout.fillWidth: true + Layout.leftMargin: 25 + verticalAlignment: Text.AlignTop + text: qsTr("I'm living in a country with a high censorship level. Many of the foreign websites and VPNs are blocked by my government. I want to setup a reliable VPN, which can not be detected by my internet provider and my government. +OpenVPN and ShadowSocks over Cloak (VPN obfuscation) profiles will be installed.\n") } - } - RadioButtonType { - id: radioButton_setup_wizard_medium - x: 10 - y: 330 - width: 331 - height: 25 - text: qsTr("Low censorship level") - checked: WizardLogic.radioButtonLowChecked - onCheckedChanged: { - WizardLogic.radioButtonLowChecked = checked + + + RadioButtonType { + id: radioButton_setup_wizard_medium + Layout.fillWidth: true + text: qsTr("Medium censorship level") + checked: WizardLogic.radioButtonMediumChecked + onCheckedChanged: { + WizardLogic.radioButtonMediumChecked = checked + } } - } - RadioButtonType { - id: radioButton_setup_wizard_low - x: 10 - y: 180 - width: 331 - height: 25 - text: qsTr("Medium censorship level") - checked: WizardLogic.radioButtonMediumChecked - onCheckedChanged: { - WizardLogic.radioButtonMediumChecked = checked + LabelType { + Layout.fillWidth: true + Layout.leftMargin: 25 + verticalAlignment: Text.AlignTop + text: qsTr("I'm living in a country with a medium censorship level. Some websites are blocked by my government, but VPNs are not blocked at all. I want to setup a flexible solution. +OpenVPN over ShadowSocks profile will be installed.\n") + } + + + RadioButtonType { + id: radioButton_setup_wizard_low + Layout.fillWidth: true + text: qsTr("Low censorship level") + checked: WizardLogic.radioButtonLowChecked + onCheckedChanged: { + WizardLogic.radioButtonLowChecked = checked + } + } + LabelType { + Layout.fillWidth: true + Layout.leftMargin: 25 + verticalAlignment: Text.AlignTop + 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); + } + } } } } diff --git a/client/ui/qml/Pages/PageSetupWizardHighLevel.qml b/client/ui/qml/Pages/PageSetupWizardHighLevel.qml index 47a13e5b3..1729aff06 100644 --- a/client/ui/qml/Pages/PageSetupWizardHighLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardHighLevel.qml @@ -1,5 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.15 import PageEnum 1.0 import "./" import "../Controls" @@ -14,69 +15,90 @@ PageBase { id: back_from_setup_wizard } Caption { + id: caption text: qsTr("Setup Wizard") } - 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: WizardLogic.lineEditHighWebsiteMaskingText - onEditingFinished: { - let _text = website_masking.text - _text.replace("http://", ""); - _text.replace("https://", ""); - if (!_text) { - return + + Flickable { + 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 + enabled: logic.pageEnabled + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + LabelType { + Layout.fillWidth: true + verticalAlignment: Text.AlignTop + text: qsTr("AmneziaVPN will install a VPN protocol which is not visible to your internet provider and government firewall. Your VPN connection will be seen by your internet provider as regular web traffic to a particular website. + +You SHOULD set this website address to some foreign website which is not blocked by your internet provider. In other words, you need to type some foreign website address which is accessible to you without a VPN.") + } + + LabelType { + Layout.fillWidth: true + Layout.topMargin: 15 + verticalAlignment: Text.AlignTop + text: qsTr("Type another web site address for masking or keep it by default. Your internet provider will think you working on this web site when you connected to VPN.") + } + + TextFieldType { + id: website_masking + Layout.fillWidth: true + text: WizardLogic.lineEditHighWebsiteMaskingText + onEditingFinished: { + let _text = website_masking.text + _text.replace("http://", ""); + _text.replace("https://", ""); + if (!_text) { + return + } + _text = _text.split("/").first(); + WizardLogic.lineEditHighWebsiteMaskingText = _text } - _text = _text.split("/").first(); - WizardLogic.lineEditHighWebsiteMaskingText = _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 + onAccepted: { + next_button.clicked() } - UiLogic.goToPage(PageEnum.WizardVpnMode) } + + LabelType { + Layout.fillWidth: true + Layout.topMargin: 15 + verticalAlignment: Text.AlignTop + text: qsTr("OpenVPN and ShadowSocks over Cloak (VPN obfuscation) profiles will be installed. + +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) + } + } + } + } } diff --git a/client/ui/qml/Pages/PageSetupWizardLowLevel.qml b/client/ui/qml/Pages/PageSetupWizardLowLevel.qml index 21ed66869..8b7ee7442 100644 --- a/client/ui/qml/Pages/PageSetupWizardLowLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardLowLevel.qml @@ -1,5 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.15 import PageEnum 1.0 import "./" import "../Controls" @@ -14,38 +15,56 @@ PageBase { id: back_from_setup_wizard } Caption { + id: caption text: qsTr("Setup Wizard") } - 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: { - WizardLogic.onPushButtonLowFinishClicked() + + Flickable { + 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 + enabled: logic.pageEnabled + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + LabelType { + Layout.fillWidth: true + verticalAlignment: Text.AlignTop + text: qsTr('AmneziaVPN will install the OpenVPN protocol with public/private key pairs generated on both server and client sides. + +You can also configure the connection on your mobile device by copying the exported ".ovpn" file to your device, and setting up the official OpenVPN client. + +We recommend not to use messaging applications for sending the connection profile - it contains VPN private keys.') + } + LabelType { + Layout.fillWidth: true + Layout.topMargin: 15 + 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() + } } } } diff --git a/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml b/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml index 0765aa5e9..01721cdc7 100644 --- a/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml @@ -1,5 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.15 import PageEnum 1.0 import "./" import "../Controls" @@ -14,38 +15,51 @@ PageBase { id: back_from_setup_wizard } Caption { + id: caption text: qsTr("Setup Wizard") } - 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) + + Flickable { + 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 + enabled: logic.pageEnabled + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + LabelType { + Layout.fillWidth: true + verticalAlignment: Text.AlignTop + text: qsTr('AmneziaVPN will install a 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 "VPN masking".\n\nThis protocol supports exporting connection profiles to mobile devices by using QR codes (you should launch the 3rd party open source VPN client - ShadowSocks VPN).') + } + LabelType { + Layout.fillWidth: true + 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) + } } } } diff --git a/client/ui/qml/Pages/PageSetupWizardVPNMode.qml b/client/ui/qml/Pages/PageSetupWizardVPNMode.qml index 37aca1190..2445819e1 100644 --- a/client/ui/qml/Pages/PageSetupWizardVPNMode.qml +++ b/client/ui/qml/Pages/PageSetupWizardVPNMode.qml @@ -1,5 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.15 import PageEnum 1.0 import "./" import "../Controls" @@ -14,40 +15,57 @@ PageBase { id: back_from_setup_wizard } Caption { + id: caption text: qsTr("Setup Wizard") } - 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: WizardLogic.checkBoxVpnModeChecked - onCheckedChanged: { - WizardLogic.checkBoxVpnModeChecked = checked + + Flickable { + 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 + enabled: logic.pageEnabled + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + LabelType { + Layout.fillWidth: true + verticalAlignment: Text.AlignTop + text: qsTr('Optional.\n +You can 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.') } - } - 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: { - WizardLogic.onPushButtonVpnModeFinishClicked() + + CheckBoxType { + Layout.fillWidth: true + text: qsTr('Turn on mode "VPN for selected sites"') + checked: WizardLogic.checkBoxVpnModeChecked + onCheckedChanged: { + WizardLogic.checkBoxVpnModeChecked = checked + } + } + + BlueButtonType { + id: vpn_mode_finish + Layout.fillWidth: true + Layout.topMargin: 15 + Layout.preferredHeight: 41 + text: qsTr("Start configuring") + onClicked: { + WizardLogic.onPushButtonVpnModeFinishClicked() + } } } } diff --git a/client/ui/qml/Pages/PageVPN.qml b/client/ui/qml/Pages/PageVPN.qml index 6158e8ea9..e4bbaecb0 100644 --- a/client/ui/qml/Pages/PageVPN.qml +++ b/client/ui/qml/Pages/PageVPN.qml @@ -22,7 +22,7 @@ PageBase { LabelType { x: 10 - y: 5 + y: 10 width: 100 height: 21 text: VpnLogic.labelVersionText @@ -30,6 +30,33 @@ PageBase { font.pixelSize: 12 } + BasicButtonType { + 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 + } + + onClicked: { + UiLogic.goToPage(PageEnum.About) + } + } + ImageButtonType { x: parent.width - 40 y: 10 diff --git a/client/ui/qml/Pages/Protocols/PageProtoSftp.qml b/client/ui/qml/Pages/Protocols/PageProtoSftp.qml index 45d10de5d..2ad5436b3 100644 --- a/client/ui/qml/Pages/Protocols/PageProtoSftp.qml +++ b/client/ui/qml/Pages/Protocols/PageProtoSftp.qml @@ -77,24 +77,12 @@ PageProtocolBase { } } - LabelType { + RichLabelType { anchors.bottom: check_persist.top anchors.bottomMargin: 10 width: parent.width - 60 x: 30 font.pixelSize: 14 - textFormat: Text.RichText - - MouseArea { - anchors.fill: parent - cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor - acceptedButtons: Qt.NoButton - } - -// text: "In order to mount remote SFTP folder as local drive, perform following steps: -//- Install the latest version of WinFsp [https://github.com/billziss-gh/winfsp/releases/latest]. -//- Install the latest version of SSHFS-Win. Choose the x64 or x86 installer according to your computer's architecture [https://github.com/billziss-gh/sshfs-win/releases]" - onLinkActivated: Qt.openUrlExternally(link) readonly property string windows_text: "In order to mount remote SFTP folder as local drive, perform following steps: