removed old ui files

This commit is contained in:
vladimir.kuznetsov 2023-08-31 16:00:41 +05:00
parent 8cf8c3c122
commit 4baa003c0d
140 changed files with 285 additions and 12695 deletions

View file

@ -1,33 +0,0 @@
import QtQuick
import QtQuick.Controls
Button {
id: root
x: 10
y: 5
width: 41
height: 35
hoverEnabled: true
property bool containsMouse: hovered
background: Item {}
MouseArea {
id: mouseArea
anchors.fill: parent
enabled: false
cursorShape: Qt.PointingHandCursor
}
onClicked: {
UiLogic.closePage()
}
contentItem: Image {
id: img
source: "qrc:/images/arrow_left.png"
anchors.fill: root
anchors.margins: root.containsMouse ? 9 : 10
}
}

View file

@ -1,17 +0,0 @@
import QtQuick
import QtQuick.Controls
Button {
id: root
property bool containsMouse: hovered
hoverEnabled: true
flat: true
highlighted: false
MouseArea {
id: mouseArea
anchors.fill: parent
enabled: false
cursorShape: Qt.PointingHandCursor
}
}

View file

@ -1,28 +0,0 @@
import QtQuick
import QtQuick.Controls
import "../Config"
BasicButtonType {
id: root
width: parent.width - 2 * GC.defaultMargin
implicitHeight: 40
background: Rectangle {
anchors.fill: parent
radius: 4
color: root.enabled ? (root.containsMouse ? "#211966" : "#100A44") : "#888888"
}
font.pixelSize: 16
contentItem: Text {
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: root.font.pixelSize
color: "#D4D4D4"
text: root.text
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
antialiasing: true
}

View file

@ -1,17 +0,0 @@
import QtQuick
import QtQuick.Controls
Text {
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 24
color: "#100A44"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
x: 10
y: 35
width: parent.width - 40
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.Wrap
//height: 31
}

View file

@ -1,27 +0,0 @@
import QtQuick
import QtQuick.Controls
CheckBox {
id: root
property int imageWidth : 20
property int imageHeight : 20
indicator: Image {
id: indicator
anchors.verticalCenter: root.verticalCenter
height: imageHeight
width: imageWidth
source: root.checked ? "qrc:/images/controls/check_on.png"
: "qrc:/images/controls/check_off.png"
}
contentItem: Text {
text: root.text
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
verticalAlignment: Text.AlignVCenter
leftPadding: root.indicator.width + root.spacing
wrapMode: Text.Wrap
}
}

View file

@ -1,11 +0,0 @@
import QtQuick
import QtQuick.Controls
ComboBox {
id: root
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
popup.font.pixelSize: 16
}

View file

@ -1,33 +0,0 @@
import QtQuick
import QtQuick.Controls
import Qt.labs.platform
Menu {
property var textObj
MenuItem {
text: qsTr("C&ut")
shortcut: StandardKey.Cut
enabled: textObj.selectedText
onTriggered: textObj.cut()
}
MenuItem {
text: qsTr("&Copy")
shortcut: StandardKey.Copy
enabled: textObj.selectedText
onTriggered: textObj.copy()
}
MenuItem {
text: qsTr("&Paste")
shortcut: StandardKey.Paste
enabled: textObj.canPaste
onTriggered: textObj.paste()
}
MenuItem {
text: qsTr("&SelectAll")
shortcut: StandardKey.SelectAll
enabled: textObj.length > 0
onTriggered: textObj.selectAll()
}
}

View file

@ -1,35 +0,0 @@
import QtQuick
import QtQml
Behavior {
id: root
property QtObject fadeTarget: targetProperty.object
property string fadeProperty: "scale"
property int fadeDuration: 150
property string easingType: "Quad"
property alias outAnimation: outAnimation
property alias inAnimation: inAnimation
SequentialAnimation {
NumberAnimation {
id: outAnimation
target: root.fadeTarget
property: root.fadeProperty
duration: root.fadeDuration
to: 0
easing.type: Easing["In"+root.easingType]
}
PropertyAction { }
NumberAnimation {
id: inAnimation
target: root.fadeTarget
property: root.fadeProperty
duration: root.fadeDuration
to: target[property]
easing.type: Easing["Out"+root.easingType]
}
}
}

View file

@ -1,26 +0,0 @@
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,17 +0,0 @@
import QtQuick
import QtQuick.Controls
BasicButtonType {
id: root
property alias iconMargin: img.anchors.margins
property alias img: img
property int imgMargin: 4
property int imgMarginHover: 3
background: Item {}
contentItem: Image {
id: img
source: root.icon.source
anchors.fill: root
anchors.margins: root.containsMouse ? imgMarginHover : imgMargin
}
}

View file

@ -1,17 +0,0 @@
import QtQuick
import "../Config"
Text {
id: root
width: parent.width - 2 * GC.defaultMargin
anchors.topMargin: 10
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
}

View file

@ -1,8 +0,0 @@
import QtQuick
import QtQuick.Controls
Image {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottomMargin: 30
source: "qrc:/images/AmneziaVPN.png"
}

View file

@ -1,34 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Popup {
id: root
property string popupWarningText
anchors.centerIn: Overlay.overlay
modal: true
closePolicy: Popup.NoAutoClose
width: parent.width - 20
ColumnLayout {
width: parent.width
Text {
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
wrapMode: Text.WordWrap
font.pixelSize: 16
text: root.popupWarningText
}
BlueButtonType {
Layout.preferredWidth: parent.width / 2
Layout.fillWidth: true
text: "Continue"
onClicked: {
root.close()
}
}
}
}

View file

@ -1,62 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Popup {
id: root
property string questionText
property string yesText: "yes"
property string noText: "no"
property var yesFunc
property var noFunc
anchors.centerIn: Overlay.overlay
modal: true
closePolicy: Popup.CloseOnEscape
width: parent.width - 20
focus: true
onAboutToHide: {
parent.forceActiveFocus(true)
}
ColumnLayout {
width: parent.width
Text {
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
wrapMode: Text.WordWrap
font.pixelSize: 16
text: questionText
}
RowLayout {
Layout.fillWidth: true
BlueButtonType {
id: yesButton
Layout.fillWidth: true
text: yesText
onClicked: {
root.enabled = false
if (yesFunc && typeof yesFunc === "function") {
yesFunc()
}
root.enabled = true
}
}
BlueButtonType {
id: noButton
Layout.fillWidth: true
text: noText
onClicked: {
if (noFunc && typeof noFunc === "function") {
noFunc()
}
}
}
}
}
}

View file

@ -1,62 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Popup {
id: root
property alias text: textField.text
property alias placeholderText: textField.placeholderText
property string yesText: "yes"
property string noText: "no"
property var yesFunc
property var noFunc
signal editingFinished()
anchors.centerIn: Overlay.overlay
modal: true
closePolicy: Popup.NoAutoClose
width: parent.width - 20
ColumnLayout {
width: parent.width
TextField {
id: textField
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
font.pixelSize: 16
echoMode: TextInput.Password
}
RowLayout {
Layout.fillWidth: true
BlueButtonType {
id: yesButton
Layout.preferredWidth: parent.width / 2
Layout.fillWidth: true
text: yesText
onClicked: {
root.enabled = false
if (yesFunc && typeof yesFunc === "function") {
yesFunc()
}
root.enabled = true
}
}
BlueButtonType {
id: noButton
Layout.preferredWidth: parent.width / 2
Layout.fillWidth: true
text: noText
onClicked: {
if (noFunc && typeof noFunc === "function") {
noFunc()
}
}
}
}
}
}

View file

@ -1,36 +0,0 @@
import QtQuick
import QtQuick.Controls
RadioButton {
id: root
indicator: Rectangle {
implicitWidth: 13
implicitHeight: 13
x: root.leftPadding
y: parent.height / 2 - height / 2
radius: 13
border.color: root.down ? "#777777" : "#777777"
Rectangle {
width: 7
height: 7
x: 3
y: 3
radius: 4
color: root.down ? "#15CDCB" : "#15CDCB"
visible: root.checked
}
}
contentItem: Text {
text: root.text
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: enabled ? "#181922" : "#686972"
verticalAlignment: Text.AlignVCenter
leftPadding: root.indicator.width + root.spacing
}
height: 10
}

View file

@ -1,17 +0,0 @@
import QtQuick
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
}
}

View file

@ -1,33 +0,0 @@
import QtQuick
import QtQuick.Controls
BasicButtonType {
id: root
property alias textItem: textItem
height: 30
background: Item {}
contentItem: Item {
SvgImageType {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
svg.source: root.icon.source
enabled: root.enabled
color: "#100A44"
width: 25
height: 25
}
Text {
id: textItem
anchors.fill: parent
leftPadding: 30
text: root.text
color: root.enabled ? "#100A44": "#AAAAAA"
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 20
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
}
}

View file

@ -1,26 +0,0 @@
import QtQuick
import QtQuick.Controls
ShareConnectionButtonType {
property string start_text: qsTr("Copy")
property string end_text: qsTr("Copied")
property string copyText
enabled: copyText.length > 0
visible: copyText.length > 0
Timer {
id: timer
interval: 1000; running: false; repeat: false
onTriggered: text = start_text
}
text: start_text
onClicked: {
text = end_text
timer.running = true
UiLogic.copyToClipboard(copyText)
}
}

View file

@ -1,27 +0,0 @@
import QtQuick
import QtQuick.Controls
BasicButtonType {
id: root
height: 40
background: Rectangle {
anchors.fill: parent
radius: 4
color: root.enabled
? (root.containsMouse ? "#282932" : "#181922")
: "#484952"
}
font.pixelSize: 16
contentItem: Text {
anchors.fill: parent
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: root.font.pixelSize
color: "#D4D4D4"
text: root.text
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
antialiasing: true
}

View file

@ -1,65 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Shapes 1.4
Item {
id: root
property bool active: false
property string text: ""
height: active ? contentLoader.item.height + 40 + 5 * 2 : 40
signal clicked()
Rectangle {
x: 0
y: 0
width: parent.width
height: 40
color: "transparent"
clip: true
radius: 2
gradient: LinearGradient {
x1: 0 ; y1: 0
x2: 0 ; y2: height
stops: [
GradientStop { position: 0.0; color: "#E1E1E1" },
GradientStop { position: 0.4; color: "#DDDDDD" },
GradientStop { position: 0.5; color: "#D8D8D8" },
GradientStop { position: 1.0; color: "#D3D3D3" }
]
}
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 10
source: "qrc:/images/share.png"
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 2
color: "#148CD2"
visible: ms.containsMouse ? true : false
}
Text {
x: 40
anchors.verticalCenter: parent.verticalCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 18
color: "#100A44"
font.bold: true
text: root.text
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
}
MouseArea {
id: ms
anchors.fill: parent
hoverEnabled: true
onClicked: root.clicked()
}
}
}

View file

@ -1,16 +0,0 @@
import QtQuick
import QtQuick.Controls
import "."
BasicButtonType {
id: root
icon.color: "#181922"
background: Item {}
contentItem: SvgImageType {
svg.source: icon.source
color: icon.color
anchors.fill: parent
anchors.margins: parent.containsMouse ? 0 : 1
}
}

View file

@ -1,23 +0,0 @@
import QtQuick
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
Item {
id: root
property color color: "#181922"
property alias svg: image
Image {
anchors.fill: parent
id: image
sourceSize: Qt.size(root.width, root.height)
antialiasing: true
visible: false
}
ColorOverlay {
anchors.fill: image
source: image
color: root.enabled ? root.color : "grey"
}
}

View file

@ -1,63 +0,0 @@
import QtQuick
import QtQuick.Controls
import Qt.labs.platform
import "../Config"
Flickable
{
property alias textArea: root
id: flickable
flickableDirection: Flickable.VerticalFlick
clip: true
TextArea.flickable:
TextArea {
id: root
property bool error: false
height: 40
anchors.topMargin: 5
selectByMouse: false
selectionColor: "darkgray"
font.pixelSize: 16
color: "#333333"
background: Rectangle {
implicitWidth: 200
implicitHeight: 40
border.width: 1
color: {
if (root.error) {
return Qt.rgba(213, 40, 60, 255)
}
return root.enabled ? "#F4F4F4" : Qt.rgba(127, 127, 127, 255)
}
border.color: {
if (!root.enabled) {
return Qt.rgba(127, 127, 127, 255)
}
if (root.error) {
return Qt.rgba(213, 40, 60, 255)
}
if (root.focus) {
return "#A7A7A7"
}
return "#A7A7A7"
}
}
// MouseArea {
// anchors.fill: root
// enabled: GC.isDesktop()
// acceptedButtons: Qt.RightButton
// onClicked: contextMenu.open()
// }
// ContextMenu {
// id: contextMenu
// textObj: root
// }
}
}

View file

@ -1,52 +0,0 @@
import QtQuick
import QtQuick.Controls
import Qt.labs.platform
import "../Config"
TextField {
id: root
property bool error: false
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
border.width: 1
color: {
if (root.error) {
return Qt.rgba(213, 40, 60, 255)
}
return root.enabled ? "#F4F4F4" : Qt.rgba(127, 127, 127, 255)
}
border.color: {
if (!root.enabled) {
return Qt.rgba(127, 127, 127, 255)
}
if (root.error) {
return Qt.rgba(213, 40, 60, 255)
}
if (root.focus) {
return "#A7A7A7"
}
return "#A7A7A7"
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: contextMenu.open()
}
ContextMenu {
id: contextMenu
textObj: root
}
}

View file

@ -1,25 +0,0 @@
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

@ -1,6 +0,0 @@
FadeBehavior {
fadeProperty: "opacity"
fadeDuration: 200
outAnimation.duration: targetValue ? 0 : fadeDuration
inAnimation.duration: targetValue ? fadeDuration : 0
}

View file

@ -1,15 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageBase {
id: root
property var protocol: ProtocolEnum.Any
page: PageEnum.ClientInfo
logic: ClientInfoLogic
}

View file

@ -1,115 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageClientInfoBase {
id: root
protocol: ProtocolEnum.OpenVpn
BackButton {
id: back
enabled: !ClientInfoLogic.busyIndicatorIsRunning
}
Caption {
id: caption
text: qsTr("Client Info")
}
BusyIndicator {
z: 99
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: ClientInfoLogic.busyIndicatorIsRunning
running: ClientInfoLogic.busyIndicatorIsRunning
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
visible: ClientInfoLogic.pageContentVisible
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ClientInfoLogic.labelCurrentVpnProtocolText
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
height: 21
text: qsTr("Client name")
}
TextFieldType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
Layout.preferredHeight: 31
text: ClientInfoLogic.lineEditNameAliasText
onEditingFinished: {
if (text !== ClientInfoLogic.lineEditNameAliasText) {
ClientInfoLogic.lineEditNameAliasText = text
ClientInfoLogic.onLineEditNameAliasEditingFinished()
}
}
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.topMargin: 20
height: 21
text: qsTr("Certificate id")
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: ClientInfoLogic.labelOpenVpnCertId
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.topMargin: 20
height: 21
text: qsTr("Certificate")
}
TextAreaType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.wrapMode: TextEdit.WrapAnywhere
textArea.verticalAlignment: Text.AlignTop
textArea.text: ClientInfoLogic.textAreaOpenVpnCertData
}
BlueButtonType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Revoke Certificate")
onClicked: {
ClientInfoLogic.onRevokeOpenVpnCertificateClicked()
UiLogic.closePage()
}
}
}
}
}

View file

@ -1,100 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageClientInfoBase {
id: root
protocol: ProtocolEnum.WireGuard
BackButton {
id: back
enabled: !ClientInfoLogic.busyIndicatorIsRunning
}
Caption {
id: caption
text: qsTr("Client Info")
}
BusyIndicator {
z: 99
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: ClientInfoLogic.busyIndicatorIsRunning
running: ClientInfoLogic.busyIndicatorIsRunning
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ClientInfoLogic.labelCurrentVpnProtocolText
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
height: 21
text: qsTr("Client name")
}
TextFieldType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
Layout.preferredHeight: 31
text: ClientInfoLogic.lineEditNameAliasText
onEditingFinished: {
if (text !== ClientInfoLogic.lineEditNameAliasText) {
ClientInfoLogic.lineEditNameAliasText = text
ClientInfoLogic.onLineEditNameAliasEditingFinished()
}
}
}
LabelType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.topMargin: 20
height: 21
text: qsTr("Public Key")
}
TextAreaType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.wrapMode: TextEdit.WrapAnywhere
textArea.verticalAlignment: Text.AlignTop
textArea.text: ClientInfoLogic.textAreaWireGuardKeyData
}
BlueButtonType {
enabled: !ClientInfoLogic.busyIndicatorIsRunning
Layout.fillWidth: true
Layout.preferredHeight: 41
text: qsTr("Revoke Key")
onClicked: {
ClientInfoLogic.onRevokeWireGuardKeyClicked()
UiLogic.closePage()
}
}
}
}
}

View file

@ -1,75 +0,0 @@
import QtQuick
import QtQuick.Controls
import "./"
import "../../Controls"
import "../../Config"
Rectangle {
signal containerChecked(bool checked)
property bool initiallyChecked: false
property string containerDescription
default property alias itemSettings: container.data
x: 5
y: 5
width: parent.width - 20
anchors.horizontalCenter: parent.horizontalCenter
height: frame_settings.visible ? 140 : 72
border.width: 1
border.color: "lightgray"
radius: 2
Rectangle {
id: frame_settings
height: 77
width: parent.width
border.width: 1
border.color: "lightgray"
anchors.bottom: parent.bottom
anchors.bottomMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
visible: false
radius: 2
Grid {
id: container
anchors.fill: parent
columns: 2
horizontalItemAlignment: Grid.AlignHCenter
verticalItemAlignment: Grid.AlignVCenter
topPadding: 5
leftPadding: 10
spacing: 5
}
}
Row {
anchors.top: parent.top
anchors.topMargin: 5
leftPadding: 15
rightPadding: 5
height: 55
width: parent.width
CheckBoxType {
text: containerDescription
height: parent.height
width: parent.width - 50
checked: initiallyChecked
onCheckedChanged: containerChecked(checked)
}
ImageButtonType {
width: 35
height: 35
anchors.verticalCenter: parent.verticalCenter
icon.source: "qrc:/images/settings.png"
checkable: true
checked: initiallyChecked
onCheckedChanged: {
//NewServerProtocolsLogic.pushButtonSettingsCloakChecked = checked
if (checked) {
frame_settings.visible = true
} else {
frame_settings.visible = false
}
}
}
}
}

View file

@ -1,200 +0,0 @@
import QtQuick
import QtQuick.Controls
import SortFilterProxyModel 0.2
import ProtocolEnum 1.0
import "./"
import "../../Controls"
import "../../Config"
Drawer {
id: root
signal containerSelected(int c_index)
property int selectedIndex: -1
y: 0
x: 0
edge: Qt.RightEdge
width: parent.width * 0.85
height: parent.height
modal: true
interactive: activeFocus
SortFilterProxyModel {
id: proxyModel
sourceModel: UiLogic.containersModel
filters: [
ValueFilter {
roleName: "is_installed_role"
value: false },
ValueFilter {
roleName: "service_type_role"
value: ProtocolEnum.Vpn }
]
}
SortFilterProxyModel {
id: proxyModel_other
sourceModel: UiLogic.containersModel
filters: [
ValueFilter {
roleName: "is_installed_role"
value: false },
ValueFilter {
roleName: "service_type_role"
value: ProtocolEnum.Other }
]
}
FlickableType {
anchors.fill: parent
contentHeight: col.height
Column {
id: col
anchors {
left: parent.left;
right: parent.right;
}
topPadding: 20
spacing: 10
Caption {
id: cap1
text: qsTr("VPN containers")
font.pixelSize: 20
}
ListView {
id: tb
x: 10
currentIndex: -1
width: parent.width - 20
height: contentItem.height
spacing: 0
clip: true
interactive: false
model: proxyModel
delegate: Item {
implicitWidth: 170 * 2
implicitHeight: 30
Item {
width: parent.width
height: 30
anchors.left: parent.left
id: c1
Rectangle {
anchors.top: parent.top
width: parent.width
height: 1
color: "lightgray"
visible: index !== tb.currentIndex
}
Rectangle {
anchors.fill: parent
color: "#63B4FB"
visible: index === tb.currentIndex
}
Text {
id: text_name
text: name_role
font.pixelSize: 16
anchors.fill: parent
leftPadding: 10
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
tb.currentIndex = index
tb_other.currentIndex = -1
containerSelected(proxyModel.mapToSource(index))
selectedIndex = proxyModel.mapToSource(index)
root.close()
}
}
}
}
Caption {
id: cap2
font.pixelSize: 20
text: qsTr("Other containers")
}
ListView {
id: tb_other
x: 10
currentIndex: -1
width: parent.width - 20
height: contentItem.height
spacing: 0
clip: true
interactive: false
model: proxyModel_other
delegate: Item {
implicitWidth: 170 * 2
implicitHeight: 30
Item {
width: parent.width
height: 30
anchors.left: parent.left
id: c1_other
Rectangle {
anchors.top: parent.top
width: parent.width
height: 1
color: "lightgray"
visible: index !== tb_other.currentIndex
}
Rectangle {
anchors.fill: parent
color: "#63B4FB"
visible: index === tb_other.currentIndex
}
Text {
id: text_name_other
text: name_role
font.pixelSize: 16
anchors.fill: parent
leftPadding: 10
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
tb_other.currentIndex = index
tb.currentIndex = -1
containerSelected(proxyModel_other.mapToSource(index))
selectedIndex = proxyModel_other.mapToSource(index)
root.close()
}
}
}
}
}
}
}

View file

@ -1,90 +0,0 @@
import QtQuick
import QtQuick.Controls
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.
<ul>
<li>Sources on <a href=\"https://github.com/amnezia-vpn/desktop-client\">GitHub</a></li>
<li><a href=\"https://amnezia.org/\">Web Site</a></li>
<li><a href=\"https://t.me/amnezia_vpn_en\">Telegram group</a></li>
<li><a href=\"https://signal.group/#CjQKIB2gUf8QH_IXnOJMGQWMDjYz9cNfmRQipGWLFiIgc4MwEhAKBONrSiWHvoUFbbD0xwdh\">Signal group</a></li>
</ul>
")
}
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:
<ul>
<li><a href=\"https://t.me/amnezia_vpn_en\">Telegram group</a> (preferred way)</li>
<li>Create issue on <a href=\"https://github.com/amnezia-vpn/desktop-client/issues\">GitHub</a></li>
<li>Email to: <a href=\"support@amnezia.org\">support@amnezia.org</a></li>
</ul>")
}
Caption {
id: caption3
anchors.topMargin: 20
font.pixelSize: 22
text: qsTr("Donate")
width: undefined
anchors.top: label_support.bottom
}
LabelType {
anchors.bottom: caption3.bottom
anchors.left: caption3.right
anchors.leftMargin: 5
font.pixelSize: 24
text: "♥"
color: "red"
}
RichLabelType {
id: label_donate
anchors.top: caption3.bottom
text: qsTr("Please support Amnezia project by donation, we really need it now more than ever.
<ul>
<li>By credit card on <a href=\"https://www.patreon.com/amneziavpn\">Patreon</a> (starting from $1)</li>
<li>Send some coins to addresses listed <a href=\"https://github.com/amnezia-vpn/desktop-client/blob/master/README.md\">on GitHub page</a></li>
</ul>
")
}
Logo {
id: logo
anchors.bottom: parent.bottom
}
}

View file

@ -1,118 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.AdvancedServerSettings
logic: AdvancedServerSettingsLogic
enabled: AdvancedServerSettingsLogic.pageEnabled
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Advanced server settings")
anchors.horizontalCenter: parent.horizontalCenter
}
BusyIndicator {
z: 99
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: !AdvancedServerSettingsLogic.pageEnabled
running: !AdvancedServerSettingsLogic.pageEnabled
}
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: logo.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: AdvancedServerSettingsLogic.labelCurrentVpnProtocolText
}
TextFieldType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: AdvancedServerSettingsLogic.labelServerText
readOnly: true
background: Item {}
}
LabelType {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: AdvancedServerSettingsLogic.labelWaitInfoText
visible: AdvancedServerSettingsLogic.labelWaitInfoVisible
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: "Scan the server for installed containers"
visible: AdvancedServerSettingsLogic.pushButtonClearVisible
onClicked: {
AdvancedServerSettingsLogic.onPushButtonScanServerClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: AdvancedServerSettingsLogic.pushButtonClearText
visible: AdvancedServerSettingsLogic.pushButtonClearVisible
onClicked: {
popupClearServer.open()
}
}
BlueButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
text: qsTr("Clients Management")
onClicked: {
UiLogic.goToPage(PageEnum.ClientManagement)
}
}
PopupWithQuestion {
id: popupClearServer
questionText: "Attention! All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted. Continue?"
yesFunc: function() {
close()
AdvancedServerSettingsLogic.onPushButtonClearServerClicked()
}
noFunc: function() {
close()
}
}
}
}
Logo {
id : logo
anchors.bottom: parent.bottom
}
}

View file

@ -1,152 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.AppSettings
logic: AppSettingsLogic
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Application Settings")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
CheckBoxType {
visible: !GC.isMobile()
Layout.fillWidth: true
text: qsTr("Auto connect")
checked: AppSettingsLogic.checkBoxAutoConnectChecked
onCheckedChanged: {
AppSettingsLogic.checkBoxAutoConnectChecked = checked
AppSettingsLogic.onCheckBoxAutoconnectToggled(checked)
}
}
CheckBoxType {
visible: !GC.isMobile()
Layout.fillWidth: true
text: qsTr("Auto start")
checked: AppSettingsLogic.checkBoxAutostartChecked
onCheckedChanged: {
AppSettingsLogic.checkBoxAutostartChecked = checked
AppSettingsLogic.onCheckBoxAutostartToggled(checked)
}
}
CheckBoxType {
visible: !GC.isMobile()
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 {
visible: !GC.isMobile()
Layout.fillWidth: true
text: qsTr("Check for updates")
onClicked: {
Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest")
}
}
CheckBoxType {
Layout.fillWidth: true
Layout.topMargin: 15
text: qsTr("Keep logs")
checked: AppSettingsLogic.checkBoxSaveLogsChecked
onCheckedChanged: {
AppSettingsLogic.checkBoxSaveLogsChecked = checked
AppSettingsLogic.onCheckBoxSaveLogsCheckedToggled(checked)
}
}
BlueButtonType {
Layout.fillWidth: true
text: qsTr("Open logs folder")
onClicked: {
AppSettingsLogic.onPushButtonOpenLogsClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: qsTr("Export logs")
onClicked: {
AppSettingsLogic.onPushButtonExportLogsClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
property string start_text: qsTr("Clear logs")
property string end_text: qsTr("Cleared")
text: start_text
Timer {
id: timer
interval: 1000; running: false; repeat: false
onTriggered: parent.text = parent.start_text
}
onClicked: {
text = end_text
timer.running = true
AppSettingsLogic.onPushButtonClearLogsClicked()
}
}
LabelType {
Layout.fillWidth: true
Layout.topMargin: 30
text: qsTr("Backup and restore configuration")
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
Layout.preferredHeight: 41
text: qsTr("Backup app config")
onClicked: {
AppSettingsLogic.onPushButtonBackupAppConfigClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
Layout.preferredHeight: 41
text: qsTr("Restore app config")
onClicked: {
AppSettingsLogic.onPushButtonRestoreAppConfigClicked()
}
}
}
}
}

View file

@ -1,20 +0,0 @@
import QtQuick
import QtQuick.Controls
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
Item {
id: root
property var page: PageEnum.Start
property var logic: UiLogic
property bool pageActive: false
signal activated(bool reset)
signal deactivated()
onActivated: pageActive = true
onDeactivated: pageActive = false
}

View file

@ -1,119 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Shapes 1.4
import SortFilterProxyModel 0.2
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.ClientManagement
logic: ClientManagementLogic
enabled: !ClientManagementLogic.busyIndicatorIsRunning
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Clients Management")
}
BusyIndicator {
z: 99
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: ClientManagementLogic.busyIndicatorIsRunning
running: ClientManagementLogic.busyIndicatorIsRunning
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
Column {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
LabelType {
font.pixelSize: 20
leftPadding: -20
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: ClientManagementLogic.labelCurrentVpnProtocolText
}
SortFilterProxyModel {
id: proxyClientManagementModel
sourceModel: UiLogic.clientManagementModel
sorters: RoleSorter { roleName: "clientName" }
}
ListView {
id: lv_clients
width: parent.width
implicitHeight: contentHeight + 20
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 20
topMargin: 10
spacing: 10
clip: true
model: proxyClientManagementModel
highlightRangeMode: ListView.ApplyRange
highlightMoveVelocity: -1
delegate: Item {
implicitWidth: lv_clients.width
implicitHeight: 60
MouseArea {
id: ms
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
ClientManagementLogic.onClientItemClicked(proxyClientManagementModel.mapToSource(index))
}
}
Rectangle {
anchors.fill: parent
gradient: ms.containsMouse ? gradient_containsMouse : gradient_notContainsMouse
LinearGradient {
id: gradient_notContainsMouse
x1: 0 ; y1:0
x2: 0 ; y2: height
stops: [
GradientStop { position: 0.0; color: "#FAFBFE" },
GradientStop { position: 1.0; color: "#ECEEFF" }
]
}
LinearGradient {
id: gradient_containsMouse
x1: 0 ; y1:0
x2: 0 ; y2: height
stops: [
GradientStop { position: 0.0; color: "#FAFBFE" },
GradientStop { position: 1.0; color: "#DCDEDF" }
]
}
}
LabelType {
x: 20
y: 20
font.pixelSize: 20
text: clientName
}
}
}
}
}
}

View file

@ -1,166 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.GeneralSettings
logic: GeneralSettingsLogic
BackButton {
id: back
z: -1
}
FlickableType {
id: fl
anchors.top: back.bottom
anchors.topMargin: 0
anchors.bottomMargin: 10
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.topMargin: 10
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin
spacing: 15
// ---------- App settings ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/settings_black_24dp.svg"
text: qsTr("App settings")
onClicked: {
UiLogic.goToPage(PageEnum.AppSettings)
}
}
// ---------- Network settings ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/settings_suggest_black_24dp.svg"
text: qsTr("Network settings")
onClicked: {
UiLogic.goToPage(PageEnum.NetworkSettings)
}
}
// ---------- Server settings ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/vpn_key_black_24dp.svg"
text: qsTr("Server Settings")
enabled: GeneralSettingsLogic.existsAnyServer
onClicked: {
GeneralSettingsLogic.onPushButtonGeneralSettingsServerSettingsClicked()
}
}
// ---------- Share connection ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/share_black_24dp.svg"
text: qsTr("Share connection")
enabled: GeneralSettingsLogic.pushButtonGeneralSettingsShareConnectionEnable &&
GeneralSettingsLogic.existsAnyServer
onClicked: {
GeneralSettingsLogic.onPushButtonGeneralSettingsShareConnectionClicked()
}
}
// ---------- Servers ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/format_list_bulleted_black_24dp.svg"
text: qsTr("Servers")
enabled: GeneralSettingsLogic.existsAnyServer
onClicked: {
UiLogic.goToPage(PageEnum.ServersList)
}
}
// ---------- Add server ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/control_point_black_24dp.svg"
text: qsTr("Add server")
onClicked: {
if(GeneralSettingsLogic.existsAnyServer)
// If there is any server set we will go to Start Page
UiLogic.goToPage(PageEnum.Start)
else
// Else just come back to start page
UiLogic.closePage()
}
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: fl.height > (75+1) * 6 ? fl.height - (75+1) * 6 : 0
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
Layout.bottomMargin: 20
icon.source: "qrc:/images/svg/logout_black_24dp.svg"
text: qsTr("Exit")
onClicked: {
Qt.quit()
}
}
}
}
}

View file

@ -1,113 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.NetworkSettings
logic: NetworkSettingsLogic
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("DNS Servers")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
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 {
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
}
}
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()
}
}
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

@ -1,61 +0,0 @@
import QtQuick
import QtQuick.Controls
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.NewServer
BackButton {
id: back_from_new_server
}
Caption {
id: caption
text: qsTr("Setup your server to use VPN")
}
LabelType {
id: labelWizard
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: qsTr("If you want easily configure your server just run Wizard")
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: caption.bottom
anchors.topMargin: 30
}
BlueButtonType {
id: pushButtonWizard
text: qsTr("Run Setup Wizard")
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: labelWizard.bottom
anchors.topMargin: 10
onClicked: {
UiLogic.goToPage(PageEnum.Wizard);
}
}
LabelType {
id: labelManual
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: qsTr("Press configure manually to choose VPN protocols you want to install")
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: pushButtonWizard.bottom
anchors.topMargin: 40
}
BlueButtonType {
text: qsTr("Configure")
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: labelManual.bottom
anchors.topMargin: 10
onClicked: {
UiLogic.goToPage(PageEnum.NewServerProtocols);
}
}
Logo {
anchors.bottom: parent.bottom
}
}

View file

@ -1,154 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ContainerProps 1.0
import ProtocolProps 1.0
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
import "InstallSettings"
PageBase {
id: root
page: PageEnum.NewServerProtocols
logic: NewServerProtocolsLogic
onActivated: {
container_selector.selectedIndex = -1
UiLogic.containersModel.setSelectedServerIndex(-1)
}
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Select VPN protocols")
}
BlueButtonType {
id: pushButtonConfigure
enabled: container_selector.selectedIndex > 0
anchors.horizontalCenter: parent.horizontalCenter
y: parent.height - 60
width: parent.width - 40
height: 40
text: qsTr("Setup server")
onClicked: {
let cont = container_selector.selectedIndex
let tp = ProtocolProps.transportProtoFromString(cb_port_proto.currentText)
let port = tf_port_num.text
NewServerProtocolsLogic.onPushButtonConfigureClicked(cont, port, tp)
}
}
BlueButtonType {
id: pb_add_container
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: caption.bottom
anchors.topMargin: 10
width: parent.width - 40
height: 40
text: qsTr("Select protocol container")
font.pixelSize: 16
onClicked: container_selector.visible ? container_selector.close() : container_selector.open()
}
SelectContainer {
id: container_selector
onAboutToHide: {
pageLoader.focus = true
}
onContainerSelected: function(c_index){
var containerProto = ContainerProps.defaultProtocol(c_index)
tf_port_num.text = ProtocolProps.defaultPort(containerProto)
cb_port_proto.currentIndex = ProtocolProps.defaultTransportProto(containerProto)
tf_port_num.enabled = ProtocolProps.defaultPortChangeable(containerProto)
cb_port_proto.enabled = ProtocolProps.defaultTransportProtoChangeable(containerProto)
}
}
Column {
id: c1
visible: container_selector.selectedIndex > 0
width: parent.width
anchors.top: pb_add_container.bottom
anchors.topMargin: 10
Caption {
font.pixelSize: 22
text: UiLogic.containerName(container_selector.selectedIndex)
}
Text {
width: parent.width
anchors.topMargin: 10
padding: 10
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
text: UiLogic.containerDesc(container_selector.selectedIndex)
}
}
Rectangle {
id: frame_settings
visible: container_selector.selectedIndex > 0
width: parent.width
anchors.top: c1.bottom
anchors.topMargin: 10
border.width: 1
border.color: "lightgray"
anchors.bottomMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
radius: 2
Grid {
id: grid
visible: container_selector.selectedIndex > 0
anchors.fill: parent
columns: 2
horizontalItemAlignment: Grid.AlignHCenter
verticalItemAlignment: Grid.AlignVCenter
topPadding: 5
leftPadding: 10
spacing: 5
LabelType {
width: 130
text: qsTr("Port")
}
TextFieldType {
id: tf_port_num
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
}
LabelType {
width: 130
text: qsTr("Network Protocol")
}
ComboBoxType {
id: cb_port_proto
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
model: [
qsTr("udp"),
qsTr("tcp"),
]
}
}
}
}

View file

@ -1,94 +0,0 @@
import QtQuick
import QtQuick.Controls
import PageEnum 1.0
import QRCodeReader 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.QrDecoderIos
logic: QrDecoderLogic
onDeactivated: {
console.debug("Stopping QR decoder")
loader.sourceComponent = undefined
}
BackButton {
}
Caption {
id: caption
text: qsTr("Import configuration")
}
Connections {
target: Qt.platform.os == "ios" ? QrDecoderLogic : null
function onStartDecode() {
console.debug("Starting QR decoder")
loader.sourceComponent = component
}
function onStopDecode() {
console.debug("Stopping QR decoder")
loader.sourceComponent = undefined
}
}
Loader {
id: loader
anchors.top: caption.bottom
anchors.bottom: progressColumn.top
anchors.left: parent.left
anchors.right: parent.right
}
Column{
height: 40
id: progressColumn
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
ProgressBar {
id: progress
anchors.left: parent.left
anchors.right: parent.right
value: QrDecoderLogic.totalChunksCount === 0? 0 : (QrDecoderLogic.receivedChunksCount/QrDecoderLogic.totalChunksCount)
}
Text {
id: chunksCount
text: "Progress: " + QrDecoderLogic.receivedChunksCount +"/"+QrDecoderLogic.totalChunksCount
}
}
Component {
id: component
Item {
anchors.fill: parent
QRCodeReader {
id: qrCodeReader
onCodeReaded: {
QrDecoderLogic.onDetectedQrCode(code)
}
Component.onCompleted: {
qrCodeReader.setCameraSize(Qt.rect(loader.x,
loader.y,
loader.width,
loader.height))
qrCodeReader.startReading()
}
Component.onDestruction: qrCodeReader.stopReading()
}
}
}
}

View file

@ -1,121 +0,0 @@
import QtQuick
import QtQuick.Controls
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.ServerConfiguringProgress
logic: ServerConfiguringProgressLogic
Caption {
id: caption
text: qsTr("Configuring...")
}
LabelType {
id: label
x: 0
anchors.top: caption.bottom
anchors.topMargin: 10
width: parent.width
height: 31
text: qsTr("Please wait.")
horizontalAlignment: Text.AlignHCenter
}
LabelType {
id: labelServerBusy
x: 0
anchors.top: label.bottom
anchors.topMargin: 30
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
width: parent.width - 40
height: 41
text: ServerConfiguringProgressLogic.labelServerBusyText
visible: ServerConfiguringProgressLogic.labelServerBusyVisible
}
LabelType {
anchors.bottom: pr.top
anchors.bottomMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
width: parent.width - 40
height: 41
text: ServerConfiguringProgressLogic.labelWaitInfoText
visible: ServerConfiguringProgressLogic.labelWaitInfoVisible
}
BlueButtonType {
id: pb_cancel
z: 1
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: logo.bottom
anchors.bottomMargin: 40
width: root.width - 60
height: 40
text: qsTr("Cancel")
visible: ServerConfiguringProgressLogic.pushButtonCancelVisible
enabled: ServerConfiguringProgressLogic.pushButtonCancelVisible
onClicked: {
ServerConfiguringProgressLogic.onPushButtonCancelClicked()
}
}
ProgressBar {
id: pr
enabled: ServerConfiguringProgressLogic.pageEnabled
anchors.fill: pb_cancel
from: 0
to: ServerConfiguringProgressLogic.progressBarMaximum
value: ServerConfiguringProgressLogic.progressBarValue
visible: ServerConfiguringProgressLogic.progressBarVisible
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.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: ServerConfiguringProgressLogic.progressBarText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
visible: ServerConfiguringProgressLogic.progressBarTextVisible
}
}
Logo {
id : logo
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
}
}

View file

@ -1,434 +0,0 @@
import QtQuick
import QtQuick.Controls
import Qt.labs.platform
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import ContainerProps 1.0
import ProtocolProps 1.0
import PageEnum 1.0
import ProtocolEnum 1.0
import "./"
import "../Controls"
import "../Config"
import "InstallSettings"
PageBase {
id: root
page: PageEnum.ServerContainers
logic: ServerContainersLogic
enabled: ServerContainersLogic.pageEnabled
function resetPage() {
container_selector.selectedIndex = -1
}
Connections {
target: logic
function onUpdatePage() {
root.resetPage()
}
}
BackButton {
id: back
onClicked: tb_c.currentIndex = -1
}
Caption {
id: caption
text: container_selector.selectedIndex > 0 ? qsTr("Install new service") : qsTr("Installed services")
}
SelectContainer {
id: container_selector
onAboutToHide: {
pageLoader.focus = true
}
onContainerSelected: function(c_index) {
var containerProto = ContainerProps.defaultProtocol(c_index)
if (ProtocolProps.defaultPort(containerProto) < 0) {
tf_port_num.enabled = false
tf_port_num.text = qsTr("Default")
}
else tf_port_num.text = ProtocolProps.defaultPort(containerProto)
cb_port_proto.currentIndex = ProtocolProps.defaultTransportProto(containerProto)
tf_port_num.enabled = ProtocolProps.defaultPortChangeable(containerProto)
cb_port_proto.enabled = ProtocolProps.defaultTransportProtoChangeable(containerProto)
}
}
Column {
id: c1
visible: container_selector.selectedIndex > 0
width: parent.width
anchors.top: caption.bottom
anchors.topMargin: 10
Caption {
font.pixelSize: 22
text: UiLogic.containerName(container_selector.selectedIndex)
}
Text {
width: parent.width
anchors.topMargin: 10
padding: 10
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
text: UiLogic.containerDesc(container_selector.selectedIndex)
}
}
Rectangle {
id: frame_settings
visible: container_selector.selectedIndex > 0
width: parent.width
anchors.top: c1.bottom
anchors.topMargin: 10
border.width: 1
border.color: "lightgray"
anchors.bottomMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
radius: 2
Grid {
id: grid
visible: container_selector.selectedIndex > 0
anchors.fill: parent
columns: 2
horizontalItemAlignment: Grid.AlignHCenter
verticalItemAlignment: Grid.AlignVCenter
topPadding: 5
leftPadding: 10
spacing: 5
LabelType {
width: 130
text: qsTr("Port")
}
TextFieldType {
id: tf_port_num
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
}
LabelType {
width: 130
text: qsTr("Network Protocol")
}
ComboBoxType {
id: cb_port_proto
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
model: [
qsTr("udp"),
qsTr("tcp"),
]
}
}
}
BlueButtonType {
id: pb_cancel_add
visible: container_selector.selectedIndex > 0
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: pb_continue_add.top
anchors.bottomMargin: 20
width: parent.width - 40
height: 40
text: qsTr("Cancel")
font.pixelSize: 16
onClicked: container_selector.selectedIndex = -1
}
BlueButtonType {
id: pb_continue_add
visible: container_selector.selectedIndex > 0
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
width: parent.width - 40
height: 40
text: qsTr("Continue")
font.pixelSize: 16
onClicked: {
let cont = container_selector.selectedIndex
let tp = ProtocolProps.transportProtoFromString(cb_port_proto.currentText)
let port = tf_port_num.text
ServerContainersLogic.onPushButtonContinueClicked(cont, port, tp)
}
}
FlickableType {
visible: container_selector.selectedIndex <= 0
clip: true
width: parent.width
anchors.top: caption.bottom
anchors.bottom: pb_add_container.top
contentHeight: col.height
Column {
visible: container_selector.selectedIndex <= 0
id: col
anchors {
left: parent.left;
right: parent.right;
}
spacing: 10
Caption {
id: cap1
text: qsTr("Installed Protocols and Services")
leftPadding: -20
font.pixelSize: 20
}
SortFilterProxyModel {
id: proxyContainersModel
sourceModel: UiLogic.containersModel
filters: ValueFilter {
roleName: "is_installed_role"
value: true
}
}
SortFilterProxyModel {
id: proxyProtocolsModel
sourceModel: UiLogic.protocolsModel
filters: ValueFilter {
roleName: "is_installed_role"
value: true
}
}
ListView {
id: tb_c
width: parent.width - 10
height: tb_c.contentItem.height
currentIndex: -1
spacing: 5
clip: true
interactive: false
model: proxyContainersModel
delegate: Item {
implicitWidth: tb_c.width - 10
implicitHeight: c_item.height
Item {
id: c_item
width: parent.width
height: row_container.height + tb_p.height
anchors.left: parent.left
Rectangle {
anchors.top: parent.top
width: parent.width
height: 1
color: "lightgray"
visible: index !== tb_c.currentIndex
}
Rectangle {
anchors.top: row_container.top
anchors.bottom: row_container.bottom
anchors.left: parent.left
anchors.right: parent.right
color: "#63B4FB"
visible: index === tb_c.currentIndex
}
RowLayout {
id: row_container
anchors.left: parent.left
anchors.right: parent.right
Text {
id: lb_container_name
text: name_role
font.pixelSize: 17
color: "#100A44"
topPadding: 16
bottomPadding: 12
leftPadding: 10
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
Layout.fillWidth: true
MouseArea {
enabled: col.visible
anchors.top: lb_container_name.top
anchors.bottom: lb_container_name.bottom
anchors.left: parent.left
anchors.right: parent.right
propagateComposedEvents: true
onClicked: {
if (tb_c.currentIndex === index) tb_c.currentIndex = -1
else tb_c.currentIndex = index
UiLogic.protocolsModel.setSelectedDockerContainer(proxyContainersModel.mapToSource(index))
}
}
}
ImageButtonType {
id: button_remove
visible: (index === tb_c.currentIndex) && ServerContainersLogic.isManagedServer
Layout.alignment: Qt.AlignRight
checkable: true
icon.source: "qrc:/images/delete.png"
implicitWidth: 30
implicitHeight: 30
checked: default_role
onClicked: popupRemove.open()
VisibleBehavior on visible { }
}
PopupWithQuestion {
id: popupRemove
questionText: qsTr("Remove container") + " " + name_role + "?" + "\n" + qsTr("This action will erase all data of this container on the server.")
yesFunc: function() {
tb_c.currentIndex = -1
ServerContainersLogic.onPushButtonRemoveClicked(proxyContainersModel.mapToSource(index))
close()
}
noFunc: function() {
close()
}
}
ImageButtonType {
id: button_share
visible: (index === tb_c.currentIndex) && ServerContainersLogic.isManagedServer
Layout.alignment: Qt.AlignRight
icon.source: "qrc:/images/share.png"
implicitWidth: 30
implicitHeight: 30
onClicked: {
ServerContainersLogic.onPushButtonShareClicked(proxyContainersModel.mapToSource(index))
}
VisibleBehavior on visible { }
}
ImageButtonType {
id: button_default
visible: service_type_role == ProtocolEnum.Vpn
Layout.alignment: Qt.AlignRight
checkable: true
img.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
implicitWidth: 30
implicitHeight: 30
checked: default_role
onClicked: {
ServerContainersLogic.onPushButtonDefaultClicked(proxyContainersModel.mapToSource(index))
}
}
}
ListView {
id: tb_p
currentIndex: -1
x: 10
anchors.top: row_container.bottom
width: parent.width - 40
height: index === tb_c.currentIndex ? tb_p.contentItem.height : 0
implicitHeight: height
spacing: 0
clip: true
interactive: false
model: proxyProtocolsModel
Behavior on height {
NumberAnimation {
duration: 200
}
}
delegate: Item {
id: dp_item
implicitWidth: tb_p.width - 10
implicitHeight: p_item.height
Item {
id: p_item
width: parent.width
height: lb_protocol_name.height
anchors.left: parent.left
Rectangle {
anchors.top: parent.top
width: parent.width
height: 1
color: "lightgray"
visible: index > 0
}
SettingButtonType {
id: lb_protocol_name
topPadding: 10
bottomPadding: 10
anchors.left: parent.left
anchors.leftMargin: 10
width: parent.width
height: 45
text: qsTr(name_role + " settings")
textItem.font.pixelSize: 16
icon.source: "qrc:/images/settings.png"
onClicked: {
tb_p.currentIndex = index
ServerContainersLogic.onPushButtonProtoSettingsClicked(
proxyContainersModel.mapToSource(tb_c.currentIndex),
proxyProtocolsModel.mapToSource(tb_p.currentIndex))
}
}
}
}
}
}
}
}
}
}
BlueButtonType {
id: pb_add_container
visible: container_selector.selectedIndex < 0 && ServerContainersLogic.isManagedServer
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.topMargin: 10
anchors.bottomMargin: 20
width: parent.width - 40
height: 40
text: qsTr("Install new service")
font.pixelSize: 16
onClicked: container_selector.visible ? container_selector.close() : container_selector.open()
}
}

View file

@ -1,185 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Shapes 1.4
import PageEnum 1.0
import "../Controls"
import "./"
import "../Config"
PageBase {
id: root
page: PageEnum.ServersList
logic: ServerListLogic
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Servers")
width: undefined
}
SvgButtonType {
anchors.verticalCenter: caption.verticalCenter
anchors.leftMargin: 10
anchors.left: caption.right
width: 27
height: 27
icon.source: "qrc:/images/svg/control_point_black_24dp.svg"
onClicked: {
UiLogic.goToPage(PageEnum.Start);
}
}
ListView {
id: listWidget_servers
x: GC.defaultMargin
anchors.top: caption.bottom
anchors.topMargin: 15
width: parent.width - GC.defaultMargin - 1
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
model: ServerListLogic.serverListModel
highlightRangeMode: ListView.ApplyRange
highlightMoveVelocity: -1
currentIndex: ServerListLogic.currServerIdx
spacing: 5
clip: true
delegate: Item {
height: 60
width: listWidget_servers.width - 15
MouseArea {
id: ms
anchors.fill: parent
hoverEnabled: true
onClicked: {
if (GC.isMobile()) {
ServerListLogic.onServerListPushbuttonSettingsClicked(index)
}
mouse.accepted = false
}
onEntered: {
mouseExitAni.stop()
mouseEnterAni.start()
}
onExited: {
mouseEnterAni.stop()
mouseExitAni.start()
}
}
Rectangle {
anchors.fill: parent
gradient: ms.containsMouse ? gradient_containsMouse : gradient_notContainsMouse
LinearGradient {
id: gradient_notContainsMouse
x1: 0 ; y1:0
x2: 0 ; y2: height
stops: [
GradientStop { position: 0.0; color: "#FAFBFE" },
GradientStop { position: 1.0; color: "#ECEEFF" }
]
}
LinearGradient {
id: gradient_containsMouse
x1: 0 ; y1:0
x2: 0 ; y2: height
stops: [
GradientStop { position: 0.0; color: "#FAFBFE" },
GradientStop { position: 1.0; color: "#DCDEDF" }
]
}
}
LabelType {
id: label_address
x: 20
y: 40
width: listWidget_servers.width - 100
height: 16
text: address
}
Text {
x: 10
y: 10
width: listWidget_servers.width - 100
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: parent.width - 30
y: 15
width: 30
height: 30
checkable: true
icon.source: checked ? "qrc:/images/check.png"
: "qrc:/images/uncheck.png"
onClicked: {
ServerListLogic.onServerListPushbuttonDefaultClicked(index)
}
checked: is_default
enabled: !is_default
}
SvgButtonType {
id: pushButtonSetting
x: parent.width - 70
y: 15
width: 30
height: 30
icon.source: "qrc:/images/svg/settings_black_24dp.svg"
opacity: 0
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
}
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
hoverEnabled: true
propagateComposedEvents: true
onEntered: {
mouseExitAni.stop()
mouseEnterAni.start()
}
onExited: {
mouseEnterAni.stop()
mouseExitAni.start()
}
onClicked: {
ServerListLogic.onServerListPushbuttonSettingsClicked(index)
}
}
}
}
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
}
}
}

View file

@ -1,140 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.ServerSettings
logic: ServerSettingsLogic
enabled: ServerSettingsLogic.pageEnabled
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Server settings")
anchors.horizontalCenter: parent.horizontalCenter
}
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: logo.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ServerSettingsLogic.labelCurrentVpnProtocolText
}
TextFieldType {
Layout.fillWidth: true
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
text: ServerSettingsLogic.labelServerText
readOnly: true
background: Item {}
}
LabelType {
Layout.fillWidth: true
text: ServerSettingsLogic.labelWaitInfoText
visible: ServerSettingsLogic.labelWaitInfoVisible
}
TextFieldType {
Layout.fillWidth: true
text: ServerSettingsLogic.lineEditDescriptionText
onEditingFinished: {
ServerSettingsLogic.lineEditDescriptionText = text
ServerSettingsLogic.onLineEditDescriptionEditingFinished()
}
}
BlueButtonType {
text: qsTr("Protocols and Services")
Layout.topMargin: 20
Layout.fillWidth: true
onClicked: {
UiLogic.goToPage(PageEnum.ServerContainers)
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: qsTr("Share Server (FULL ACCESS)")
visible: ServerSettingsLogic.pushButtonShareFullVisible
onClicked: {
ServerSettingsLogic.onPushButtonShareFullClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: qsTr("Advanced server settings")
onClicked: {
UiLogic.goToPage(PageEnum.AdvancedServerSettings)
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 60
text: ServerSettingsLogic.pushButtonClearClientCacheText
visible: ServerSettingsLogic.pushButtonClearClientCacheVisible
onClicked: {
ServerSettingsLogic.onPushButtonClearClientCacheClicked()
}
}
BlueButtonType {
Layout.fillWidth: true
Layout.topMargin: 10
text: qsTr("Forget this server")
onClicked: {
if (ServerSettingsLogic.isCurrentServerHasCredentials()) {
popupForgetServer.questionText = "Attention! This action will not remove any data from the server, it will just remove server from the list. Continue?"
}
else {
popupForgetServer.questionText = "Remove server from the list?"
}
popupForgetServer.open()
}
}
PopupWithQuestion {
id: popupForgetServer
yesFunc: function() {
ServerSettingsLogic.onPushButtonForgetServer()
close()
}
noFunc: function() {
close()
}
}
}
}
Logo {
id : logo
anchors.bottom: parent.bottom
}
}

View file

@ -1,108 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.Wizard
logic: WizardLogic
BackButton {
id: back_from_setup_wizard
}
Caption {
id: caption
text: qsTr("Setup your server to use VPN")
}
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: next_button.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
RadioButtonType {
id: radioButton_setup_wizard_high
Layout.fillWidth: true
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
Layout.fillWidth: true
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 {
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

@ -1,96 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.WizardHigh
logic: WizardLogic
BackButton {
id: back_from_setup_wizard
}
Caption {
id: caption
text: qsTr("Setup Wizard")
}
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: next_button.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
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 = _text.replace("http://", "");
_text = _text.replace("https://", "");
if (!_text) {
return
}
_text = _text.split("/")[0];
WizardLogic.lineEditHighWebsiteMaskingText = _text
}
onAccepted: {
next_button.clicked()
}
}
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
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

@ -1,65 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.WizardLow
logic: WizardLogic
BackButton {
id: back_from_setup_wizard
}
Caption {
id: caption
text: qsTr("Setup Wizard")
}
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: next_button.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
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
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

@ -1,60 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.WizardMedium
logic: WizardLogic
BackButton {
id: back_from_setup_wizard
}
Caption {
id: caption
text: qsTr("Setup Wizard")
}
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: next_button.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
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
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

@ -1,65 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.WizardVpnMode
logic: WizardLogic
BackButton {
id: back_from_setup_wizard
}
Caption {
id: caption
text: qsTr("Setup Wizard")
}
FlickableType {
id: fl
anchors.top: caption.bottom
anchors.bottom: vpn_mode_finish.top
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
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 blocked 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.')
}
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
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

@ -1,87 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import ContainerProps 1.0
import ProtocolProps 1.0
import PageEnum 1.0
import ProtocolEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.ShareConnection
logic: ShareConnectionLogic
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share protocol config")
width: undefined
}
FlickableType {
clip: true
anchors.top: caption.bottom
contentHeight: col.height
boundsBehavior: Flickable.StopAtBounds
Column {
id: col
anchors {
left: parent.left;
right: parent.right;
}
topPadding: 20
spacing: 10
SortFilterProxyModel {
id: proxyProtocolsModel
sourceModel: UiLogic.protocolsModel
filters: ValueFilter {
roleName: "is_installed_role"
value: true
}
}
ShareConnectionContent {
text: qsTr("Share for Amnezia")
height: 40
width: tb_c.width - 10
onClicked: UiLogic.goToShareProtocolPage(ProtocolEnum.Any)
}
ListView {
id: tb_c
width: parent.width - 10
height: tb_c.contentItem.height
currentIndex: -1
spacing: 10
clip: true
interactive: false
model: proxyProtocolsModel
delegate: Item {
implicitWidth: tb_c.width - 10
implicitHeight: c_item.height
ShareConnectionContent {
id: c_item
text: qsTr("Share for ") + name_role
height: 40
width: tb_c.width - 10
onClicked: UiLogic.goToShareProtocolPage(proxyProtocolsModel.mapToSource(index))
}
}
}
}
}
}

View file

@ -1,315 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQml.Models
import Qt.labs.platform
import QtQuick.Dialogs
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.Sites
logic: SitesLogic
property int lastIndex: 0
BackButton {
id: back
}
Caption {
id: caption
text: SitesLogic.labelSitesAddCustomText
}
LabelType {
id: lb_addr
color: "#333333"
text: qsTr("Web site/Hostname/IP address/Subnet")
x: 20
anchors.top: caption.bottom
anchors.topMargin: 10
width: parent.width
height: 21
}
TextFieldType {
anchors.top: lb_addr.bottom
anchors.topMargin: 10
anchors.left: parent.left
anchors.leftMargin: 20
anchors.right: sites_add.left
anchors.rightMargin: 10
height: 31
placeholderText: qsTr("yousite.com or IP address")
text: SitesLogic.lineEditSitesAddCustomText
onEditingFinished: {
SitesLogic.lineEditSitesAddCustomText = text
}
onAccepted: {
SitesLogic.onPushButtonAddCustomSitesClicked()
}
}
BlueButtonType {
id: sites_add
anchors.right: sites_import.left
anchors.rightMargin: 10
anchors.top: lb_addr.bottom
anchors.topMargin: 10
width: 51
height: 31
font.pixelSize: 24
text: "+"
onClicked: {
SitesLogic.onPushButtonAddCustomSitesClicked()
}
}
BasicButtonType {
id: sites_import
anchors.right: parent.right
anchors.rightMargin: 20
anchors.top: lb_addr.bottom
anchors.topMargin: 10
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
currentFolder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
onAccepted: {
SitesLogic.onPushButtonSitesImportClicked(fileUrl)
}
}
DelegateModel {
id: visualModel
model: SitesLogic.tableViewSitesModel
groups: [
DelegateModelGroup {
id : delegateModelGroup
name: "multiSelect"
function removeAll(){
var count = delegateModelGroup.count;
if (count !== 0){
delegateModelGroup.remove(0,count);
}
}
function selectAll(){
for(var i = 0; i < visualModel.count; i++){
visualModel.items.get(i).inMultiSelect = true
}
}
}
]
delegate: Rectangle {
id: item
focus: true
height: 25
width: root.width
color: item.DelegateModel.inMultiSelect ? '#63b4fb' : 'transparent'
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
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked:{
tb.focus = true
if(mouse.button === Qt.RightButton){
//copyPasteMenu.popup()
console.log("RightButton")
}
if(mouse.button === Qt.LeftButton){
switch(mouse.modifiers){
case Qt.ControlModifier :
item.DelegateModel.inMultiSelect = !item.DelegateModel.inMultiSelect
break;
case Qt.ShiftModifier :
delegateModelGroup.removeAll();
var start = lastIndex <= index? lastIndex: index;
var end = lastIndex >= index? lastIndex: index;
for(var i = start;i <= end;i++){
visualModel.items.get(i).inMultiSelect = true
}
break;
default:
delegateModelGroup.removeAll();
item.DelegateModel.inMultiSelect = true
lastIndex = index
break;
}
}
}
}
}
}
ListView {
id: tb
x: 20
anchors.top: sites_add.bottom
anchors.topMargin: 10
width: parent.width - 40
anchors.bottom: sites_delete.top
anchors.bottomMargin: 10
spacing: 1
clip: true
focus: true
activeFocusOnTab: true
keyNavigationEnabled: true
property int currentRow: -1
model: visualModel
Keys.onPressed: {
if (event.key === Qt.Key_PageUp) {
let idx = tb.indexAt(1, tb.contentY)
tb.positionViewAtIndex(idx-20, ListView.Beginning)
event.accepted = true
}
else if (event.key === Qt.Key_PageDown) {
let idx = tb.indexAt(1, tb.contentY)
tb.positionViewAtIndex(idx+20, ListView.Beginning)
event.accepted = true
}
else if (event.key === Qt.Key_Home) {
tb.positionViewAtBeginning()
event.accepted = true
}
else if (event.key === Qt.Key_End) {
tb.positionViewAtEnd()
event.accepted = true
}
else if (event.key === Qt.Key_Delete) {
let items = []
for(let i = 0; i < visualModel.count; i++){
if (visualModel.items.get(i).inMultiSelect) items.push(i)
}
SitesLogic.onPushButtonSitesDeleteClicked(items)
event.accepted = true
}
else if (event.key === Qt.Key_A) {
delegateModelGroup.selectAll()
event.accepted = true
}
}
}
BlueButtonType {
id: sites_delete
anchors.bottom: select_all.top
anchors.bottomMargin: 10
anchors.horizontalCenter: parent.horizontalCenter
height: 31
font.pixelSize: 16
text: qsTr("Delete selected")
onClicked: {
let items = []
for(let i = 0; i < visualModel.count; i++){
if (visualModel.items.get(i).inMultiSelect) items.push(i)
}
SitesLogic.onPushButtonSitesDeleteClicked(items)
}
}
BlueButtonType {
id: select_all
anchors.bottom: sites_export.top
anchors.bottomMargin: 10
anchors.horizontalCenter: parent.horizontalCenter
height: 31
font.pixelSize: 16
text: qsTr("Select all")
onClicked: {
delegateModelGroup.selectAll()
}
}
BlueButtonType {
id: sites_export
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
height: 31
font.pixelSize: 16
text: qsTr("Export all")
onClicked: {
SitesLogic.onPushButtonSitesExportClicked()
}
}
}

View file

@ -1,356 +0,0 @@
import QtQuick
import QtQuick.Controls
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.Start
logic: StartPageLogic
Connections {
target: StartPageLogic
function onShowPassphraseRequestMessage() {
popupWithTextField.open()
}
}
BackButton {
id: back_from_start
visible: pageLoader.depth > 1
}
ImageButtonType {
anchors {
right: parent.right
top: parent.top
}
width: 41
height: 41
imgMarginHover: 8
imgMargin: 9
icon.source: "qrc:/images/settings_grey.png"
visible: !GeneralSettingsLogic.existsAnyServer
onClicked: {
UiLogic.goToPage(PageEnum.GeneralSettings)
}
}
Caption {
id: caption
text: start_switch_page.checked ?
qsTr("Setup your server to use VPN") :
qsTr("Connect to the already created VPN server")
}
Logo {
id: logo
anchors.bottom: parent.bottom
}
BasicButtonType {
id: start_switch_page
width: parent.width - 2 * GC.defaultMargin
implicitHeight: 40
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: logo.top
anchors.bottomMargin: 10
anchors.topMargin: 20
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: parent.width
anchors.top: caption.bottom
anchors.bottom: start_switch_page.top
anchors.bottomMargin: 10
visible: true
LabelType {
id: label_connection_code
anchors.top: parent.top
anchors.topMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Connection code")
}
TextFieldType {
id: lineEdit_start_existing_code
anchors.top: label_connection_code.bottom
anchors.horizontalCenter: parent.horizontalCenter
placeholderText: "vpn://..."
text: StartPageLogic.lineEditStartExistingCodeText
onEditingFinished: {
StartPageLogic.lineEditStartExistingCodeText = text
}
}
BlueButtonType {
id: new_sever_import
anchors.horizontalCenter: parent.horizontalCenter
y: 210
anchors.top: lineEdit_start_existing_code.bottom
anchors.topMargin: 10
text: qsTr("Connect")
onClicked: {
StartPageLogic.onPushButtonImport()
}
}
BlueButtonType {
id: qr_code_import_open
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: new_sever_import.bottom
anchors.topMargin: 40
text: qsTr("Open file")
onClicked: {
StartPageLogic.onPushButtonImportOpenFile()
}
enabled: StartPageLogic.pushButtonConnectEnabled
}
BlueButtonType {
id: qr_code_import
visible: GC.isMobile()
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: qr_code_import_open.bottom
anchors.topMargin: 10
text: qsTr("Scan QR code")
onClicked: {
if (Qt.platform.os === "ios") {
UiLogic.goToPage(PageEnum.QrDecoderIos)
} else {
StartPageLogic.startQrDecoder()
}
}
enabled: StartPageLogic.pushButtonConnectEnabled
}
BlueButtonType {
id: btn_restore_cfg
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: qr_code_import.bottom
anchors.topMargin: 30
visible: UiLogic.pagesStackDepth === 1
enabled: StartPageLogic.pushButtonConnectEnabled
text: qsTr("Restore app config")
onClicked: {
AppSettingsLogic.onPushButtonRestoreAppConfigClicked()
}
}
}
Item {
id: page_start_new_server
width: parent.width
anchors.top: caption.bottom
anchors.bottom: start_switch_page.top
anchors.bottomMargin: 10
visible: false
BasicButtonType {
id: new_sever_get_info
width: parent.width - 80
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 5
text: qsTr("How to get own server? →")
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/instruction.html")
}
}
LabelType {
id: label_server_ip
x: 40
anchors.top: new_sever_get_info.bottom
text: qsTr("Server IP address [:port]")
}
TextFieldType {
id: new_server_ip
anchors.top: label_server_ip.bottom
anchors.horizontalCenter: parent.horizontalCenter
text: StartPageLogic.lineEditIpText
onEditingFinished: { StartPageLogic.lineEditIpText = text }
onTextEdited: { StartPageLogic.lineEditIpText = text }
validator: RegularExpressionValidator {
regularExpression: StartPageLogic.ipAddressPortRegex
}
}
LabelType {
id:label_login
x: 40
anchors.top: new_server_ip.bottom
text: qsTr("Login to connect via SSH")
}
TextFieldType {
id: new_server_login
anchors.top: label_login.bottom
anchors.horizontalCenter: parent.horizontalCenter
text: StartPageLogic.lineEditLoginText
onEditingFinished: { StartPageLogic.lineEditLoginText = text }
onTextEdited: { StartPageLogic.lineEditLoginText = text }
}
LabelType {
id: label_new_server_password
x: 40
anchors.top: new_server_login.bottom
text: qsTr("Password")
}
TextFieldType {
id: new_server_password
anchors.top: label_new_server_password.bottom
anchors.horizontalCenter: parent.horizontalCenter
inputMethodHints: Qt.ImhSensitiveData
echoMode: TextInput.Password
text: StartPageLogic.lineEditPasswordText
onEditingFinished: { StartPageLogic.lineEditPasswordText = text }
onTextEdited: { StartPageLogic.lineEditPasswordText = text }
onAccepted: { StartPageLogic.onPushButtonConnect() }
}
TextFieldType {
id: new_server_ssh_key
anchors.top: label_new_server_password.bottom
anchors.horizontalCenter: parent.horizontalCenter
visible: false
height: 71
font.pixelSize: 10
verticalAlignment: Text.AlignTop
inputMethodHints: Qt.ImhSensitiveData
text: StartPageLogic.textEditSshKeyText
onEditingFinished: { StartPageLogic.textEditSshKeyText = text }
onTextEdited: { StartPageLogic.textEditSshKeyText = text }
onAccepted: { StartPageLogic.onPushButtonConnect() }
}
LabelType {
x: 40
y: 390
width: 301
height: 41
text: StartPageLogic.labelWaitInfoText
visible: StartPageLogic.labelWaitInfoVisible
wrapMode: Text.Wrap
}
BlueButtonType {
id: new_sever_connect
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: new_server_ssh_key.bottom
anchors.topMargin: 10
text: StartPageLogic.pushButtonConnectText
onClicked: {
StartPageLogic.onPushButtonConnect()
}
enabled: StartPageLogic.pushButtonConnectEnabled
}
UrlButtonType {
id: new_sever_connect_key
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: new_sever_connect.bottom
width: 281
height: 21
text: qsTr("Connect using SSH key")
label.font.pixelSize: 16
checkable: true
checked: StartPageLogic.pushButtonConnectKeyChecked
onCheckedChanged: {
StartPageLogic.pushButtonConnectKeyChecked = 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
}
}
}
PopupWithTextField {
id: popupWithTextField
placeholderText: "Enter private key passphrase"
yesFunc: function() {
editingFinished()
close()
StartPageLogic.passphraseDialogClosed()
text = ""
}
noFunc: function() {
close()
StartPageLogic.passphraseDialogClosed()
}
onEditingFinished: {
StartPageLogic.privateKeyPassphrase = text
}
}
}

View file

@ -1,387 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.Vpn
logic: VpnLogic
Image {
id: bg_top
anchors.horizontalCenter: parent.horizontalCenter
y: 0
width: parent.width
height: parent.height * 0.28
source: "qrc:/images/background_connected.png"
}
LabelType {
x: 10
y: 10
width: 100
height: 21
text: VpnLogic.labelVersionText
color: "#dddddd"
font.pixelSize: 12
}
UrlButtonType {
id: button_donate
y: 10
anchors.horizontalCenter: parent.horizontalCenter
height: 21
label.color: "#D4D4D4"
label.text: qsTr("Donate")
onClicked: {
UiLogic.goToPage(PageEnum.Test)
}
}
ImageButtonType {
x: parent.width - 40
y: 0
width: 41
height: 41
imgMarginHover: 8
imgMargin: 9
icon.source: "qrc:/images/settings_grey.png"
onClicked: {
UiLogic.goToPage(PageEnum.GeneralSettings)
}
}
LabelType {
id: lb_log_enabled
anchors.top: button_donate.bottom
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
height: 21
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "Logging enabled!"
color: "#D4D4D4"
visible: VpnLogic.labelLogEnabledVisible
}
AnimatedImage {
id: connect_anim
source: "qrc:/images/animation.gif"
anchors.top: bg_top.bottom
anchors.topMargin: 10
anchors.horizontalCenter: root.horizontalCenter
width: Math.min(parent.width, parent.height) / 4
height: width
visible: !VpnLogic.pushButtonConnectVisible
paused: VpnLogic.pushButtonConnectVisible && !root.pageActive
//VisibleBehavior on visible { }
}
BasicButtonType {
id: button_connect
anchors.horizontalCenter: connect_anim.horizontalCenter
anchors.verticalCenter: connect_anim.verticalCenter
width: connect_anim.width
height: width
checkable: true
checked: VpnLogic.pushButtonConnectChecked
onClicked: VpnLogic.onPushButtonConnectClicked()
background: Image {
anchors.fill: parent
source: button_connect.checked ? "qrc:/images/connected.png"
: "qrc:/images/disconnected.png"
}
contentItem: Item {}
antialiasing: true
enabled: VpnLogic.pushButtonConnectEnabled && VpnLogic.isContainerSupportedByCurrentPlatform
opacity: VpnLogic.pushButtonConnectVisible ? 1 : 0
// transitions: Transition {
// NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad; duration: 500 }
// }
}
LabelType {
id: lb_state
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: button_connect.bottom
width: parent.width
height: 21
horizontalAlignment: Text.AlignHCenter
text: VpnLogic.labelStateText
}
RowLayout {
id: layout1
anchors.top: lb_state.bottom
//anchors.topMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
height: 21
LabelType {
Layout.alignment: Qt.AlignRight
height: 21
text: ( VpnLogic.isContainerHaveAuthData ? qsTr("Server") : qsTr("Profile")) + ": "
}
BasicButtonType {
Layout.alignment: Qt.AlignLeft
height: 21
background: Item {}
text: VpnLogic.labelCurrentServer + (VpnLogic.isContainerHaveAuthData ? " →" : "")
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
onClicked: {
UiLogic.goToPage(PageEnum.ServersList)
}
}
}
RowLayout {
id: layout2
anchors.top: layout1.bottom
anchors.topMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
height: 21
LabelType {
Layout.alignment: Qt.AlignRight
height: 21
text: qsTr("Proto") + ": "
}
BasicButtonType {
Layout.alignment: Qt.AlignLeft
height: 21
background: Item {}
text: VpnLogic.labelCurrentService + (VpnLogic.isContainerHaveAuthData ? " →" : "")
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
onClicked: {
if (VpnLogic.isContainerHaveAuthData) UiLogic.onGotoCurrentProtocolsPage()
}
}
}
RowLayout {
id: layout3
anchors.top: layout2.bottom
anchors.topMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
height: 21
LabelType {
Layout.alignment: Qt.AlignRight
height: 21
text: qsTr("DNS") + ": "
}
BasicButtonType {
Layout.alignment: Qt.AlignLeft
height: 21
implicitWidth: implicitContentWidth > root.width * 0.6 ? root.width * 0.6 : implicitContentWidth + leftPadding + rightPadding
background: Item {}
text: VpnLogic.labelCurrentDns + (VpnLogic.isContainerHaveAuthData ? " →" : "")
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
onClicked: {
if (VpnLogic.isContainerHaveAuthData) UiLogic.goToPage(PageEnum.NetworkSettings)
}
}
SvgImageType {
svg.source: VpnLogic.amneziaDnsEnabled ? "qrc:/images/svg/gpp_good_black_24dp.svg" : "qrc:/images/svg/gpp_maybe_black_24dp.svg"
color: VpnLogic.amneziaDnsEnabled ? "#22aa33" : "orange"
width: 25
height: 25
}
}
LabelType {
id: error_text
anchors.top: layout3.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 20
width: parent.width - 20
height: 21
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: VpnLogic.labelErrorText
color: "red"
}
Item {
x: 0
anchors.bottom: line.top
anchors.bottomMargin: GC.isMobile() ? 0 :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: VpnLogic.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: VpnLogic.labelSpeedSentText
}
}
Rectangle {
id: line
x: 20
width: parent.width - 40
height: 1
anchors.bottom: GC.isMobile() ? root.bottom : conn_type_label.top
anchors.bottomMargin: 10
color: "#DDDDDD"
}
Text {
id: conn_type_label
visible: !GC.isMobile()
x: 20
anchors.bottom: conn_type_group.top
anchors.bottomMargin: GC.isMobile() ? 0 :10
width: 281
height: GC.isMobile() ? 0: 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
visible: !GC.isMobile()
anchors.bottom: button_add_site.top
width: 351
height: GC.isMobile() ? 0: 91
enabled: VpnLogic.widgetVpnModeEnabled
RadioButtonType {
x: 0
y: 0
width: 341
height: 19
checked: VpnLogic.radioButtonVpnModeAllSitesChecked
text: qsTr("For all connections")
onClicked: VpnLogic.onRadioButtonVpnModeAllSitesClicked(true)
}
RadioButtonType {
enabled: VpnLogic.isCustomRoutesSupported
x: 0
y: 60
width: 341
height: 19
text: qsTr("Except selected sites")
checked: VpnLogic.radioButtonVpnModeExceptSitesChecked
onClicked: VpnLogic.onRadioButtonVpnModeExceptSitesClicked(true)
}
RadioButtonType {
enabled: VpnLogic.isCustomRoutesSupported
x: 0
y: 30
width: 341
height: 19
text: qsTr("For selected sites")
checked: VpnLogic.radioButtonVpnModeForwardSitesChecked
onClicked: VpnLogic.onRadioButtonVpnModeForwardSitesClicked(true)
}
}
BasicButtonType {
id: button_add_site
visible: !GC.isMobile()
anchors.horizontalCenter: parent.horizontalCenter
y: parent.height - 60
width: parent.width - 40
height: GC.isMobile() ? 0: 40
text: qsTr("+ Add site")
enabled: ! VpnLogic.radioButtonVpnModeAllSitesChecked
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)
}
}
}

View file

@ -1,138 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import "./"
import "../Controls"
import "../Config"
PageBase {
id: root
page: PageEnum.ViewConfig
logic: ViewConfigLogic
readonly property double rowHeight: ta_last_config.contentHeight / ta_last_config.textArea.lineCount
BackButton {}
Caption {
id: caption
text: qsTr("Check config")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
TextAreaType {
id: ta_config
Layout.topMargin: 5
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.leftMargin: 1
Layout.rightMargin: 1
Layout.preferredHeight: ViewConfigLogic.warningActive ? 250 : fl.height - 70
flickableDirection: Flickable.AutoFlickIfNeeded
textArea.readOnly: true
textArea.text: logic.configText
}
LabelType {
id: lb_att
visible: ViewConfigLogic.warningActive
text: qsTr("Attention!
The config above contains cached OpenVPN connection profile.
AmneziaVPN detected this profile may contain malicious scripts. Please, carefully review the config and import this config only if you completely trust it.")
Layout.fillWidth: true
}
LabelType {
visible: ViewConfigLogic.warningActive
text: qsTr("Suspicious string:")
Layout.fillWidth: true
}
TextAreaType {
id: ta_mal
visible: ViewConfigLogic.warningActive
Layout.topMargin: 5
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.leftMargin: 1
Layout.rightMargin: 1
Layout.preferredHeight: 60
flickableDirection: Flickable.AutoFlickIfNeeded
textArea.readOnly: true
textArea.text: logic.openVpnMalStrings
textArea.textFormat: TextEdit.RichText
}
LabelType {
visible: ViewConfigLogic.warningActive
text: qsTr("Cached connection profile:")
Layout.fillWidth: true
}
TextAreaType {
id: ta_last_config
visible: ViewConfigLogic.warningActive
Layout.topMargin: 5
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.leftMargin: 1
Layout.rightMargin: 1
Layout.preferredHeight: 350
flickableDirection: Flickable.AutoFlickIfNeeded
textArea.readOnly: true
textArea.text: logic.openVpnLastConfigs
textArea.textFormat: TextEdit.RichText
Connections {
target: logic
function onWarningStringNumberChanged(n) {
ta_last_config.contentY = rowHeight * n - ta_last_config.height / 2
}
}
}
RowLayout {
id: btns_row
BasicButtonType {
Layout.preferredWidth: (content.width - parent.spacing) /2
Layout.preferredHeight: 40
font.pixelSize: btn_import.font.pixelSize
text: qsTr("Cancel")
onClicked: {
UiLogic.closePage()
}
}
BlueButtonType {
id: btn_import
Layout.preferredWidth: (content.width - parent.spacing) /2
text: qsTr("Import config")
onClicked: {
logic.importConfig()
}
}
}
}
}
}

View file

@ -1,194 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageProtocolBase {
id: root
protocol: ProtocolEnum.Cloak
logic: UiLogic.protocolLogic(protocol)
BackButton {
id: back
enabled: !logic.pushButtonCancelVisible
}
Caption {
id: caption
text: qsTr("Cloak Settings")
}
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: caption.bottom
anchors.left: root.left
anchors.right: root.right
anchors.bottom: pb_save.top
anchors.margins: 20
anchors.topMargin: 10
RowLayout {
Layout.fillWidth: true
LabelType {
height: 31
text: qsTr("Cipher")
Layout.preferredWidth: 0.3 * root.width - 10
}
ComboBoxType {
Layout.fillWidth: true
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 (logic.comboBoxCipherText === model[i]) {
return i
}
}
return -1
}
onCurrentTextChanged: {
logic.comboBoxCipherText = currentText
}
}
}
RowLayout {
Layout.fillWidth: true
LabelType {
Layout.preferredWidth: 0.3 * root.width - 10
height: 31
text: qsTr("Fake Web Site")
}
TextFieldType {
id: lineEdit_proto_cloak_site
Layout.fillWidth: true
height: 31
text: logic.lineEditSiteText
onEditingFinished: {
logic.lineEditSiteText = text
}
}
}
RowLayout {
Layout.fillWidth: true
LabelType {
Layout.preferredWidth: 0.3 * root.width - 10
height: 31
text: qsTr("Port")
}
TextFieldType {
id: lineEdit_proto_cloak_port
Layout.fillWidth: true
height: 31
text: logic.lineEditPortText
onEditingFinished: {
logic.lineEditPortText = text
}
enabled: logic.lineEditPortEnabled
}
}
Item {
Layout.fillHeight: true
}
}
LabelType {
id: label_server_busy
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelServerBusyVisible
text: logic.labelServerBusyText
}
LabelType {
id: label_proto_cloak_info
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelInfoVisible
text: logic.labelInfoText
}
ProgressBar {
id: progressBar_proto_cloak_reset
anchors.horizontalCenter: parent.horizontalCenter
anchors.fill: pb_save
from: 0
to: logic.progressBarResetMaximum
value: logic.progressBarResetValue
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: logic.progressBarResetVisible
LabelType {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: logic.progressBarText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
visible: logic.progressBarTextVisible
}
}
BlueButtonType {
id: pb_save
anchors.horizontalCenter: parent.horizontalCenter
enabled: logic.pageEnabled
anchors.bottom: root.bottom
anchors.bottomMargin: 20
width: root.width - 60
height: 40
text: qsTr("Save and restart VPN")
visible: logic.pushButtonSaveVisible
onClicked: {
logic.onPushButtonSaveClicked()
}
}
BlueButtonType {
anchors.fill: pb_save
text: qsTr("Cancel")
visible: logic.pushButtonCancelVisible
enabled: logic.pushButtonCancelVisible
onClicked: {
logic.onPushButtonCancelClicked()
}
}
}

View file

@ -1,454 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageProtocolBase {
id: root
protocol: ProtocolEnum.OpenVpn
logic: UiLogic.protocolLogic(protocol)
BackButton {
id: back
enabled: !logic.pushButtonCancelVisible
}
Caption {
id: caption
text: qsTr("OpenVPN Settings")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: GC.defaultMargin - 1
ColumnLayout {
visible: !logic.isThirdPartyConfig
LabelType {
id: lb_subnet
enabled: logic.pageEnabled
height: 21
text: qsTr("VPN Addresses Subnet")
}
TextFieldType {
id: tf_subnet
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 31
text: logic.lineEditSubnetText
onEditingFinished: {
logic.lineEditSubnetText = text
}
}
LabelType {
id: lb_proto
enabled: logic.pageEnabled
Layout.topMargin: 20
height: 21
text: qsTr("Network protocol")
}
Rectangle {
id: rect_proto
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 71
border.width: 1
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 {
enabled: logic.pageEnabled
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
enabled: logic.pageEnabled
implicitWidth: parent.width
height: 21
text: qsTr("Auto-negotiate encryption")
checked: logic.checkBoxAutoEncryptionChecked
onCheckedChanged: {
logic.checkBoxAutoEncryptionChecked = checked
}
onClicked: {
logic.checkBoxAutoEncryptionClicked()
}
}
LabelType {
id: lb_cipher
enabled: logic.pageEnabled
height: 21
text: qsTr("Cipher")
}
ComboBoxType {
id: cb_cipher
enabled: logic.pageEnabled && !check_auto_enc.checked
implicitWidth: parent.width
height: 31
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
}
onCurrentTextChanged: {
logic.comboBoxVpnCipherText = currentText
}
}
LabelType {
id: lb_hash
enabled: logic.pageEnabled
height: 21
Layout.topMargin: 20
text: qsTr("Hash")
}
ComboBoxType {
id: cb_hash
enabled: logic.pageEnabled && !check_auto_enc.checked
height: 31
implicitWidth: parent.width
model: [
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
}
onCurrentTextChanged: {
logic.comboBoxVpnHashText = currentText
}
}
CheckBoxType {
id: check_tls
enabled: logic.pageEnabled
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
enabled: logic.pageEnabled
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
enabled: logic.pageEnabled
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
}
antialiasing: true
checkable: true
checked: StartPageLogic.pushButtonConnectKeyChecked
}
Rectangle {
id: rect_client_conf
enabled: logic.pageEnabled
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
enabled: logic.pageEnabled
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
enabled: logic.pageEnabled
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_server_busy
enabled: logic.pageEnabled
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelServerBusyVisible
text: logic.labelServerBusyText
}
LabelType {
id: label_proto_openvpn_info
enabled: logic.pageEnabled
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
height: 41
visible: logic.labelProtoOpenVpnInfoVisible
text: logic.labelProtoOpenVpnInfoText
}
Rectangle {
id: it_save
implicitWidth: parent.width
Layout.topMargin: 20
height: 40
BlueButtonType {
id: pb_save
enabled: logic.pageEnabled
z: 1
height: 40
text: qsTr("Save and restart VPN")
width: parent.width
visible: logic.pushButtonSaveVisible
onClicked: {
logic.onPushButtonSaveClicked()
}
}
BlueButtonType {
z: 1
anchors.fill: pb_save
text: qsTr("Cancel")
visible: logic.pushButtonCancelVisible
enabled: logic.pushButtonCancelVisible
onClicked: {
logic.onPushButtonCancelClicked()
}
}
ProgressBar {
id: progress_save
anchors.fill: pb_save
from: 0
to: logic.progressBarResetMaximum
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);
}
}
}
LabelType {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: logic.progressBarText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
visible: logic.progressBarTextVisible
}
}
}
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

@ -1,140 +0,0 @@
import QtQuick
import QtQuick.Controls
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageProtocolBase {
id: root
protocol: ProtocolEnum.Sftp
logic: UiLogic.protocolLogic(protocol)
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("SFTP settings")
}
Rectangle {
id: frame_settings
width: parent.width
anchors.top: caption.bottom
anchors.topMargin: 10
border.width: 1
border.color: "lightgray"
anchors.bottomMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
radius: 2
Grid {
id: grid
anchors.fill: parent
columns: 2
horizontalItemAlignment: Grid.AlignHCenter
verticalItemAlignment: Grid.AlignVCenter
topPadding: 5
leftPadding: 30
rightPadding: 30
spacing: 5
LabelType {
width: 130
text: qsTr("Port")
}
TextFieldType {
id: tf_port_num
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
text: logic.labelTftpPortText
readOnly: true
}
LabelType {
width: 130
text: qsTr("User Name")
}
TextFieldType {
id: tf_user_name
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
text: logic.labelTftpUserNameText
readOnly: true
}
LabelType {
width: 130
text: qsTr("Password")
}
TextFieldType {
id: tf_password
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
text: logic.labelTftpPasswordText
readOnly: true
}
}
}
RichLabelType {
anchors.bottom: check_persist.top
anchors.bottomMargin: 10
width: parent.width - 60
x: 30
font.pixelSize: 14
readonly property string windows_text: "In order to mount remote SFTP folder as local drive, perform following steps:
<ul>
<li>Install the latest version of <a href=\"https://github.com/billziss-gh/winfsp/releases/latest\">WinFsp</a>.</li>
<li>Install the latest version of <a href=\"https://github.com/billziss-gh/sshfs-win/releases\">SSHFS-Win</a>. Choose the x64 or x86 installer according to your computer's architecture.</li>
</ul>"
readonly property string macos_text: "In order to mount remote SFTP folder as local folder, perform following steps:
<ul>
<li>Install the latest version of <a href=\"https://osxfuse.github.io/\">macFUSE</a>.</li>
<li>Install the latest version of <a href=\"https://osxfuse.github.io/\">SSHFS</a>.</li>
</ul>"
text: {
if (Qt.platform.os == "windows") return windows_text
else if (Qt.platform.os == "osx") return macos_text
else if (Qt.platform.os == "linux") return ""
else return ""
}
}
CheckBoxType {
id: check_persist
visible: false
anchors.bottom: pb_mount.top
anchors.bottomMargin: 10
x: 30
width: parent.width
height: 21
text: qsTr("Restore drive when client starts")
checked: logic.checkBoxSftpRestoreChecked
onCheckedChanged: {
logic.checkBoxSftpRestoreChecked = checked
}
onClicked: {
logic.checkBoxSftpRestoreClicked()
}
}
BlueButtonType {
id: pb_mount
visible: GC.isDesktop()
enabled: logic.pushButtonSftpMountEnabled
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
x: 30
width: parent.width - 60
height: 40
text: qsTr("Mount drive")
onClicked: {
logic.onPushButtonSftpMountDriveClicked()
}
}
}

View file

@ -1,175 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageProtocolBase {
id: root
protocol: ProtocolEnum.ShadowSocks
logic: UiLogic.protocolLogic(protocol)
BackButton {
id: back
enabled: !logic.pushButtonCancelVisible
}
Caption {
id: caption
text: qsTr("ShadowSocks Settings")
}
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: caption.bottom
anchors.left: root.left
anchors.right: root.right
anchors.bottom: pb_save.top
anchors.margins: 20
anchors.topMargin: 10
RowLayout {
Layout.fillWidth: true
LabelType {
height: 31
text: qsTr("Cipher")
Layout.preferredWidth: 0.3 * root.width - 10
}
ComboBoxType {
height: 31
Layout.fillWidth: true
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 (logic.comboBoxCipherText === model[i]) {
return i
}
}
return -1
}
}
}
RowLayout {
Layout.fillWidth: true
LabelType {
Layout.preferredWidth: 0.3 * root.width - 10
height: 31
text: qsTr("Port")
}
TextFieldType {
id: lineEdit_proto_shadowsocks_port
Layout.fillWidth: true
height: 31
text: logic.lineEditPortText
onEditingFinished: {
logic.lineEditPortText = text
}
enabled: logic.lineEditPortEnabled
}
}
Item {
Layout.fillHeight: true
}
LabelType {
id: label_server_busy
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelServerBusyVisible
text: logic.labelServerBusyText
}
LabelType {
id: label_proto_shadowsocks_info
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: parent.width
Layout.fillWidth: true
visible: logic.labelInfoVisible
text: logic.labelInfoText
}
}
ProgressBar {
id: progressBar_reset
anchors.fill: pb_save
from: 0
to: logic.progressBarResetMaximum
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: progressBar_reset.visualPosition * parent.width
height: parent.height
radius: 4
color: Qt.rgba(255, 255, 255, 0.15);
}
}
LabelType {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: logic.progressBarText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
visible: logic.progressBarTextVisible
}
}
BlueButtonType {
id: pb_save
enabled: logic.pageEnabled
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: root.bottom
anchors.bottomMargin: 20
width: root.width - 60
height: 40
text: qsTr("Save and restart VPN")
visible: logic.pushButtonSaveVisible
onClicked: {
logic.onPushButtonSaveClicked()
}
}
BlueButtonType {
anchors.fill: pb_save
text: qsTr("Cancel")
visible: logic.pushButtonCancelVisible
enabled: logic.pushButtonCancelVisible
onClicked: {
logic.onPushButtonCancelClicked()
}
}
}

View file

@ -1,69 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageProtocolBase {
id: root
protocol: ProtocolEnum.TorWebSite
logic: UiLogic.protocolLogic(protocol)
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Tor Web Site settings")
}
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: caption.bottom
anchors.left: root.left
anchors.right: root.right
anchors.margins: 20
anchors.topMargin: 10
RowLayout {
Layout.fillWidth: true
LabelType {
id: lbl_onion
Layout.preferredWidth: 0.3 * root.width - 10
text: qsTr("Web site onion address")
}
TextFieldType {
id: tf_site_address
Layout.fillWidth: true
text: logic.labelTorWebSiteAddressText
readOnly: true
}
}
ShareConnectionButtonCopyType {
Layout.fillWidth: true
Layout.topMargin: 5
copyText: tf_site_address.text
}
RichLabelType {
Layout.fillWidth: true
Layout.topMargin: 15
text: qsTr("Notes:<ul>
<li>Use <a href=\"https://www.torproject.org/download/\">Tor Browser</a> to open this url.</li>
<li>After installation it takes several minutes while your onion site will become available in the Tor Network.</li>
<li>When configuring WordPress set the domain as this onion address.</li>
</ul>
")
}
}
}

View file

@ -1,60 +0,0 @@
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

@ -1,13 +0,0 @@
import QtQuick
import QtQuick.Controls
import PageEnum 1.0
import ProtocolEnum 1.0
import "./.."
import "../../Controls"
import "../../Config"
PageBase {
id: root
property var protocol: ProtocolEnum.Any
page: PageEnum.ProtocolSettings
}

View file

@ -1,145 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.Any
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share for Amnezia")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height + 20
Behavior on contentY{
NumberAnimation {
duration: 300
easing.type: Easing.InOutCubic
}
}
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
Text {
id: lb_desc
Layout.fillWidth: true
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#181922"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
text: ShareConnectionLogic.shareFullAccess
? qsTr("Anyone who logs in with this code will have the same permissions to use VPN and YOUR SERVER as you. \n
This code includes your server credentials!\n
Provide this code only to TRUSTED users.")
: qsTr("Anyone who logs in with this code will be able to connect to this VPN server. \n
This code does not include server credentials.\n
New encryption keys pair will be generated.")
}
ShareConnectionButtonType {
Layout.topMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: 40
text: ShareConnectionLogic.shareFullAccess
? showConfigText
: (genConfigProcess ? generatingConfigText : generateConfigText)
onClicked: {
enabled = false
genConfigProcess = true
ShareConnectionLogic.onPushButtonShareAmneziaGenerateClicked()
enabled = true
genConfigProcess = false
fl.contentY = tfShareCode.mapToItem(fl.contentItem, 0, 0).y
}
}
TextAreaType {
id: tfShareCode
Layout.topMargin: 20
Layout.bottomMargin: 20
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.wrapMode: TextEdit.WrapAnywhere
textArea.verticalAlignment: Text.AlignTop
textArea.text: ShareConnectionLogic.textEditShareAmneziaCodeText
visible: tfShareCode.textArea.length > 0
}
ShareConnectionButtonCopyType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
copyText: tfShareCode.textArea.text
}
ShareConnectionButtonType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: Qt.platform.os === "android" ? qsTr("Share") : qsTr("Save to file")
enabled: tfShareCode.textArea.length > 0
visible: tfShareCode.textArea.length > 0
onClicked: {
UiLogic.saveTextFile(qsTr("Save AmneziaVPN config"), "amnezia_config.vpn", "*.vpn", tfShareCode.textArea.text)
}
}
Image {
id: image_share_code
Layout.topMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: width
smooth: false
Timer {
property int idx: 0
interval: 1000
running: root.pageActive && ShareConnectionLogic.shareAmneziaQrCodeTextSeriesLength > 0
repeat: true
onTriggered: {
idx++
if (idx >= ShareConnectionLogic.shareAmneziaQrCodeTextSeriesLength) {
idx = 0
}
image_share_code.source = ShareConnectionLogic.shareAmneziaQrCodeTextSeries[idx]
}
}
visible: ShareConnectionLogic.shareAmneziaQrCodeTextSeriesLength > 0
}
LabelType {
Layout.fillWidth: true
text: qsTr("Scan QR code using AmneziaVPN mobile")
}
}
}
}

View file

@ -1,99 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.Cloak
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share Cloak Settings")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
id: lb_desc
Layout.fillWidth: true
Layout.topMargin: 10
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("Note: Cloak protocol using same password for all connections")
}
ShareConnectionButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: genConfigProcess ? generatingConfigText : generateConfigText
onClicked: {
enabled = false
genConfigProcess = true
ShareConnectionLogic.onPushButtonShareCloakGenerateClicked()
enabled = true
genConfigProcess = false
}
}
TextAreaType {
id: tfShareCode
Layout.topMargin: 20
Layout.bottomMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: 200
textArea.readOnly: true
textArea.text: ShareConnectionLogic.textEditShareCloakText
visible: tfShareCode.textArea.length > 0
}
ShareConnectionButtonCopyType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
copyText: tfShareCode.textArea.text
}
ShareConnectionButtonType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: Qt.platform.os === "android" ? qsTr("Share") : qsTr("Save to file")
enabled: tfShareCode.textArea.length > 0
visible: tfShareCode.textArea.length > 0
onClicked: {
UiLogic.saveTextFile(qsTr("Save AmneziaVPN config"), "amnezia_config_cloak.json", "*.json", tfShareCode.textArea.text)
}
}
}
}
}

View file

@ -1,131 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.Ikev2
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share IKEv2 Settings")
}
TextAreaType {
id: tfCert
textArea.readOnly: true
textArea.text: ShareConnectionLogic.textEditShareIkev2CertText
visible: false
}
TextAreaType {
id: tfMobileConfig
textArea.readOnly: true
textArea.text: ShareConnectionLogic.textEditShareIkev2MobileConfigText
visible: false
}
TextAreaType {
id: tfStrongSwanConfig
textArea.readOnly: true
textArea.text: ShareConnectionLogic.textEditShareIkev2StrongSwanConfigText
visible: false
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
// LabelType {
// id: lb_desc
// Layout.fillWidth: true
// Layout.topMargin: 10
// horizontalAlignment: Text.AlignHCenter
// wrapMode: Text.Wrap
// text: qsTr("Note: ShadowSocks protocol using same password for all connections")
// }
ShareConnectionButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: genConfigProcess ? generatingConfigText : generateConfigText
onClicked: {
enabled = false
genConfigProcess = true
ShareConnectionLogic.onPushButtonShareIkev2GenerateClicked()
enabled = true
genConfigProcess = false
}
}
ShareConnectionButtonType {
Layout.topMargin: 30
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
width: parent.width - 60
text: qsTr("Export p12 certificate")
enabled: tfCert.textArea.length > 0
visible: tfCert.textArea.length > 0
onClicked: {
UiLogic.saveTextFile(qsTr("Export p12 certificate"), "amnezia_ikev2_cert_for_windows.p12", "*.p12", tfCert.textArea.text)
}
}
ShareConnectionButtonType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
width: parent.width - 60
text: qsTr("Export config for Apple")
enabled: tfMobileConfig.textArea.length > 0
visible: tfMobileConfig.textArea.length > 0
onClicked: {
UiLogic.saveTextFile(qsTr("Export config for Apple"), "amnezia_for_apple.plist", "*.plist", tfMobileConfig.textArea.text)
}
}
ShareConnectionButtonType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
width: parent.width - 60
text: qsTr("Export config for StrongSwan")
enabled: tfStrongSwanConfig.textArea.length > 0
visible: tfStrongSwanConfig.textArea.length > 0
onClicked: {
UiLogic.saveTextFile(qsTr("Export config for StrongSwan"), "amnezia_for_StrongSwan.profile", "*.profile", tfStrongSwanConfig.textArea.text)
}
}
}
}
}

View file

@ -1,96 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.OpenVpn
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share OpenVPN Settings")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
id: lb_desc
Layout.fillWidth: true
Layout.topMargin: 10
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("New encryption keys pair will be generated.")
}
ShareConnectionButtonType {
Layout.topMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: 40
text: genConfigProcess ? generatingConfigText : generateConfigText
onClicked: {
enabled = false
genConfigProcess = true
ShareConnectionLogic.onPushButtonShareOpenVpnGenerateClicked()
genConfigProcess = false
enabled = true
}
}
TextAreaType {
id: tfShareCode
Layout.topMargin: 20
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.verticalAlignment: Text.AlignTop
textArea.text: ShareConnectionLogic.textEditShareOpenVpnCodeText
visible: tfShareCode.textArea.length > 0
}
ShareConnectionButtonCopyType {
Layout.preferredHeight: 40
Layout.fillWidth: true
copyText: tfShareCode.textArea.text
}
ShareConnectionButtonType {
Layout.bottomMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
width: parent.width - 60
text: Qt.platform.os === "android" ? qsTr("Share") : qsTr("Save to file")
enabled: tfShareCode.textArea.length > 0
visible: tfShareCode.textArea.length > 0
onClicked: {
UiLogic.saveTextFile(qsTr("Save OpenVPN config"), "amnezia_for_openvpn.ovpn", "*.ovpn", tfShareCode.textArea.text)
}
}
}
}
}

View file

@ -1,21 +0,0 @@
import QtQuick
import QtQuick.Controls
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.Sftp
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share SFTP settings")
}
}

View file

@ -1,115 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.ShadowSocks
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share ShadowSocks Settings")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
id: lb_desc
Layout.fillWidth: true
Layout.topMargin: 10
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("Note: ShadowSocks protocol using same password for all connections")
}
ShareConnectionButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: genConfigProcess ? generatingConfigText : generateConfigText
onClicked: {
enabled = false
genConfigProcess = true
ShareConnectionLogic.onPushButtonShareShadowSocksGenerateClicked()
enabled = true
genConfigProcess = false
}
}
TextAreaType {
id: tfShareCode
Layout.topMargin: 20
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.wrapMode: TextEdit.WrapAnywhere
textArea.verticalAlignment: Text.AlignTop
textArea.text: ShareConnectionLogic.textEditShareShadowSocksText
visible: tfShareCode.textArea.length > 0
}
ShareConnectionButtonCopyType {
Layout.preferredHeight: 40
Layout.fillWidth: true
Layout.bottomMargin: 20
start_text: qsTr("Copy config")
copyText: tfShareCode.textArea.text
}
LabelType {
height: 20
visible: tfConnString.length > 0
text: qsTr("Connection string")
}
TextFieldType {
id: tfConnString
height: 100
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
text: ShareConnectionLogic.lineEditShareShadowSocksStringText
visible: tfConnString.length > 0
readOnly: true
}
ShareConnectionButtonCopyType {
Layout.preferredHeight: 40
Layout.fillWidth: true
start_text: qsTr("Copy string")
copyText: tfConnString.text
}
Image {
id: label_share_ss_qr_code
Layout.topMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: width
smooth: false
source: ShareConnectionLogic.shareShadowSocksQrCodeText
}
}
}
}

View file

@ -1,20 +0,0 @@
import QtQuick
import QtQuick.Controls
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.TorWebSite
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share Tor Web site")
}
}

View file

@ -1,103 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ProtocolEnum 1.0
import "../"
import "../../Controls"
import "../../Config"
PageShareProtocolBase {
id: root
protocol: ProtocolEnum.WireGuard
BackButton {
id: back
}
Caption {
id: caption
text: qsTr("Share WireGuard Settings")
}
FlickableType {
id: fl
anchors.top: caption.bottom
contentHeight: content.height
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 15
LabelType {
id: lb_desc
Layout.fillWidth: true
Layout.topMargin: 10
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("New encryption keys pair will be generated.")
}
ShareConnectionButtonType {
Layout.topMargin: 10
Layout.fillWidth: true
Layout.preferredHeight: 40
text: genConfigProcess ? generatingConfigText : generateConfigText
onClicked: {
enabled = false
genConfigProcess = true
ShareConnectionLogic.onPushButtonShareWireGuardGenerateClicked()
enabled = true
genConfigProcess = false
}
}
TextAreaType {
id: tfShareCode
Layout.topMargin: 20
Layout.preferredHeight: 200
Layout.fillWidth: true
textArea.readOnly: true
textArea.wrapMode: TextEdit.WrapAnywhere
textArea.verticalAlignment: Text.AlignTop
textArea.text: ShareConnectionLogic.textEditShareWireGuardCodeText
visible: tfShareCode.textArea.length > 0
}
ShareConnectionButtonCopyType {
Layout.preferredHeight: 40
Layout.fillWidth: true
copyText: tfShareCode.textArea.text
}
ShareConnectionButtonType {
Layout.preferredHeight: 40
Layout.fillWidth: true
text: Qt.platform.os === "android" ? qsTr("Share") : qsTr("Save to file")
enabled: tfShareCode.textArea.length > 0
visible: tfShareCode.textArea.length > 0
onClicked: {
UiLogic.saveTextFile(qsTr("Save OpenVPN config"), "amnezia_for_wireguard.conf", "*.conf", tfShareCode.textArea.text)
}
}
Image {
Layout.topMargin: 20
Layout.fillWidth: true
Layout.preferredHeight: width
smooth: false
source: ShareConnectionLogic.shareWireGuardQrCodeText
}
}
}
}

View file

@ -1,19 +0,0 @@
import QtQuick
import QtQuick.Controls
import PageEnum 1.0
import ProtocolEnum 1.0
import "./.."
import "../../Controls"
import "../../Config"
PageBase {
id: root
property var protocol: ProtocolEnum.Any
page: PageEnum.ProtocolShare
logic: ShareConnectionLogic
readonly property string generateConfigText: qsTr("Generate config")
readonly property string generatingConfigText: qsTr("Generating config...")
readonly property string showConfigText: qsTr("Show config")
property bool genConfigProcess: false
}

View file

@ -1,387 +0,0 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
import QtQuick.Dialogs
import QtQuick.Layouts
import QtQuick.Window
import Qt.labs.platform as LabsPlatform
import Qt.labs.folderlistmodel as LabsFolderlistmodel
import PageEnum 1.0
import PageType 1.0
import "Controls"
import "Pages"
import "Pages/Protocols"
import "Pages/Share"
import "Pages/ClientInfo"
import "Config"
Window {
property var pages: ({})
property var protocolPages: ({})
property var sharePages: ({})
property var clientInfoPages: ({})
id: root
visible: true
width: GC.screenWidth
height: GC.screenHeight
minimumWidth: GC.isDesktop() ? 360 : 0
minimumHeight: GC.isDesktop() ? 640 : 0
onClosing: function() {
console.debug("QML onClosing signal")
UiLogic.onCloseWindow()
}
title: "AmneziaVPN"
function gotoPage(type, page, reset, slide) {
let p_obj;
if (type === PageType.Basic) p_obj = pages[page]
else if (type === PageType.Proto) p_obj = protocolPages[page]
else if (type === PageType.ShareProto) p_obj = sharePages[page]
else if (type === PageType.ClientInfo) p_obj = clientInfoPages[page]
else return
//console.debug("QML gotoPage " + type + " " + page + " " + p_obj)
if (pageLoader.depth > 0) {
pageLoader.currentItem.deactivated()
}
if (slide) {
pageLoader.push(p_obj, {}, StackView.PushTransition)
} else {
pageLoader.push(p_obj, {}, StackView.Immediate)
}
if (reset) {
p_obj.logic.onUpdatePage();
}
p_obj.activated(reset)
}
function close_page() {
if (pageLoader.depth <= 1) {
if (GC.isMobile()) {
root.close()
}
return
}
pageLoader.currentItem.deactivated()
pageLoader.pop()
}
function set_start_page(page, slide) {
if (pageLoader.depth > 0) {
pageLoader.currentItem.deactivated()
}
pageLoader.clear()
if (slide) {
pageLoader.push(pages[page], {}, StackView.PushTransition)
} else {
pageLoader.push(pages[page], {}, StackView.Immediate)
}
if (page === PageEnum.Start) {
UiLogic.pushButtonBackFromStartVisible = !pageLoader.empty
UiLogic.onUpdatePage();
}
}
Rectangle {
anchors.fill: parent
color: "white"
}
StackView {
id: pageLoader
y: 0
anchors.fill: parent
focus: true
onCurrentItemChanged: function() {
UiLogic.currentPageValue = currentItem.page
}
onDepthChanged: function() {
UiLogic.pagesStackDepth = depth
}
Keys.onPressed: function(event) {
UiLogic.keyPressEvent(event.key)
event.accepted = true
}
}
LabsFolderlistmodel.FolderListModel {
id: folderModelPages
folder: "qrc:/ui/qml/Pages/"
nameFilters: ["*.qml"]
showDirs: false
onStatusChanged: if (status == LabsFolderlistmodel.FolderListModel.Ready) {
for (var i=0; i<folderModelPages.count; i++) {
createPagesObjects(folderModelPages.get(i, "filePath"), PageType.Basic);
}
UiLogic.initializeUiLogic()
}
}
LabsFolderlistmodel.FolderListModel {
id: folderModelProtocols
folder: "qrc:/ui/qml/Pages/Protocols/"
nameFilters: ["*.qml"]
showDirs: false
onStatusChanged: if (status == LabsFolderlistmodel.FolderListModel.Ready) {
for (var i=0; i<folderModelProtocols.count; i++) {
createPagesObjects(folderModelProtocols.get(i, "filePath"), PageType.Proto);
}
}
}
LabsFolderlistmodel.FolderListModel {
id: folderModelShareProtocols
folder: "qrc:/ui/qml/Pages/Share/"
nameFilters: ["*.qml"]
showDirs: false
onStatusChanged: if (status == LabsFolderlistmodel.FolderListModel.Ready) {
for (var i=0; i<folderModelShareProtocols.count; i++) {
createPagesObjects(folderModelShareProtocols.get(i, "filePath"), PageType.ShareProto);
}
}
}
LabsFolderlistmodel.FolderListModel {
id: folderModelClientInfo
folder: "qrc:/ui/qml/Pages/ClientInfo/"
nameFilters: ["*.qml"]
showDirs: false
onStatusChanged: if (status == LabsFolderlistmodel.FolderListModel.Ready) {
for (var i=0; i<folderModelClientInfo.count; i++) {
createPagesObjects(folderModelClientInfo.get(i, "filePath"), PageType.ClientInfo);
}
}
}
function createPagesObjects(file, type) {
if (file.indexOf("Base") !== -1) return; // skip Base Pages
//console.debug("Creating component " + file + " for " + type);
var c = Qt.createComponent("qrc" + file);
var finishCreation = function (component){
if (component.status === Component.Ready) {
var obj = component.createObject(root);
if (obj === null) {
console.debug("Error creating object " + component.url);
}
else {
obj.visible = false
if (type === PageType.Basic) {
pages[obj.page] = obj
}
else if (type === PageType.Proto) {
protocolPages[obj.protocol] = obj
}
else if (type === PageType.ShareProto) {
sharePages[obj.protocol] = obj
}
else if (type === PageType.ClientInfo) {
clientInfoPages[obj.protocol] = obj
}
// console.debug("Created component " + component.url + " for " + type);
}
} else if (component.status === Component.Error) {
console.debug("Error loading component:", component.errorString());
}
}
if (c.status === Component.Ready)
finishCreation(c);
else {
console.debug("Warning: " + file + " page components are not ready " + c.errorString());
}
}
Connections {
target: UiLogic
function onGoToPage(page, reset, slide) {
//console.debug("Qml Connections onGoToPage " + page);
root.gotoPage(PageType.Basic, page, reset, slide)
}
function onGoToProtocolPage(protocol, reset, slide) {
//console.debug("Qml Connections onGoToProtocolPage " + protocol);
root.gotoPage(PageType.Proto, protocol, reset, slide)
}
function onGoToShareProtocolPage(protocol, reset, slide) {
//console.debug("Qml Connections onGoToShareProtocolPage " + protocol);
root.gotoPage(PageType.ShareProto, protocol, reset, slide)
}
function onGoToClientInfoPage(protocol, reset, slide) {
//console.debug("Qml Connections onGoToClientInfoPage " + protocol);
root.gotoPage(PageType.ClientInfo, protocol, reset, slide)
}
function onClosePage() {
root.close_page()
}
function onSetStartPage(page, slide) {
root.set_start_page(page, slide)
}
function onShowPublicKeyWarning() {
publicKeyWarning.visible = true
}
function onShowConnectErrorDialog() {
connectErrorDialog.visible = true
}
function onShow() {
root.show()
}
function onHide() {
root.hide()
}
function onRaise() {
root.show()
root.raise()
root.requestActivate()
}
function onToggleLogPanel() {
drawer_log.visible = !drawer_log.visible
}
function onShowWarningMessage(message) {
popupWarning.popupWarningText = message
popupWarning.open()
}
}
MessageDialog {
id: publicKeyWarning
title: "AmneziaVPN"
text: qsTr("It's public key. Private key required")
visible: false
}
Drawer {
id: drawer_log
y: 0
x: 0
edge: Qt.BottomEdge
width: parent.width
height: parent.height * 0.85
modal: true
//interactive: activeFocus
onAboutToHide: {
pageLoader.focus = true
}
onAboutToShow: {
tfSshLog.focus = true
}
Item {
id: itemLog
anchors.fill: parent
Keys.onPressed: {
UiLogic.keyPressEvent(event.key)
event.accepted = true
}
RadioButtonType {
id: rbSshLog
focus: false
anchors.left: parent.left
anchors.leftMargin: 10
anchors.bottom: parent.bottom
anchors.bottomMargin: 2
height: 25
text: qsTr("Ssh log")
}
RadioButtonType {
id: rbAllLog
focus: false
checked: true
anchors.left: rbSshLog.right
anchors.bottom: rbSshLog.bottom
anchors.top: rbSshLog.top
height: rbSshLog.height
text: qsTr("App log")
}
CheckBoxType {
id: cbLogWrap
text: qsTr("Wrap words")
checked: true
anchors.right: parent.right
anchors.bottom: rbAllLog.bottom
anchors.top: rbAllLog.top
height: 15
imageHeight: 15
imageWidth: 15
onCheckedChanged: {
tfSshLog
}
}
TextAreaType {
id: tfSshLog
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: rbSshLog.top
flickableDirection: Flickable.AutoFlickIfNeeded
textArea.readOnly: true
textArea.selectByMouse: true
textArea.verticalAlignment: Text.AlignTop
textArea.text: {
if (!drawer_log.visible) return ""
else if (rbSshLog.checked ) return Debug.sshLog
else return Debug.allLog
}
textArea.wrapMode: cbLogWrap.checked ? TextEdit.WordWrap: TextEdit.NoWrap
Keys.onPressed: function(event) {
UiLogic.keyPressEvent(event.key)
event.accepted = true
}
textArea.onTextChanged: {
textArea.cursorPosition = textArea.length-1
}
MouseArea {
anchors.fill: parent
enabled: GC.isDesktop()
acceptedButtons: Qt.RightButton
onClicked: contextMenu.open()
}
ContextMenu {
id: contextMenu
textObj: tfSshLog.textArea
}
}
}
}
PopupWarning {
id: popupWarning
}
}