Merge branch 'dev' into feature/app-update

This commit is contained in:
aiamnezia 2024-10-30 16:55:07 +04:00
commit a71ca29b2f
685 changed files with 51300 additions and 12531 deletions

View file

@ -6,13 +6,15 @@ import Qt5Compat.GraphicalEffects
import ConnectionState 1.0
import PageEnum 1.0
import Style 1.0
Button {
id: root
property string defaultButtonColor: "#D7D8DB"
property string progressButtonColor: "#D7D8DB"
property string connectedButtonColor: "#FBB26A"
property string defaultButtonColor: AmneziaStyle.color.paleGray
property string progressButtonColor: AmneziaStyle.color.paleGray
property string connectedButtonColor: AmneziaStyle.color.goldenApricot
property bool buttonActiveFocus: activeFocus && (Qt.platform.os !== "android" || SettingsController.isOnTv())
implicitWidth: 190
implicitHeight: 190
@ -49,14 +51,14 @@ Button {
verticalOffset: 0
radius: 10
samples: 25
color: root.activeFocus ? "#D7D8DB" : "#FBB26A"
color: root.buttonActiveFocus ? AmneziaStyle.color.paleGray : AmneziaStyle.color.goldenApricot
source: backgroundCircle
}
ShapePath {
fillColor: "transparent"
strokeColor: "#D7D8DB"
strokeWidth: root.activeFocus ? 1 : 0
fillColor: AmneziaStyle.color.transparent
strokeColor: AmneziaStyle.color.paleGray
strokeWidth: root.buttonActiveFocus ? 1 : 0
capStyle: ShapePath.RoundCap
PathAngleArc {
@ -70,24 +72,24 @@ Button {
}
ShapePath {
fillColor: "transparent"
fillColor: AmneziaStyle.color.transparent
strokeColor: {
if (ConnectionController.isConnectionInProgress) {
return "#261E1A"
return AmneziaStyle.color.darkCharcoal
} else if (ConnectionController.isConnected) {
return connectedButtonColor
} else {
return defaultButtonColor
}
}
strokeWidth: root.activeFocus ? 2 : 3
strokeWidth: root.buttonActiveFocus ? 2 : 3
capStyle: ShapePath.RoundCap
PathAngleArc {
centerX: backgroundCircle.width / 2
centerY: backgroundCircle.height / 2
radiusX: 93 - (root.activeFocus ? 2 : 0)
radiusY: 93 - (root.activeFocus ? 2 : 0)
radiusX: 93 - (root.buttonActiveFocus ? 2 : 0)
radiusY: 93 - (root.buttonActiveFocus ? 2 : 0)
startAngle: 0
sweepAngle: 360
}
@ -113,8 +115,8 @@ Button {
visible: ConnectionController.isConnectionInProgress
ShapePath {
fillColor: "transparent"
strokeColor: "#D7D8DB"
fillColor: AmneziaStyle.color.transparent
strokeColor: AmneziaStyle.color.paleGray
strokeWidth: 3
capStyle: ShapePath.RoundCap

View file

@ -14,7 +14,7 @@ DrawerType2 {
property bool isAppSplitTinnelingEnabled: Qt.platform.os === "windows" || Qt.platform.os === "android"
anchors.fill: parent
expandedHeight: parent.height * 0.7
expandedHeight: parent.height * 0.9
expandedContent: ColumnLayout {
id: content
@ -53,7 +53,7 @@ DrawerType2 {
Layout.fillWidth: true
Layout.topMargin: 16
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi")
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling
text: qsTr("Split tunneling on the server")
descriptionText: qsTr("Enabled \nCan't be disabled for current server")
@ -68,7 +68,7 @@ DrawerType2 {
}
DividerType {
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi")
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling
}
LabelWithButtonType {

View file

@ -8,6 +8,7 @@ import "../Controls2/TextTypes"
import SortFilterProxyModel 0.2
import InstalledAppsModel 1.0
import Style 1.0
DrawerType2 {
id: root
@ -133,7 +134,7 @@ DrawerType2 {
anchors.rightMargin: 16
anchors.leftMargin: 16
backgroundColor: "#2C2D30"
backgroundColor: AmneziaStyle.color.slateGray
textFieldPlaceholderText: qsTr("application name")
}

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "../Controls2"
import "../Controls2/TextTypes"
@ -86,11 +88,11 @@ DrawerType2 {
Layout.rightMargin: 16
Layout.leftMargin: 16
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: noButtonText

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
@ -145,8 +147,8 @@ DrawerType2 {
indicator: Rectangle {
width: parent.width - 1
height: parent.height
color: radioButton.hovered ? "#2C2D30" : "#1C1D21"
border.color: radioButton.focus ? "#D7D8DB" : "transparent"
color: radioButton.hovered ? AmneziaStyle.color.slateGray : AmneziaStyle.color.onyxBlack
border.color: radioButton.focus ? AmneziaStyle.color.paleGray : AmneziaStyle.color.transparent
border.width: radioButton.focus ? 1 : 0
Behavior on color {

View file

@ -93,20 +93,11 @@ ListView {
PageController.goToPage(PageEnum.PageProtocolRaw)
break
}
case ContainerEnum.Sftp: {
SftpConfigModel.updateModel(config)
PageController.goToPage(PageEnum.PageServiceSftpSettings)
break
}
case ContainerEnum.TorWebSite: {
PageController.goToPage(PageEnum.PageServiceTorWebsiteSettings)
break
}
case ContainerEnum.Dns: {
PageController.goToPage(PageEnum.PageServiceDnsSettings)
break
}
default: { // go to the settings page of the container with multiple protocols
default: {
ProtocolsModel.updateModel(config)
PageController.goToPage(PageEnum.PageSettingsServerProtocol)
}

View file

@ -9,6 +9,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -111,11 +112,11 @@ DrawerType2 {
Layout.fillWidth: true
Layout.topMargin: 8
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Copy")
@ -134,11 +135,11 @@ DrawerType2 {
visible: false
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Copy config string")
@ -153,11 +154,11 @@ DrawerType2 {
Layout.fillWidth: true
Layout.topMargin: 24
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Show connection settings")
@ -281,9 +282,9 @@ DrawerType2 {
readOnly: true
activeFocusOnTab: false
color: "#D7D8DB"
selectionColor: "#633303"
selectedTextColor: "#D7D8DB"
color: AmneziaStyle.color.paleGray
selectionColor: AmneziaStyle.color.richBrown
selectedTextColor: AmneziaStyle.color.paleGray
font.pixelSize: 16
font.weight: Font.Medium
@ -294,7 +295,7 @@ DrawerType2 {
wrapMode: Text.Wrap
background: Rectangle {
color: "transparent"
color: AmneziaStyle.color.transparent
}
}
}

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "../Controls2"
import "../Controls2/TextTypes"
@ -14,7 +16,7 @@ Rectangle {
implicitWidth: transportProtoButtonGroup.implicitWidth
implicitHeight: transportProtoButtonGroup.implicitHeight
color: "#1C1D21"
color: AmneziaStyle.color.onyxBlack
radius: 16
onFocusChanged: {

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Style 1.0
Item {
id: root
@ -28,7 +30,7 @@ Item {
ImageButtonType {
id: backButton
image: backButtonImage
imageColor: "#D7D8DB"
imageColor: AmneziaStyle.color.paleGray
implicitWidth: 40
implicitHeight: 40
@ -46,7 +48,7 @@ Item {
id: background
Layout.fillWidth: true
color: "transparent"
color: AmneziaStyle.color.transparent
}
}

View file

@ -3,20 +3,22 @@ import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Style 1.0
import "TextTypes"
Button {
id: root
property string hoveredColor: "#C1C2C5"
property string defaultColor: "#D7D8DB"
property string disabledColor: "#494B50"
property string pressedColor: "#979799"
property string hoveredColor: AmneziaStyle.color.lightGray
property string defaultColor: AmneziaStyle.color.paleGray
property string disabledColor: AmneziaStyle.color.charcoalGray
property string pressedColor: AmneziaStyle.color.mutedGray
property string textColor: "#0E0E11"
property string textColor: AmneziaStyle.color.midnightBlack
property string borderColor: "#D7D8DB"
property string borderFocusedColor: "#D7D8DB"
property string borderColor: AmneziaStyle.color.paleGray
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderWidth: 0
property int borderFocusedWidth: 1
@ -30,6 +32,8 @@ Button {
property var clickedFunc
property alias buttonTextLabel: buttonText
implicitHeight: 56
hoverEnabled: true
@ -46,8 +50,8 @@ Button {
background: Rectangle {
id: focusBorder
color: "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
color: AmneziaStyle.color.transparent
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent
border.width: root.activeFocus ? root.borderFocusedWidth : 0
anchors.fill: parent
@ -138,6 +142,8 @@ Button {
}
ButtonTextType {
id: buttonText
color: textColor
text: root.text
visible: root.text === "" ? false : true

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Shapes
import Style 1.0
Popup {
id: root
anchors.centerIn: parent
@ -16,7 +18,7 @@ Popup {
}
background: Rectangle {
color: "transparent"
color: AmneziaStyle.color.transparent
}
BusyIndicator {
@ -40,8 +42,8 @@ Popup {
layer.samples: 4
ShapePath {
fillColor: "transparent"
strokeColor: "#787878"
fillColor: AmneziaStyle.color.transparent
strokeColor: AmneziaStyle.color.charcoalGray
strokeWidth: 3
capStyle: ShapePath.RoundCap

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
RadioButton {
id: root
@ -9,17 +11,17 @@ RadioButton {
property string bodyText
property string footerText
property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultColor: Qt.rgba(1, 1, 1, 0)
property string disabledColor: Qt.rgba(1, 1, 1, 0)
property string pressedColor: Qt.rgba(1, 1, 1, 0.05)
property string selectedColor: Qt.rgba(1, 1, 1, 0)
property string hoveredColor: AmneziaStyle.color.barelyTranslucentWhite
property string defaultColor: AmneziaStyle.color.transparent
property string disabledColor: AmneziaStyle.color.transparent
property string pressedColor: AmneziaStyle.color.barelyTranslucentWhite
property string selectedColor: AmneziaStyle.color.transparent
property string textColor: "#0E0E11"
property string textColor: AmneziaStyle.color.midnightBlack
property string pressedBorderColor: Qt.rgba(251/255, 178/255, 106/255, 0.3)
property string selectedBorderColor: "#FBB26A"
property string defaultBodredColor: "transparent"
property string selectedBorderColor: AmneziaStyle.color.goldenApricot
property string defaultBodredColor: AmneziaStyle.color.transparent
property int borderWidth: 0
implicitWidth: content.implicitWidth
@ -82,7 +84,7 @@ RadioButton {
Text {
text: root.headerText
wrapMode: Text.WordWrap
color: "#D7D8DB"
color: AmneziaStyle.color.paleGray
font.pixelSize: 25
font.weight: 700
font.family: "PT Root UI VF"
@ -97,7 +99,7 @@ RadioButton {
Text {
text: root.bodyText
wrapMode: Text.WordWrap
color: "#D7D8DB"
color: AmneziaStyle.color.paleGray
font.pixelSize: 16
font.weight: 400
font.family: "PT Root UI VF"
@ -113,7 +115,7 @@ RadioButton {
text: root.footerText
wrapMode: Text.WordWrap
visible: root.footerText !== ""
color: "#878B91"
color: AmneziaStyle.color.mutedGray
font.pixelSize: 13
font.weight: 400
font.family: "PT Root UI VF"

View file

@ -0,0 +1,178 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Button {
id: root
property string headerText
property string bodyText
property string footerText
property string hoveredColor: AmneziaStyle.color.slateGray
property string defaultColor: AmneziaStyle.color.onyxBlack
property string textColor: AmneziaStyle.color.midnightBlack
property string rightImageSource
property string rightImageColor: AmneziaStyle.color.paleGray
property string leftImageSource
property real textOpacity: 1.0
hoverEnabled: true
background: Rectangle {
id: backgroundRect
anchors.fill: parent
radius: 16
color: defaultColor
Behavior on color {
PropertyAnimation { duration: 200 }
}
}
contentItem: Item {
anchors.left: parent.left
anchors.right: parent.right
implicitHeight: content.implicitHeight
RowLayout {
id: content
anchors.fill: parent
Image {
id: leftImage
source: leftImageSource
visible: leftImageSource !== ""
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.topMargin: 24
Layout.bottomMargin: 24
Layout.leftMargin: 24
}
ColumnLayout {
ListItemTitleType {
text: root.headerText
visible: text !== ""
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.topMargin: 16
Layout.bottomMargin: root.bodyText !== "" ? 0 : 16
opacity: root.textOpacity
}
CaptionTextType {
text: root.bodyText
visible: text !== ""
color: AmneziaStyle.color.mutedGray
textFormat: Text.RichText
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: root.footerText !== "" ? 0 : 16
opacity: root.textOpacity
}
ButtonTextType {
text: root.footerText
visible: text !== ""
color: AmneziaStyle.color.mutedGray
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.topMargin: 16
Layout.bottomMargin: 16
opacity: root.textOpacity
}
}
ImageButtonType {
id: rightImage
implicitWidth: 40
implicitHeight: 40
hoverEnabled: false
image: rightImageSource
imageColor: rightImageColor
visible: rightImageSource ? true : false
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.topMargin: 16
Layout.bottomMargin: 16
Layout.rightMargin: 16
Rectangle {
id: rightImageBackground
anchors.fill: parent
radius: 12
color: "transparent"
Behavior on color {
PropertyAnimation { duration: 200 }
}
}
onClicked: {
if (clickedFunction && typeof clickedFunction === "function") {
clickedFunction()
}
}
}
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onEntered: {
backgroundRect.color = root.hoveredColor
if (rightImageSource) {
rightImageBackground.color = rightImage.hoveredColor
}
root.textOpacity = 0.8
}
onExited: {
backgroundRect.color = root.defaultColor
if (rightImageSource) {
rightImageBackground.color = rightImage.defaultColor
}
root.textOpacity = 1
}
onPressedChanged: {
if (rightImageSource) {
rightImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor
}
root.textOpacity = 0.7
}
onClicked: {
root.clicked()
}
}
}

View file

@ -3,32 +3,34 @@ import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Style 1.0
import "TextTypes"
CheckBox {
id: root
property string descriptionText
property string descriptionTextColor: "#878B91"
property string descriptionTextDisabledColor: "#494B50"
property string descriptionTextColor: AmneziaStyle.color.mutedGray
property string descriptionTextDisabledColor: AmneziaStyle.color.charcoalGray
property string textColor: "#D7D8DB"
property string textDisabledColor: "#878B91"
property string textColor: AmneziaStyle.color.paleGray
property string textDisabledColor: AmneziaStyle.color.mutedGray
property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultColor: "transparent"
property string pressedColor: Qt.rgba(1, 1, 1, 0.05)
property string hoveredColor: AmneziaStyle.color.barelyTranslucentWhite
property string defaultColor: AmneziaStyle.color.transparent
property string pressedColor: AmneziaStyle.color.barelyTranslucentWhite
property string defaultBorderColor: "#D7D8DB"
property string checkedBorderColor: "#FBB26A"
property string checkedBorderDisabledColor: "#402102"
property string defaultBorderColor: AmneziaStyle.color.paleGray
property string checkedBorderColor: AmneziaStyle.color.goldenApricot
property string checkedBorderDisabledColor: AmneziaStyle.color.deepBrown
property string borderFocusedColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.paleGray
property string checkedImageColor: "#FBB26A"
property string pressedImageColor: "#A85809"
property string defaultImageColor: "transparent"
property string checkedDisabledImageColor: "#84603D"
property string checkedImageColor: AmneziaStyle.color.goldenApricot
property string pressedImageColor: AmneziaStyle.color.burntOrange
property string defaultImageColor: AmneziaStyle.color.transparent
property string checkedDisabledImageColor: AmneziaStyle.color.mutedBrown
property string imageSource: "qrc:/images/controls/check.svg"
@ -45,8 +47,8 @@ CheckBox {
focusPolicy: Qt.NoFocus
background: Rectangle {
color: "transparent"
border.color: root.focus ? borderFocusedColor : "transparent"
color: AmneziaStyle.color.transparent
border.color: root.focus ? borderFocusedColor : AmneziaStyle.color.transparent
border.width: 1
radius: 16
}
@ -77,7 +79,7 @@ CheckBox {
anchors.centerIn: parent
width: 24
height: 24
color: "transparent"
color: AmneziaStyle.color.transparent
border.color: root.checked ?
(root.enabled ?
checkedBorderColor :

View file

@ -20,7 +20,8 @@ Menu {
MenuItem {
text: qsTr("&Paste")
shortcut: StandardKey.Paste
enabled: textObj.canPaste
// Fix calling paste from clipboard when launching app on android
enabled: Qt.platform.os === "android" ? true : textObj.canPaste
onTriggered: textObj.paste()
}

View file

@ -1,6 +1,8 @@
import QtQuick
import QtQuick.Layouts
import Style 1.0
Rectangle {
Layout.fillWidth: true
@ -8,5 +10,5 @@ Rectangle {
Layout.rightMargin: 16
height: 1
color: "#2C2D30"
color: AmneziaStyle.color.slateGray
}

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Item {
@ -19,8 +21,8 @@ Item {
property Component collapsedContent
property Component expandedContent
property string defaultColor: "#1C1D21"
property string borderColor: "#2C2D30"
property string defaultColor: AmneziaStyle.color.onyxBlack
property string borderColor: AmneziaStyle.color.slateGray
property real expandedHeight
property real collapsedHeight: 0
@ -90,7 +92,7 @@ Item {
id: background
anchors.fill: parent
color: root.isCollapsed ? "transparent" : Qt.rgba(14/255, 14/255, 17/255, 0.8)
color: root.isCollapsed ? AmneziaStyle.color.transparent : Qt.rgba(14/255, 14/255, 17/255, 0.8)
Behavior on color {
PropertyAnimation { duration: 200 }

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
import "../Config"
@ -9,31 +11,31 @@ Item {
id: root
property string text
property string textColor: "#d7d8db"
property string textDisabledColor: "#878B91"
property string textColor: AmneziaStyle.color.paleGray
property string textDisabledColor: AmneziaStyle.color.mutedGray
property int textMaximumLineCount: 2
property int textElide: Qt.ElideRight
property string descriptionText
property string descriptionTextColor: "#878B91"
property string descriptionTextDisabledColor: "#494B50"
property string descriptionTextColor: AmneziaStyle.color.mutedGray
property string descriptionTextDisabledColor: AmneziaStyle.color.charcoalGray
property string headerText
property string headerBackButtonImage
property var rootButtonClickedFunction
property string rootButtonImage: "qrc:/images/controls/chevron-down.svg"
property string rootButtonImageColor: "#D7D8DB"
property string rootButtonBackgroundColor: "#1C1D21"
property string rootButtonBackgroundHoveredColor: "#1C1D21"
property string rootButtonBackgroundPressedColor: "#1C1D21"
property string rootButtonImageColor: AmneziaStyle.color.paleGray
property string rootButtonBackgroundColor: AmneziaStyle.color.onyxBlack
property string rootButtonBackgroundHoveredColor: AmneziaStyle.color.onyxBlack
property string rootButtonBackgroundPressedColor: AmneziaStyle.color.onyxBlack
property string borderFocusedColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderFocusedWidth: 1
property string rootButtonHoveredBorderColor: "#494B50"
property string rootButtonDefaultBorderColor: "#2C2D30"
property string rootButtonPressedBorderColor: "#D7D8DB"
property string rootButtonHoveredBorderColor: AmneziaStyle.color.charcoalGray
property string rootButtonDefaultBorderColor: AmneziaStyle.color.slateGray
property string rootButtonPressedBorderColor: AmneziaStyle.color.paleGray
property int rootButtonTextLeftMargins: 16
property int rootButtonTextTopMargin: 16
@ -75,8 +77,8 @@ Item {
Rectangle {
id: focusBorder
color: "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
color: AmneziaStyle.color.transparent
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent
border.width: root.activeFocus ? root.borderFocusedWidth : 0
anchors.fill: rootButtonContent
radius: 16
@ -96,7 +98,7 @@ Item {
}
return root.hovered ? root.rootButtonBackgroundHoveredColor : root.rootButtonBackgroundColor
} else {
return "transparent"
return AmneziaStyle.color.transparent
}
}

View file

@ -1,6 +1,8 @@
import QtQuick
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Item {
@ -37,7 +39,7 @@ Item {
implicitHeight: 40
image: root.actionButtonImage
imageColor: "#D7D8DB"
imageColor: AmneziaStyle.color.paleGray
visible: image ? true : false
@ -57,7 +59,7 @@ Item {
text: root.descriptionText
color: "#878B91"
color: AmneziaStyle.color.mutedGray
visible: root.descriptionText !== ""
}

View file

@ -1,6 +1,8 @@
import QtQuick
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Item {
@ -46,7 +48,7 @@ Item {
Layout.alignment: Qt.AlignRight
image: root.actionButtonImage
imageColor: "#D7D8DB"
imageColor: AmneziaStyle.color.paleGray
visible: image ? true : false
@ -66,7 +68,7 @@ Item {
text: root.descriptionText
color: "#878B91"
color: AmneziaStyle.color.mutedGray
visible: root.descriptionText !== ""
}

View file

@ -2,24 +2,26 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
RadioButton {
id: root
property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultColor: Qt.rgba(1, 1, 1, 0)
property string checkedColor: Qt.rgba(1, 1, 1, 0)
property string disabledColor: "transparent"
property string hoveredColor: AmneziaStyle.color.barelyTranslucentWhite
property string defaultColor: AmneziaStyle.color.transparent
property string checkedColor: AmneziaStyle.color.transparent
property string disabledColor: AmneziaStyle.color.transparent
property string textColor: "#D7D8DB"
property string textDisabledColor: "#878B91"
property string textColor: AmneziaStyle.color.paleGray
property string textDisabledColor: AmneziaStyle.color.mutedGray
property string pressedBorderColor: "#494B50"
property string checkedBorderColor: "#FBB26A"
property string defaultBodredColor: "transparent"
property string checkedDisabledBorderColor: "#84603D"
property string borderFocusedColor: "#D7D8DB"
property string pressedBorderColor: AmneziaStyle.color.charcoalGray
property string checkedBorderColor: AmneziaStyle.color.goldenApricot
property string defaultBodredColor: AmneziaStyle.color.transparent
property string checkedDisabledBorderColor: AmneziaStyle.color.mutedBrown
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderWidth: 0
implicitWidth: content.implicitWidth

View file

@ -2,23 +2,25 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
Button {
id: root
property string image
property string hoveredColor: Qt.rgba(1, 1, 1, 0.08)
property string defaultColor: "transparent"
property string pressedColor: Qt.rgba(1, 1, 1, 0.12)
property string disableColor: "#2C2D30"
property string hoveredColor: AmneziaStyle.color.translucentWhite
property string defaultColor: AmneziaStyle.color.transparent
property string pressedColor: AmneziaStyle.color.sheerWhite
property string disableColor: AmneziaStyle.color.slateGray
property string imageColor: "#878B91"
property string disableImageColor: "#2C2D30"
property string imageColor: AmneziaStyle.color.mutedGray
property string disableImageColor: AmneziaStyle.color.slateGray
property alias backgroundColor: background.color
property alias backgroundRadius: background.radius
property string borderFocusedColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderFocusedWidth: 1
hoverEnabled: true
@ -46,7 +48,7 @@ Button {
id: background
anchors.fill: parent
border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent
border.width: root.activeFocus ? root.borderFocusedWidth : 0
color: {

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Item {
@ -18,22 +20,23 @@ Item {
property string buttonImageSource
property string rightImageSource
property string leftImageSource
property bool isLeftImageHoverEnabled: true //todo separete this qml file to 3
property bool isLeftImageHoverEnabled: true
property bool isSmallLeftImage: false
property alias rightButton: rightImage
property alias eyeButton: eyeImage
property FlickableType parentFlickable
property string textColor: "#d7d8db"
property string textDisabledColor: "#878B91"
property string descriptionColor: "#878B91"
property string descriptionDisabledColor: "#494B50"
property string textColor: AmneziaStyle.color.paleGray
property string textDisabledColor: AmneziaStyle.color.mutedGray
property string descriptionColor: AmneziaStyle.color.mutedGray
property string descriptionDisabledColor: AmneziaStyle.color.charcoalGray
property real textOpacity: 1.0
property string borderFocusedColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderFocusedWidth: 1
property string rightImageColor: "#d7d8db"
property string rightImageColor: AmneziaStyle.color.paleGray
property bool descriptionOnTop: false
property bool hideDescription: true
@ -112,12 +115,12 @@ Item {
visible: leftImageSource ? true : false
Layout.preferredHeight: rightImageSource || !isLeftImageHoverEnabled ? leftImage.implicitHeight : 56
Layout.preferredWidth: rightImageSource || !isLeftImageHoverEnabled ? leftImage.implicitWidth : 56
Layout.rightMargin: rightImageSource || !isLeftImageHoverEnabled ? 16 : 0
Layout.preferredHeight: (rightImageSource || !isLeftImageHoverEnabled || isSmallLeftImage) ? 40 : 56
Layout.preferredWidth: (rightImageSource || !isLeftImageHoverEnabled || isSmallLeftImage)? 40 : 56
Layout.rightMargin: isSmallLeftImage ? 8 : (rightImageSource || !isLeftImageHoverEnabled) ? 16 : 0
radius: 12
color: "transparent"
color: AmneziaStyle.color.transparent
Behavior on color {
PropertyAnimation { duration: 200 }
@ -220,7 +223,7 @@ Item {
id: eyeImageBackground
anchors.fill: parent
radius: 12
color: "transparent"
color: AmneziaStyle.color.transparent
Behavior on color {
PropertyAnimation { duration: 200 }
@ -257,7 +260,7 @@ Item {
id: rightImageBackground
anchors.fill: parent
radius: 12
color: "transparent"
color: AmneziaStyle.color.transparent
Behavior on color {
PropertyAnimation { duration: 200 }
@ -274,9 +277,9 @@ Item {
Rectangle {
id: background
anchors.fill: root
color: "transparent"
color: AmneziaStyle.color.transparent
border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent
border.width: root.activeFocus ? root.borderFocusedWidth : 0

View file

@ -0,0 +1,38 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
RowLayout {
property string imageSource
property string leftText
property var rightText
property bool isRightTextUndefined: rightText === undefined
visible: !isRightTextUndefined
Image {
Layout.preferredHeight: 18
Layout.preferredWidth: 18
source: imageSource
}
ListItemTitleType {
Layout.fillWidth: true
Layout.rightMargin: 10
Layout.alignment: Qt.AlignRight
text: leftText
}
ParagraphTextType {
visible: rightText !== ""
Layout.alignment: Qt.AlignLeft
text: isRightTextUndefined ? "" : rightText
}
}

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
ListView {
@ -103,8 +105,8 @@ ListView {
indicator: Rectangle {
width: parent.width - 1
height: parent.height
color: radioButton.hovered ? "#2C2D30" : "#1C1D21"
border.color: radioButton.focus ? "#D7D8DB" : "transparent"
color: radioButton.hovered ? AmneziaStyle.color.slateGray : AmneziaStyle.color.onyxBlack
border.color: radioButton.focus ? AmneziaStyle.color.paleGray : AmneziaStyle.color.transparent
border.width: radioButton.focus ? 1 : 0
Behavior on color {

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Popup {
@ -57,7 +59,17 @@ Popup {
horizontalAlignment: Text.AlignLeft
Layout.fillWidth: true
onLinkActivated: function(link) {
Qt.openUrlExternally(link)
}
text: root.text
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
Item {
@ -72,11 +84,11 @@ Popup {
implicitHeight: 32
defaultColor: "white"
hoveredColor: "#C1C2C5"
pressedColor: "#AEB0B7"
disabledColor: "#494B50"
hoveredColor: AmneziaStyle.color.lightGray
pressedColor: AmneziaStyle.color.lightGray
disabledColor: AmneziaStyle.color.charcoalGray
textColor: "#0E0E11"
textColor: AmneziaStyle.color.midnightBlack
borderWidth: 0
text: qsTr("Close")

View file

@ -2,20 +2,22 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
ProgressBar {
id: root
implicitHeight: 4
background: Rectangle {
color: "#633303"
color: AmneziaStyle.color.richBrown
}
contentItem: Item {
Rectangle {
width: root.visualPosition * parent.width
height: parent.height
color: "#FBB26A"
color: AmneziaStyle.color.goldenApricot
}
}
}

View file

@ -2,36 +2,38 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Switch {
id: root
property alias descriptionText: description.text
property string descriptionTextColor: "#878B91"
property string descriptionTextDisabledColor: "#494B50"
property string descriptionTextColor: AmneziaStyle.color.mutedGray
property string descriptionTextDisabledColor: AmneziaStyle.color.charcoalGray
property string textColor: "#D7D8DB"
property string textDisabledColor: "#878B91"
property string textColor: AmneziaStyle.color.paleGray
property string textDisabledColor: AmneziaStyle.color.mutedGray
property string checkedIndicatorColor: "#633303"
property string defaultIndicatorColor: "transparent"
property string checkedDisabledIndicatorColor: "#402102"
property string checkedIndicatorColor: AmneziaStyle.color.richBrown
property string defaultIndicatorColor: AmneziaStyle.color.transparent
property string checkedDisabledIndicatorColor: AmneziaStyle.color.deepBrown
property string borderFocusedColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderFocusedWidth: 1
property string checkedIndicatorBorderColor: "#633303"
property string defaultIndicatorBorderColor: "#494B50"
property string checkedDisabledIndicatorBorderColor: "#402102"
property string checkedIndicatorBorderColor: AmneziaStyle.color.richBrown
property string defaultIndicatorBorderColor: AmneziaStyle.color.charcoalGray
property string checkedDisabledIndicatorBorderColor: AmneziaStyle.color.deepBrown
property string checkedInnerCircleColor: "#FBB26A"
property string defaultInnerCircleColor: "#D7D8DB"
property string checkedDisabledInnerCircleColor: "#84603D"
property string defaultDisabledInnerCircleColor: "#494B50"
property string checkedInnerCircleColor: AmneziaStyle.color.goldenApricot
property string defaultInnerCircleColor: AmneziaStyle.color.paleGray
property string checkedDisabledInnerCircleColor: AmneziaStyle.color.mutedBrown
property string defaultDisabledInnerCircleColor: AmneziaStyle.color.charcoalGray
property string hoveredIndicatorBackgroundColor: Qt.rgba(1, 1, 1, 0.08)
property string defaultIndicatorBackgroundColor: "transparent"
property string hoveredIndicatorBackgroundColor: AmneziaStyle.color.translucentWhite
property string defaultIndicatorBackgroundColor: AmneziaStyle.color.transparent
hoverEnabled: enabled ? true : false
focusPolicy: Qt.TabFocus

View file

@ -1,16 +1,18 @@
import QtQuick
import QtQuick.Controls
import Style 1.0
TabButton {
id: root
property string hoveredColor: "#633303"
property string defaultColor: "#2C2D30"
property string selectedColor: "#FBB26A"
property string hoveredColor: AmneziaStyle.color.richBrown
property string defaultColor: AmneziaStyle.color.slateGray
property string selectedColor: AmneziaStyle.color.goldenApricot
property string textColor: "#D7D8DB"
property string textColor: AmneziaStyle.color.paleGray
property string borderFocusedColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderFocusedWidth: 1
property bool isSelected: false
@ -24,9 +26,9 @@ TabButton {
id: background
anchors.fill: parent
color: "transparent"
color: AmneziaStyle.color.transparent
border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent
border.width: root.activeFocus ? root.borderFocusedWidth : 0
Rectangle {

View file

@ -1,18 +1,20 @@
import QtQuick
import QtQuick.Controls
import Style 1.0
TabButton {
id: root
property string hoveredColor: "#633303"
property string defaultColor: "#D7D8DB"
property string selectedColor: "#FBB26A"
property string hoveredColor: AmneziaStyle.color.richBrown
property string defaultColor: AmneziaStyle.color.paleGray
property string selectedColor: AmneziaStyle.color.goldenApricot
property string image
property bool isSelected: false
property string borderFocusedColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderFocusedWidth: 1
property var clickedFunc
@ -26,10 +28,10 @@ TabButton {
background: Rectangle {
id: background
anchors.fill: parent
color: "transparent"
color: AmneziaStyle.color.transparent
radius: 10
border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent
border.width: root.activeFocus ? root.borderFocusedWidth : 0
}

View file

@ -1,6 +1,8 @@
import QtQuick
import QtQuick.Controls
import Style 1.0
Rectangle {
id: root
@ -9,12 +11,12 @@ Rectangle {
property alias textArea: textArea
property alias textAreaText: textArea.text
property string borderHoveredColor: "#494B50"
property string borderNormalColor: "#2C2D30"
property string borderFocusedColor: "#d7d8db"
property string borderHoveredColor: AmneziaStyle.color.charcoalGray
property string borderNormalColor: AmneziaStyle.color.slateGray
property string borderFocusedColor: AmneziaStyle.color.paleGray
height: 148
color: "#1C1D21"
color: AmneziaStyle.color.onyxBlack
border.width: 1
border.color: getBorderColor(borderNormalColor)
radius: 16
@ -52,10 +54,10 @@ Rectangle {
anchors.topMargin: 16
anchors.bottomMargin: 16
color: "#D7D8DB"
selectionColor: "#633303"
selectedTextColor: "#D7D8DB"
placeholderTextColor: "#878B91"
color: AmneziaStyle.color.paleGray
selectionColor: AmneziaStyle.color.richBrown
selectedTextColor: AmneziaStyle.color.paleGray
placeholderTextColor: AmneziaStyle.color.mutedGray
font.pixelSize: 16
font.weight: Font.Medium

View file

@ -0,0 +1,183 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Rectangle {
id: root
property string placeholderText
property string text
property string headerText
property alias textArea: textArea
property alias textAreaText: textArea.text
property string borderHoveredColor: AmneziaStyle.color.charcoalGray
property string borderNormalColor: AmneziaStyle.color.slateGray
property string borderFocusedColor: AmneziaStyle.color.paleGray
property string firstButtonImage
property string secondButtonImage
property var firstButtonClickedFunc
property var secondButtonClickedFunc
height: 148
color: AmneziaStyle.color.onyxBlack
border.width: 1
border.color: getBorderColor(borderNormalColor)
radius: 16
property FlickableType parentFlickable: null
onFocusChanged: {
if (root.activeFocus) {
if (root.parentFlickable) {
root.parentFlickable.ensureVisible(root)
}
}
}
MouseArea {
id: parentMouse
anchors.fill: parent
cursorShape: Qt.IBeamCursor
onClicked: textArea.forceActiveFocus()
hoverEnabled: true
ColumnLayout {
anchors.fill: parent
anchors.margins: 16
spacing: 0
LabelTextType {
Layout.fillWidth: true
text: root.headerText
}
TextArea {
id: textArea
Layout.fillWidth: true
Layout.fillHeight: true
leftPadding: 0
Layout.bottomMargin: 16
color: AmneziaStyle.color.paleGray
selectionColor: AmneziaStyle.color.richBrown
selectedTextColor: AmneziaStyle.color.paleGray
placeholderTextColor: AmneziaStyle.color.mutedGray
font.pixelSize: 16
font.weight: Font.Medium
font.family: "PT Root UI VF"
placeholderText: root.placeholderText
text: root.text
KeyNavigation.tab: firstButton
onCursorVisibleChanged: {
if (textArea.cursorVisible) {
fl.interactive = true
} else {
fl.interactive = false
}
}
wrapMode: Text.Wrap
MouseArea {
id: textAreaMouse
anchors.fill: parent
acceptedButtons: Qt.RightButton
hoverEnabled: true
onClicked: {
fl.interactive = true
contextMenu.open()
}
}
onFocusChanged: {
root.border.color = getBorderColor(borderNormalColor)
}
ContextMenuType {
id: contextMenu
textObj: textArea
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: -8
spacing: 0
ImageButtonType {
id: firstButton
visible: root.firstButtonImage !== ""
imageColor: AmneziaStyle.color.paleGray
image: root.firstButtonImage
onClicked: function() {
if (root.firstButtonClickedFunc && typeof root.firstButtonClickedFunc === "function") {
root.firstButtonClickedFunc()
}
}
}
ImageButtonType {
id: secondButton
visible: root.secondButtonImage !== ""
imageColor: AmneziaStyle.color.paleGray
image: root.secondButtonImage
onClicked: function() {
if (root.secondButtonClickedFunc && typeof root.secondButtonClickedFunc === "function") {
root.secondButtonClickedFunc()
}
}
}
Item {
Layout.fillWidth: true
}
ImageButtonType {
id: resetButton
imageColor: AmneziaStyle.color.paleGray
visible: root.textAreaText !== ""
image: "qrc:/images/controls/close.svg"
onClicked: function() {
root.textAreaText = ""
textArea.focus = true
}
}
}
}
onPressed: {
root.border.color = getBorderColor(borderFocusedColor)
}
onExited: {
root.border.color = getBorderColor(borderNormalColor)
}
onEntered: {
root.border.color = getBorderColor(borderHoveredColor)
}
}
function getBorderColor(noneFocusedColor) {
return textArea.focus ? root.borderFocusedColor : noneFocusedColor
}
}

View file

@ -2,14 +2,16 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Style 1.0
import "TextTypes"
Item {
id: root
property string headerText
property string headerTextDisabledColor: "#494B50"
property string headerTextColor: "#878b91"
property string headerTextDisabledColor: AmneziaStyle.color.charcoalGray
property string headerTextColor: AmneziaStyle.color.mutedGray
property alias errorText: errorField.text
property bool checkEmptyText: false
@ -21,18 +23,18 @@ Item {
property alias textField: textField
property alias textFieldText: textField.text
property string textFieldTextColor: "#d7d8db"
property string textFieldTextDisabledColor: "#878B91"
property string textFieldTextColor: AmneziaStyle.color.paleGray
property string textFieldTextDisabledColor: AmneziaStyle.color.mutedGray
property string textFieldPlaceholderText
property bool textFieldEditable: true
property string borderColor: "#2C2D30"
property string borderFocusedColor: "#d7d8db"
property string borderColor: AmneziaStyle.color.slateGray
property string borderFocusedColor: AmneziaStyle.color.paleGray
property string backgroundColor: "#1c1d21"
property string backgroundDisabledColor: "transparent"
property string bgBorderHoveredColor: "#494B50"
property string backgroundColor: AmneziaStyle.color.onyxBlack
property string backgroundDisabledColor: AmneziaStyle.color.transparent
property string bgBorderHoveredColor: AmneziaStyle.color.charcoalGray
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight
@ -90,10 +92,10 @@ Item {
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
placeholderText: root.textFieldPlaceholderText
placeholderTextColor: "#494B50"
placeholderTextColor: AmneziaStyle.color.charcoalGray
selectionColor: "#633303"
selectedTextColor: "#D7D8DB"
selectionColor: AmneziaStyle.color.richBrown
selectedTextColor: AmneziaStyle.color.paleGray
font.pixelSize: 16
font.weight: 400
@ -147,7 +149,9 @@ Item {
text: root.errorText
visible: root.errorText !== ""
color: "#EB5757"
color: AmneziaStyle.color.vibrantRed
Layout.fillWidth: true
}
}

View file

@ -1,10 +1,12 @@
import QtQuick
import Style 1.0
Text {
lineHeight: 24
lineHeightMode: Text.FixedHeight
color: "#D7D8DB"
color: AmneziaStyle.color.paleGray
font.pixelSize: 16
font.weight: 600
font.family: "PT Root UI VF"

View file

@ -1,10 +1,12 @@
import QtQuick
import Style 1.0
Text {
lineHeight: 16 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight
color: "#0E0E11"
color: AmneziaStyle.color.midnightBlack
font.pixelSize: 13
font.weight: 400
font.family: "PT Root UI VF"

View file

@ -1,14 +1,16 @@
import QtQuick
import Style 1.0
Text {
lineHeight: 38 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight
color: "#D7D8DB"
font.pixelSize: 36
color: AmneziaStyle.color.paleGray
font.pixelSize: 32
font.weight: 700
font.family: "PT Root UI VF"
font.letterSpacing: -1.08
font.letterSpacing: -1.0
wrapMode: Text.WordWrap
}

View file

@ -1,10 +1,12 @@
import QtQuick
import Style 1.0
Text {
lineHeight: 30 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight
color: "#D7D8DB"
color: AmneziaStyle.color.paleGray
font.pixelSize: 25
font.weight: 700
font.family: "PT Root UI VF"

View file

@ -1,10 +1,12 @@
import QtQuick
import Style 1.0
Text {
lineHeight: 16 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight
color: "#878B91"
color: AmneziaStyle.color.mutedGray
font.pixelSize: 13
font.weight: 400
font.family: "PT Root UI VF"

View file

@ -1,10 +1,12 @@
import QtQuick
import Style 1.0
Text {
lineHeight: 21.6 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight
color: "#D7D8DB"
color: AmneziaStyle.color.paleGray
font.pixelSize: 18
font.weight: 400
font.family: "PT Root UI VF"

View file

@ -1,10 +1,11 @@
import QtQuick
import Style 1.0
Text {
lineHeight: 24 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight
color: "#D7D8DB"
color: AmneziaStyle.color.paleGray
font.pixelSize: 16
font.weight: 400
font.family: "PT Root UI VF"

View file

@ -1,10 +1,12 @@
import QtQuick
import Style 1.0
Text {
lineHeight: 20 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight
color: "#D7D8DB"
color: AmneziaStyle.color.paleGray
font.pixelSize: 14
font.weight: 400
font.family: "PT Root UI VF"

View file

@ -18,14 +18,14 @@ Popup {
}
background: Rectangle {
color: "transparent"
color: AmneziaStyle.color.transparent
}
ImageButtonType {
id: button
image: "qrc:/images/svg/close_black_24dp.svg"
imageColor: "#D7D8DB"
imageColor: AmneziaStyle.color.paleGray
implicitWidth: 40
implicitHeight: 40

View file

@ -3,6 +3,8 @@ import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Style 1.0
import "TextTypes"
RadioButton {
@ -12,15 +14,15 @@ RadioButton {
property int textElide: Qt.ElideRight
property string descriptionText
property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultColor: Qt.rgba(1, 1, 1, 0)
property string disabledColor: Qt.rgba(1, 1, 1, 0)
property string selectedColor: Qt.rgba(1, 1, 1, 0)
property string hoveredColor: AmneziaStyle.color.barelyTranslucentWhite
property string defaultColor: AmneziaStyle.color.transparent
property string disabledColor: AmneziaStyle.color.transparent
property string selectedColor: AmneziaStyle.color.transparent
property string textColor: "#D7D8DB"
property string selectedTextColor: "#FBB26A"
property string textColor: AmneziaStyle.color.paleGray
property string selectedTextColor: AmneziaStyle.color.goldenApricot
property string borderFocusedColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.paleGray
property int borderFocusedWidth: 1
property string imageSource
@ -34,7 +36,7 @@ RadioButton {
anchors.verticalCenter: parent.verticalCenter
border.color: root.focus ? root.borderFocusedColor : "transparent"
border.color: root.focus ? root.borderFocusedColor : AmneziaStyle.color.transparent
border.width: root.focus ? root.borderFocusedWidth : 0
implicitWidth: 56
@ -137,7 +139,7 @@ RadioButton {
CaptionTextType {
id: description
color: "#878B91"
color: AmneziaStyle.color.mutedGray
text: root.descriptionText
visible: root.descriptionText !== ""

View file

@ -3,14 +3,16 @@ import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Style 1.0
import "TextTypes"
Rectangle {
id: root
property string textColor: "#D7D8DB"
property string backGroundColor: "#1C1D21"
property string imageColor: "#D7D8DB"
property string textColor: AmneziaStyle.color.paleGray
property string backGroundColor: AmneziaStyle.color.onyxBlack
property string imageColor: AmneziaStyle.color.paleGray
property string textString
property int textFormat: Text.PlainText

View file

@ -0,0 +1,26 @@
pragma Singleton
import QtQuick
QtObject {
property QtObject color: QtObject {
readonly property color transparent: 'transparent'
readonly property color paleGray: '#D7D8DB'
readonly property color lightGray: '#C1C2C5'
readonly property color mutedGray: '#878B91'
readonly property color charcoalGray: '#494B50'
readonly property color slateGray: '#2C2D30'
readonly property color onyxBlack: '#1C1D21'
readonly property color midnightBlack: '#0E0E11'
readonly property color goldenApricot: '#FBB26A'
readonly property color burntOrange: '#A85809'
readonly property color mutedBrown: '#84603D'
readonly property color richBrown: '#633303'
readonly property color deepBrown: '#402102'
readonly property color vibrantRed: '#EB5757'
readonly property color darkCharcoal: '#261E1A'
readonly property color sheerWhite: Qt.rgba(1, 1, 1, 0.12)
readonly property color translucentWhite: Qt.rgba(1, 1, 1, 0.08)
readonly property color barelyTranslucentWhite: Qt.rgba(1, 1, 1, 0.05)
}
}

View file

@ -0,0 +1,3 @@
module Style
singleton AmneziaStyle 1.0 AmneziaStyle.qml

View file

@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"

View file

@ -0,0 +1,109 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
BackButtonType {
id: backButton
// KeyNavigation.tab: removeButton
}
}
FlickableType {
id: fl
anchors.top: backButtonLayout.bottom
anchors.bottom: parent.bottom
contentHeight: content.implicitHeight
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
HeaderType {
id: header
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
headerText: "Dev menu"
}
TextFieldWithHeaderType {
id: passwordTextField
Layout.fillWidth: true
Layout.topMargin: 16
Layout.rightMargin: 16
Layout.leftMargin: 16
parentFlickable: fl
headerText: qsTr("Gateway endpoint")
textFieldText: SettingsController.gatewayEndpoint
buttonImageSource: textFieldText !== "" ? "qrc:/images/controls/refresh-cw.svg" : ""
clickedFunc: function() {
SettingsController.resetGatewayEndpoint()
}
textField.onEditingFinished: {
textFieldText = textField.text.replace(/^\s+|\s+$/g, '')
if (textFieldText !== SettingsController.gatewayEndpoint) {
SettingsController.gatewayEndpoint = textFieldText
}
}
// KeyNavigation.tab: saveButton
}
SwitcherType {
id: switcher
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.topMargin: 16
text: qsTr("Dev gateway environment")
checked: SettingsController.isDevGatewayEnv
onToggled: function() {
SettingsController.isDevGatewayEnv = checked
}
}
}
}
}

View file

@ -8,6 +8,7 @@ import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerProps 1.0
import ContainersModelFilters 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -55,11 +56,11 @@ PageType {
implicitHeight: 36
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#878B91"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.mutedGray
borderWidth: 0
visible: isLoggingEnabled ? true : false
@ -84,6 +85,7 @@ PageType {
BasicButtonType {
id: splitTunnelingButton
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: 34
leftPadding: 16
@ -91,16 +93,20 @@ PageType {
implicitHeight: 36
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#878B91"
leftImageColor: "transparent"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.mutedGray
leftImageColor: AmneziaStyle.color.transparent
borderWidth: 0
buttonTextLabel.lineHeight: 20
buttonTextLabel.font.pixelSize: 14
buttonTextLabel.font.weight: 500
property bool isSplitTunnelingEnabled: SitesModel.isTunnelingEnabled || AppSplitTunnelingModel.isTunnelingEnabled ||
(ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi"))
ServersModel.isDefaultServerDefaultContainerHasSplitTunneling
text: isSplitTunnelingEnabled ? qsTr("Split tunneling enabled") : qsTr("Split tunneling disabled")
@ -237,7 +243,7 @@ PageType {
hoverEnabled: false
image: "qrc:/images/controls/chevron-down.svg"
imageColor: "#d7d8db"
imageColor: AmneziaStyle.color.paleGray
icon.width: 18
icon.height: 18
@ -259,11 +265,21 @@ PageType {
}
}
LabelTextType {
id: collapsedServerMenuDescription
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44
RowLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44
spacing: 0
Image {
Layout.rightMargin: 8
visible: source !== ""
source: ServersModel.defaultServerImagePathCollapsed
}
LabelTextType {
id: collapsedServerMenuDescription
text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded
}
}
}
@ -298,17 +314,17 @@ PageType {
DropDownType {
id: containersDropDown
rootButtonImageColor: "#0E0E11"
rootButtonBackgroundColor: "#D7D8DB"
rootButtonImageColor: AmneziaStyle.color.midnightBlack
rootButtonBackgroundColor: AmneziaStyle.color.paleGray
rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8)
rootButtonBackgroundPressedColor: Qt.rgba(215, 216, 219, 0.65)
rootButtonHoveredBorderColor: "transparent"
rootButtonDefaultBorderColor: "transparent"
rootButtonHoveredBorderColor: AmneziaStyle.color.transparent
rootButtonDefaultBorderColor: AmneziaStyle.color.transparent
rootButtonTextTopMargin: 8
rootButtonTextBottomMargin: 8
text: ServersModel.defaultServerDefaultContainerName
textColor: "#0E0E11"
textColor: AmneziaStyle.color.midnightBlack
headerText: qsTr("VPN protocol")
headerBackButtonImage: "qrc:/images/controls/arrow-left.svg"
@ -499,7 +515,7 @@ PageType {
ImageButtonType {
id: serverInfoButton
image: "qrc:/images/controls/settings.svg"
imageColor: "#D7D8DB"
imageColor: AmneziaStyle.color.paleGray
implicitWidth: 56
implicitHeight: 56

View file

@ -0,0 +1,312 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview.currentItem.mtuTextField.textField
Item {
id: focusItem
onFocusChanged: {
if (activeFocus) {
fl.ensureVisible(focusItem)
}
}
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
BackButtonType {
id: backButton
KeyNavigation.tab: listview.currentItem.mtuTextField.textField
}
}
FlickableType {
id: fl
anchors.top: backButtonLayout.bottom
anchors.bottom: parent.bottom
contentHeight: content.implicitHeight + saveButton.implicitHeight + saveButton.anchors.bottomMargin + saveButton.anchors.topMargin
Column {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
ListView {
id: listview
width: parent.width
height: listview.contentItem.height
clip: true
interactive: false
model: AwgConfigModel
delegate: Item {
id: delegateItem
implicitWidth: listview.width
implicitHeight: col.implicitHeight
property alias mtuTextField: mtuTextField
property bool isSaveButtonEnabled: mtuTextField.errorText === "" &&
junkPacketMaxSizeTextField.errorText === "" &&
junkPacketMinSizeTextField.errorText === "" &&
junkPacketCountTextField.errorText === ""
ColumnLayout {
id: col
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.rightMargin: 16
spacing: 0
HeaderType {
Layout.fillWidth: true
headerText: qsTr("AmneziaWG settings")
}
TextFieldWithHeaderType {
id: mtuTextField
Layout.fillWidth: true
Layout.topMargin: 40
headerText: qsTr("MTU")
textFieldText: clientMtu
textField.validator: IntValidator { bottom: 576; top: 65535 }
textField.onEditingFinished: {
if (textFieldText !== clientMtu) {
clientMtu = textFieldText
}
}
checkEmptyText: true
KeyNavigation.tab: junkPacketCountTextField.textField
}
TextFieldWithHeaderType {
id: junkPacketCountTextField
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "Jc - Junk packet count"
textFieldText: clientJunkPacketCount
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== clientJunkPacketCount) {
clientJunkPacketCount = textFieldText
}
}
checkEmptyText: true
KeyNavigation.tab: junkPacketMinSizeTextField.textField
}
TextFieldWithHeaderType {
id: junkPacketMinSizeTextField
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "Jmin - Junk packet minimum size"
textFieldText: clientJunkPacketMinSize
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== clientJunkPacketMinSize) {
clientJunkPacketMinSize = textFieldText
}
}
checkEmptyText: true
KeyNavigation.tab: junkPacketMaxSizeTextField.textField
}
TextFieldWithHeaderType {
id: junkPacketMaxSizeTextField
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "Jmax - Junk packet maximum size"
textFieldText: clientJunkPacketMaxSize
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== clientJunkPacketMaxSize) {
clientJunkPacketMaxSize = textFieldText
}
}
checkEmptyText: true
Keys.onTabPressed: saveButton.forceActiveFocus()
}
Header2TextType {
Layout.fillWidth: true
Layout.topMargin: 16
text: qsTr("Server settings")
}
TextFieldWithHeaderType {
id: portTextField
Layout.fillWidth: true
Layout.topMargin: 8
enabled: false
headerText: qsTr("Port")
textFieldText: port
}
TextFieldWithHeaderType {
id: initPacketJunkSizeTextField
Layout.fillWidth: true
Layout.topMargin: 16
enabled: false
headerText: "S1 - Init packet junk size"
textFieldText: serverInitPacketJunkSize
}
TextFieldWithHeaderType {
id: responsePacketJunkSizeTextField
Layout.fillWidth: true
Layout.topMargin: 16
enabled: false
headerText: "S2 - Response packet junk size"
textFieldText: serverResponsePacketJunkSize
}
TextFieldWithHeaderType {
id: initPacketMagicHeaderTextField
Layout.fillWidth: true
Layout.topMargin: 16
enabled: false
headerText: "H1 - Init packet magic header"
textFieldText: serverInitPacketMagicHeader
}
TextFieldWithHeaderType {
id: responsePacketMagicHeaderTextField
Layout.fillWidth: true
Layout.topMargin: 16
enabled: false
headerText: "H2 - Response packet magic header"
textFieldText: serverResponsePacketMagicHeader
}
TextFieldWithHeaderType {
id: underloadPacketMagicHeaderTextField
Layout.fillWidth: true
Layout.topMargin: 16
parentFlickable: fl
enabled: false
headerText: "H3 - Underload packet magic header"
textFieldText: serverUnderloadPacketMagicHeader
}
TextFieldWithHeaderType {
id: transportPacketMagicHeaderTextField
Layout.fillWidth: true
Layout.topMargin: 16
enabled: false
headerText: "H4 - Transport packet magic header"
textFieldText: serverTransportPacketMagicHeader
}
}
}
}
}
}
BasicButtonType {
id: saveButton
anchors.right: root.right
anchors.left: root.left
anchors.bottom: root.bottom
anchors.topMargin: 24
anchors.bottomMargin: 24
anchors.rightMargin: 16
anchors.leftMargin: 16
enabled: listview.currentItem.isSaveButtonEnabled
text: qsTr("Save")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
forceActiveFocus()
var headerText = qsTr("Save settings?")
var descriptionText = qsTr("Only the settings for this device will be changed")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.updateContainer(AwgConfigModel.getConfig())
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
saveButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
}

View file

@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -56,8 +57,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
enabled: ServersModel.isProcessedServerHasWriteAccess()
ListView {
id: listview
@ -70,12 +69,12 @@ PageType {
model: AwgConfigModel
delegate: Item {
id: _delegate
id: delegateItem
implicitWidth: listview.width
implicitHeight: col.implicitHeight
property alias portTextField:portTextField
property alias portTextField: portTextField
property bool isEnabled: ServersModel.isProcessedServerHasWriteAccess()
ColumnLayout {
id: col
@ -100,6 +99,8 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 40
enabled: delegateItem.isEnabled
headerText: qsTr("Port")
textFieldText: port
textField.maximumLength: 5
@ -114,27 +115,6 @@ PageType {
checkEmptyText: true
KeyNavigation.tab: mtuTextField.textField
}
TextFieldWithHeaderType {
id: mtuTextField
Layout.fillWidth: true
Layout.topMargin: 16
headerText: qsTr("MTU")
textFieldText: mtu
textField.validator: IntValidator { bottom: 576; top: 65535 }
textField.onEditingFinished: {
if (textFieldText === "") {
textFieldText = "0"
}
if (textFieldText !== mtu) {
mtu = textFieldText
}
}
checkEmptyText: true
KeyNavigation.tab: junkPacketCountTextField.textField
}
@ -143,8 +123,8 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "Jc - Junk packet count"
textFieldText: junkPacketCount
headerText: qsTr("Jc - Junk packet count")
textFieldText: serverJunkPacketCount
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
@ -153,8 +133,8 @@ PageType {
textFieldText = "0"
}
if (textFieldText !== junkPacketCount) {
junkPacketCount = textFieldText
if (textFieldText !== serverJunkPacketCount) {
serverJunkPacketCount = textFieldText
}
}
@ -168,14 +148,14 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "Jmin - Junk packet minimum size"
textFieldText: junkPacketMinSize
headerText: qsTr("Jmin - Junk packet minimum size")
textFieldText: serverJunkPacketMinSize
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== junkPacketMinSize) {
junkPacketMinSize = textFieldText
if (textFieldText !== serverJunkPacketMinSize) {
serverJunkPacketMinSize = textFieldText
}
}
@ -189,14 +169,14 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "Jmax - Junk packet maximum size"
textFieldText: junkPacketMaxSize
headerText: qsTr("Jmax - Junk packet maximum size")
textFieldText: serverJunkPacketMaxSize
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== junkPacketMaxSize) {
junkPacketMaxSize = textFieldText
if (textFieldText !== serverJunkPacketMaxSize) {
serverJunkPacketMaxSize = textFieldText
}
}
@ -210,14 +190,14 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "S1 - Init packet junk size"
textFieldText: initPacketJunkSize
headerText: qsTr("S1 - Init packet junk size")
textFieldText: serverInitPacketJunkSize
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== initPacketJunkSize) {
initPacketJunkSize = textFieldText
if (textFieldText !== serverInitPacketJunkSize) {
serverInitPacketJunkSize = textFieldText
}
}
@ -231,14 +211,14 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "S2 - Response packet junk size"
textFieldText: responsePacketJunkSize
headerText: qsTr("S2 - Response packet junk size")
textFieldText: serverResponsePacketJunkSize
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== responsePacketJunkSize) {
responsePacketJunkSize = textFieldText
if (textFieldText !== serverResponsePacketJunkSize) {
serverResponsePacketJunkSize = textFieldText
}
}
@ -252,14 +232,14 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "H1 - Init packet magic header"
textFieldText: initPacketMagicHeader
headerText: qsTr("H1 - Init packet magic header")
textFieldText: serverInitPacketMagicHeader
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== initPacketMagicHeader) {
initPacketMagicHeader = textFieldText
if (textFieldText !== serverInitPacketMagicHeader) {
serverInitPacketMagicHeader = textFieldText
}
}
@ -273,14 +253,14 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "H2 - Response packet magic header"
textFieldText: responsePacketMagicHeader
headerText: qsTr("H2 - Response packet magic header")
textFieldText: serverResponsePacketMagicHeader
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== responsePacketMagicHeader) {
responsePacketMagicHeader = textFieldText
if (textFieldText !== serverResponsePacketMagicHeader) {
serverResponsePacketMagicHeader = textFieldText
}
}
@ -294,14 +274,14 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
headerText: "H4 - Transport packet magic header"
textFieldText: transportPacketMagicHeader
headerText: qsTr("H4 - Transport packet magic header")
textFieldText: serverTransportPacketMagicHeader
textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl
textField.onEditingFinished: {
if (textFieldText !== transportPacketMagicHeader) {
transportPacketMagicHeader = textFieldText
if (textFieldText !== serverTransportPacketMagicHeader) {
serverTransportPacketMagicHeader = textFieldText
}
}
@ -316,13 +296,13 @@ PageType {
Layout.topMargin: 16
parentFlickable: fl
headerText: "H3 - Underload packet magic header"
textFieldText: underloadPacketMagicHeader
headerText: qsTr("H3 - Underload packet magic header")
textFieldText: serverUnderloadPacketMagicHeader
textField.validator: IntValidator { bottom: 0 }
textField.onEditingFinished: {
if (textFieldText !== underloadPacketMagicHeader) {
underloadPacketMagicHeader = textFieldText
if (textFieldText !== serverUnderloadPacketMagicHeader) {
serverUnderloadPacketMagicHeader = textFieldText
}
}
@ -355,18 +335,22 @@ PageType {
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
if (AwgConfigModel.isHeadersEqual(underloadPacketMagicHeaderTextField.textField.text,
transportPacketMagicHeaderTextField.textField.text,
responsePacketMagicHeaderTextField.textField.text,
initPacketMagicHeaderTextField.textField.text)) {
PageController.showErrorMessage(qsTr("The values of the H1-H4 fields must be unique"))
return
}
forceActiveFocus()
if (AwgConfigModel.isPacketSizeEqual(parseInt(initPacketJunkSizeTextField.textField.text),
parseInt(responsePacketJunkSizeTextField.textField.text))) {
PageController.showErrorMessage(qsTr("The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92)"))
return
if (delegateItem.isEnabled) {
if (AwgConfigModel.isHeadersEqual(underloadPacketMagicHeaderTextField.textField.text,
transportPacketMagicHeaderTextField.textField.text,
responsePacketMagicHeaderTextField.textField.text,
initPacketMagicHeaderTextField.textField.text)) {
PageController.showErrorMessage(qsTr("The values of the H1-H4 fields must be unique"))
return
}
if (AwgConfigModel.isPacketSizeEqual(parseInt(initPacketJunkSizeTextField.textField.text),
parseInt(responsePacketJunkSizeTextField.textField.text))) {
PageController.showErrorMessage(qsTr("The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92)"))
return
}
}
var headerText = qsTr("Save settings?")
@ -375,8 +359,6 @@ PageType {
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
forceActiveFocus()
if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return

View file

@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"

View file

@ -6,6 +6,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -294,7 +295,7 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 32
Layout.preferredHeight: checkboxLayout.implicitHeight
color: "#1C1D21"
color: AmneziaStyle.color.onyxBlack
radius: 16
Connections {

View file

@ -8,6 +8,7 @@ import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -191,9 +192,9 @@ PageType {
leftPadding: 0
height: 24
color: "#D7D8DB"
selectionColor: "#633303"
selectedTextColor: "#D7D8DB"
color: AmneziaStyle.color.paleGray
selectionColor: AmneziaStyle.color.richBrown
selectedTextColor: AmneziaStyle.color.paleGray
font.pixelSize: 16
font.weight: Font.Medium
@ -204,7 +205,7 @@ PageType {
wrapMode: Text.Wrap
background: Rectangle {
color: "transparent"
color: AmneziaStyle.color.transparent
}
}
}
@ -223,7 +224,7 @@ PageType {
visible: ServersModel.isProcessedServerHasWriteAccess()
text: qsTr("Remove ") + ContainersModel.getProcessedContainerName()
textColor: "#EB5757"
textColor: AmneziaStyle.color.vibrantRed
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunction: function() {

View file

@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -92,7 +93,7 @@ PageType {
HeaderType {
Layout.fillWidth: true
headerText: qsTr("ShadowSocks settings")
headerText: qsTr("Shadowsocks settings")
}
TextFieldWithHeaderType {

View file

@ -0,0 +1,179 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview.currentItem.mtuTextField.textField
Item {
id: focusItem
onFocusChanged: {
if (activeFocus) {
fl.ensureVisible(focusItem)
}
}
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
BackButtonType {
id: backButton
KeyNavigation.tab: listview.currentItem.mtuTextField.textField
}
}
FlickableType {
id: fl
anchors.top: backButtonLayout.bottom
anchors.bottom: parent.bottom
contentHeight: content.implicitHeight + saveButton.implicitHeight + saveButton.anchors.bottomMargin + saveButton.anchors.topMargin
Column {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
ListView {
id: listview
width: parent.width
height: listview.contentItem.height
clip: true
interactive: false
model: WireGuardConfigModel
delegate: Item {
id: delegateItem
implicitWidth: listview.width
implicitHeight: col.implicitHeight
property alias mtuTextField: mtuTextField
property bool isSaveButtonEnabled: mtuTextField.errorText === ""
ColumnLayout {
id: col
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.rightMargin: 16
spacing: 0
HeaderType {
Layout.fillWidth: true
headerText: qsTr("WG settings")
}
TextFieldWithHeaderType {
id: mtuTextField
Layout.fillWidth: true
Layout.topMargin: 40
headerText: qsTr("MTU")
textFieldText: clientMtu
textField.validator: IntValidator { bottom: 576; top: 65535 }
textField.onEditingFinished: {
if (textFieldText !== clientMtu) {
clientMtu = textFieldText
}
}
checkEmptyText: true
KeyNavigation.tab: saveButton
}
Header2TextType {
Layout.fillWidth: true
Layout.topMargin: 16
text: qsTr("Server settings")
}
TextFieldWithHeaderType {
id: portTextField
Layout.fillWidth: true
Layout.topMargin: 8
enabled: false
headerText: qsTr("Port")
textFieldText: port
}
}
}
}
}
}
BasicButtonType {
id: saveButton
anchors.right: root.right
anchors.left: root.left
anchors.bottom: root.bottom
anchors.topMargin: 24
anchors.bottomMargin: 24
anchors.rightMargin: 16
anchors.leftMargin: 16
enabled: listview.currentItem.isSaveButtonEnabled
text: qsTr("Save")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
forceActiveFocus()
var headerText = qsTr("Save settings?")
var descriptionText = qsTr("Only the settings for this device will be changed")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.updateContainer(WireGuardConfigModel.getConfig())
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
saveButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
}

View file

@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -71,7 +72,10 @@ PageType {
}
delegate: Item {
id: delegateItem
property alias focusItemId: portTextField.textField
property bool isEnabled: ServersModel.isProcessedServerHasWriteAccess()
implicitWidth: listview.width
implicitHeight: col.implicitHeight
@ -98,12 +102,14 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 40
enabled: delegateItem.isEnabled
headerText: qsTr("Port")
textFieldText: port
textField.maximumLength: 5
textField.validator: IntValidator { bottom: 1; top: 65535 }
KeyNavigation.tab: mtuTextField.textField
KeyNavigation.tab: saveButton
textField.onEditingFinished: {
if (textFieldText !== port) {
@ -114,52 +120,41 @@ PageType {
checkEmptyText: true
}
TextFieldWithHeaderType {
id: mtuTextField
Layout.fillWidth: true
Layout.topMargin: 16
headerText: qsTr("MTU")
textFieldText: mtu
textField.validator: IntValidator { bottom: 576; top: 65535 }
KeyNavigation.tab: saveButton
textField.onEditingFinished: {
if (textFieldText === "") {
textFieldText = "0"
}
if (textFieldText !== mtu) {
mtu = textFieldText
}
}
checkEmptyText: true
}
BasicButtonType {
id: saveButton
Layout.fillWidth: true
Layout.topMargin: 24
Layout.bottomMargin: 24
enabled: mtuTextField.errorText === "" &&
portTextField.errorText === ""
enabled: portTextField.errorText === ""
text: qsTr("Save")
Keys.onTabPressed: lastItemTabClicked(focusItem)
onClicked: {
onClicked: function() {
forceActiveFocus()
if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return
}
var headerText = qsTr("Save settings?")
var descriptionText = qsTr("All users with whom you shared a connection with will no longer be able to connect to it.")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.updateContainer(WireGuardConfigModel.getConfig())
focusItem.forceActiveFocus()
var yesButtonFunction = function() {
if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.updateContainer(WireGuardConfigModel.getConfig())
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
saveRestartButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
Keys.onEnterPressed: saveButton.clicked()

View file

@ -6,6 +6,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerEnum 1.0
import Style 1.0
import "./"
import "../Controls2"

View file

@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -57,7 +58,7 @@ PageType {
Layout.rightMargin: 16
Layout.leftMargin: 16
headerText: "Amnezia DNS"
headerText: "AmneziaDNS"
descriptionText: qsTr("A DNS service is installed on your server, and it is only accessible via VPN.\n") +
qsTr("The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab.")
}
@ -69,7 +70,7 @@ PageType {
width: parent.width
text: qsTr("Remove ") + ContainersModel.getProcessedContainerName()
textColor: "#EB5757"
textColor: AmneziaStyle.color.vibrantRed
Keys.onTabPressed: root.lastItemTabClicked()
@ -81,7 +82,7 @@ PageType {
var yesButtonFunction = function() {
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected
&& SettingsController.isAmneziaDnsEnabled()) {
PageController.showNotificationMessage(qsTr("Cannot remove Amnezia DNS from running server"))
PageController.showNotificationMessage(qsTr("Cannot remove AmneziaDNS from running server"))
} else
{
PageController.goToPage(PageEnum.PageDeinstalling)
@ -103,8 +104,6 @@ PageType {
enabled: false
}
}
DividerType {}
}
}
}

View file

@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -73,7 +74,7 @@ PageType {
onFocusChanged: {
if (focus) {
listview.currentItem.focusItem.forceActiveFocus()
listview.currentItem.listViewFocusItem.forceActiveFocus()
}
}
@ -81,7 +82,7 @@ PageType {
implicitWidth: listview.width
implicitHeight: col.implicitHeight
property alias focusItem: hostLabel.rightButton
property alias listViewFocusItem: hostLabel.rightButton
ColumnLayout {
id: col
@ -114,7 +115,7 @@ PageType {
descriptionOnTop: true
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: "#D7D8DB"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
@ -138,7 +139,7 @@ PageType {
KeyNavigation.tab: usernameLabel.rightButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: "#D7D8DB"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
@ -162,7 +163,7 @@ PageType {
KeyNavigation.tab: passwordLabel.eyeButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: "#D7D8DB"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
@ -193,7 +194,7 @@ PageType {
}
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: "#D7D8DB"
rightImageColor: AmneziaStyle.color.paleGray
buttonImageSource: hideDescription ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg"
@ -216,11 +217,11 @@ PageType {
Layout.leftMargin: 16
Layout.rightMargin: 16
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
parentFlickable: fl
@ -232,7 +233,7 @@ PageType {
PageController.showBusyIndicator(true)
InstallController.mountSftpDrive(port, password, username)
PageController.showBusyIndicator(false)
}
}
}
ParagraphTextType {
@ -280,57 +281,21 @@ PageType {
Layout.leftMargin: 8
implicitHeight: 32
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#FBB26A"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.goldenApricot
text: qsTr("Detailed instructions")
parentFlickable: fl
KeyNavigation.tab: removeButton
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
// Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest")
}
}
BasicButtonType {
id: removeButton
Layout.topMargin: 24
Layout.bottomMargin: 16
Layout.leftMargin: 8
implicitHeight: 32
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
textColor: "#EB5757"
parentFlickable: fl
Keys.onTabPressed: lastItemTabClicked()
text: qsTr("Remove SFTP and all data stored there")
clickedFunc: function() {
var headerText = qsTr("Remove SFTP and all data stored there?")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeProcessedContainer()
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
removeButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
}
}
}

View file

@ -0,0 +1,386 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview
Connections {
target: InstallController
function onUpdateContainerFinished() {
PageController.showNotificationMessage(qsTr("Settings updated successfully"))
}
}
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
BackButtonType {
id: backButton
KeyNavigation.tab: listview
}
}
FlickableType {
id: fl
anchors.top: backButtonLayout.bottom
anchors.bottom: parent.bottom
contentHeight: listview.implicitHeight
ListView {
id: listview
width: parent.width
height: listview.contentItem.height
clip: true
interactive: false
model: Socks5ProxyConfigModel
onFocusChanged: {
if (focus) {
listview.currentItem.focusItemId.forceActiveFocus()
}
}
delegate: Item {
implicitWidth: listview.width
implicitHeight: content.implicitHeight
property alias focusItemId: hostLabel.rightButton
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
HeaderType {
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
headerText: qsTr("SOCKS5 settings")
}
LabelWithButtonType {
id: hostLabel
Layout.fillWidth: true
Layout.topMargin: 32
parentFlickable: fl
KeyNavigation.tab: portLabel.rightButton
text: qsTr("Host")
descriptionText: ServersModel.getProcessedServerData("hostName")
descriptionOnTop: true
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied"))
if (!GC.isMobile()) {
this.rightButton.forceActiveFocus()
}
}
}
LabelWithButtonType {
id: portLabel
Layout.fillWidth: true
text: qsTr("Port")
descriptionText: port
descriptionOnTop: true
parentFlickable: fl
KeyNavigation.tab: usernameLabel.rightButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied"))
if (!GC.isMobile()) {
this.rightButton.forceActiveFocus()
}
}
}
LabelWithButtonType {
id: usernameLabel
Layout.fillWidth: true
text: qsTr("User name")
descriptionText: username
descriptionOnTop: true
parentFlickable: fl
KeyNavigation.tab: passwordLabel.eyeButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied"))
if (!GC.isMobile()) {
this.rightButton.forceActiveFocus()
}
}
}
LabelWithButtonType {
id: passwordLabel
Layout.fillWidth: true
text: qsTr("Password")
descriptionText: password
descriptionOnTop: true
parentFlickable: fl
eyeButton.KeyNavigation.tab: passwordLabel.rightButton
rightButton.KeyNavigation.tab: changeSettingsButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
buttonImageSource: hideDescription ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg"
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied"))
if (!GC.isMobile()) {
this.rightButton.forceActiveFocus()
}
}
}
DrawerType2 {
id: changeSettingsDrawer
parent: root
anchors.fill: parent
expandedHeight: root.height * 0.9
onClosed: {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
}
expandedContent: ColumnLayout {
property string tempPort: port
property string tempUsername: username
property string tempPassword: password
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 32
anchors.leftMargin: 16
anchors.rightMargin: 16
spacing: 0
Connections {
target: changeSettingsDrawer
function onOpened() {
if (!GC.isMobile()) {
drawerFocusItem.forceActiveFocus()
}
tempPort = port
tempUsername = username
tempPassword = password
}
function onClosed() {
port = tempPort
username = tempUsername
password = tempPassword
portTextField.textFieldText = port
usernameTextField.textFieldText = username
passwordTextField.textFieldText = password
}
}
Item {
id: drawerFocusItem
KeyNavigation.tab: portTextField.textField
}
HeaderType {
Layout.fillWidth: true
headerText: qsTr("SOCKS5 settings")
}
TextFieldWithHeaderType {
id: portTextField
Layout.fillWidth: true
Layout.topMargin: 40
parentFlickable: fl
headerText: qsTr("Port")
textFieldText: port
textField.maximumLength: 5
textField.validator: IntValidator { bottom: 1; top: 65535 }
textField.onEditingFinished: {
textFieldText = textField.text.replace(/^\s+|\s+$/g, '')
if (textFieldText !== port) {
port = textFieldText
}
}
KeyNavigation.tab: usernameTextField.textField
}
TextFieldWithHeaderType {
id: usernameTextField
Layout.fillWidth: true
Layout.topMargin: 16
parentFlickable: fl
headerText: qsTr("Username")
textFieldPlaceholderText: "username"
textFieldText: username
textField.maximumLength: 32
textField.onEditingFinished: {
textFieldText = textField.text.replace(/^\s+|\s+$/g, '')
if (textFieldText !== username) {
username = textFieldText
}
}
KeyNavigation.tab: passwordTextField.textField
}
TextFieldWithHeaderType {
id: passwordTextField
property bool hidePassword: true
Layout.fillWidth: true
Layout.topMargin: 16
parentFlickable: fl
headerText: qsTr("Password")
textFieldPlaceholderText: "password"
textFieldText: password
textField.maximumLength: 32
textField.echoMode: hidePassword ? TextInput.Password : TextInput.Normal
buttonImageSource: textFieldText !== "" ? (hidePassword ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg")
: ""
clickedFunc: function() {
hidePassword = !hidePassword
}
textField.onFocusChanged: {
textFieldText = textField.text.replace(/^\s+|\s+$/g, '')
if (textFieldText !== password) {
password = textFieldText
}
}
KeyNavigation.tab: saveButton
}
BasicButtonType {
id: saveButton
Layout.fillWidth: true
Layout.topMargin: 24
Layout.bottomMargin: 24
text: qsTr("Change connection settings")
Keys.onTabPressed: lastItemTabClicked(drawerFocusItem)
clickedFunc: function() {
forceActiveFocus()
if (!portTextField.textField.acceptableInput) {
portTextField.errorText = qsTr("The port must be in the range of 1 to 65535")
return
}
if (usernameTextField.textFieldText && passwordTextField.textFieldText === "") {
passwordTextField.errorText = qsTr("Password cannot be empty")
return
} else if (usernameTextField.textFieldText === "" && passwordTextField.textFieldText) {
usernameTextField.errorText = qsTr("Username cannot be empty")
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling)
InstallController.updateContainer(Socks5ProxyConfigModel.getConfig())
tempPort = portTextField.textFieldText
tempUsername = usernameTextField.textFieldText
tempPassword = passwordTextField.textFieldText
changeSettingsDrawer.close()
}
}
}
}
BasicButtonType {
id: changeSettingsButton
Layout.fillWidth: true
Layout.topMargin: 24
Layout.bottomMargin: 24
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Change connection settings")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
forceActiveFocus()
changeSettingsDrawer.open()
}
}
}
}
}
}
}

View file

@ -6,6 +6,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -82,12 +83,12 @@ PageType {
}
descriptionOnTop: true
textColor: "#FBB26A"
textColor: AmneziaStyle.color.goldenApricot
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: "#D7D8DB"
rightImageColor: AmneziaStyle.color.paleGray
KeyNavigation.tab: removeButton
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
@ -126,41 +127,6 @@ PageType {
text: qsTr("When configuring WordPress set the this onion address as domain.")
}
BasicButtonType {
id: removeButton
Layout.topMargin: 24
Layout.bottomMargin: 16
Layout.leftMargin: 8
implicitHeight: 32
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
textColor: "#EB5757"
text: qsTr("Remove website")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
var headerText = qsTr("The site with all data will be removed from the tor network.")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeProcessedContainer()
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
removeButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
}
}
}

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -128,6 +129,26 @@ PageType {
DividerType {}
LabelWithButtonType {
id: devConsole
visible: SettingsController.isDevModeEnabled
Layout.fillWidth: true
text: qsTr("Dev console")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/bug.svg"
// Keys.onTabPressed: lastItemTabClicked(header)
clickedFunction: function() {
PageController.goToPage(PageEnum.PageDevMenu)
}
}
DividerType {
visible: SettingsController.isDevModeEnabled
}
LabelWithButtonType {
id: close
visible: GC.isDesktop()

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -84,7 +85,7 @@ PageType {
font.pixelSize: 14
text: qsTr("Amnezia is a free and open-source application. You can support the developers if you like it.")
color: "#CCCAC8"
color: AmneziaStyle.color.paleGray
}
ParagraphTextType {
@ -119,7 +120,7 @@ PageType {
id: mailButton
Layout.fillWidth: true
text: qsTr("Mail")
text: qsTr("support@amnezia.org")
descriptionText: qsTr("For reviews and bug reports")
leftImageSource: "qrc:/images/controls/mail.svg"
@ -127,6 +128,8 @@ PageType {
parentFlickable: fl
clickedFunction: function() {
GC.copyToClipBoard(text)
PageController.showNotificationMessage(qsTr("Copied"))
}
}
@ -137,7 +140,7 @@ PageType {
id: githubButton
Layout.fillWidth: true
text: qsTr("Github")
text: qsTr("GitHub")
leftImageSource: "qrc:/images/controls/github.svg"
KeyNavigation.tab: websiteButton
@ -162,7 +165,7 @@ PageType {
parentFlickable: fl
clickedFunction: function() {
Qt.openUrlExternally(qsTr("https://amnezia.org"))
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl())
}
}
@ -176,7 +179,19 @@ PageType {
horizontalAlignment: Text.AlignHCenter
text: qsTr("Software version: %1").arg(SettingsController.getAppVersion())
color: "#878B91"
color: AmneziaStyle.color.mutedGray
MouseArea {
property int clickCount: 0
anchors.fill: parent
onClicked: {
if (clickCount > 10) {
SettingsController.enableDevMode()
} else {
clickCount++
}
}
}
}
BasicButtonType {
@ -186,11 +201,11 @@ PageType {
Layout.bottomMargin: 16
implicitHeight: 32
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#FBB26A"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.goldenApricot
text: qsTr("Check for updates")
@ -209,11 +224,11 @@ PageType {
Layout.topMargin: -15
implicitHeight: 25
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#FBB26A"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.goldenApricot
text: qsTr("Privacy Policy")
@ -221,7 +236,7 @@ PageType {
parentFlickable: fl
clickedFunc: function() {
Qt.openUrlExternally("https://amnezia.org/en/policy")
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl() + "/policy")
}
}
}

View file

@ -0,0 +1,103 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageType {
id: root
ListView {
id: menuContent
property var selectedText
width: parent.width
height: menuContent.contentItem.height
clip: true
interactive: false
model: ApiCountryModel
ButtonGroup {
id: containersRadioButtonGroup
}
delegate: Item {
implicitWidth: parent.width
implicitHeight: content.implicitHeight
ColumnLayout {
id: content
anchors.fill: parent
RowLayout {
VerticalRadioButton {
id: containerRadioButton
Layout.fillWidth: true
Layout.leftMargin: 16
text: countryName
ButtonGroup.group: containersRadioButtonGroup
imageSource: "qrc:/images/controls/download.svg"
checked: index === ApiCountryModel.currentIndex
onClicked: {
if (index !== ApiCountryModel.currentIndex) {
PageController.showBusyIndicator(true)
var prevIndex = ApiCountryModel.currentIndex
ApiCountryModel.currentIndex = index
if (!InstallController.updateServiceFromApi(ServersModel.defaultIndex, countryCode, countryName)) {
ApiCountryModel.currentIndex = prevIndex
}
}
}
MouseArea {
anchors.fill: containerRadioButton
cursorShape: Qt.PointingHandCursor
enabled: false
}
Keys.onEnterPressed: {
if (checkable) {
checked = true
}
containerRadioButton.clicked()
}
Keys.onReturnPressed: {
if (checkable) {
checked = true
}
containerRadioButton.clicked()
}
}
Image {
Layout.rightMargin: 32
Layout.alignment: Qt.AlignRight
source: "qrc:/countriesFlags/images/flagKit/" + countryImageCode + ".svg"
}
}
DividerType {
Layout.fillWidth: true
}
}
}
}
}

View file

@ -0,0 +1,208 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
FlickableType {
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
Item {
id: focusItem
// KeyNavigation.tab: backButton
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/map-pin.svg"
leftText: qsTr("For the region")
rightText: ApiServicesModel.getSelectedServiceData("region")
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/tag.svg"
leftText: qsTr("Price")
rightText: ApiServicesModel.getSelectedServiceData("price")
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/history.svg"
leftText: qsTr("Work period")
rightText: ApiServicesModel.getSelectedServiceData("workPeriod")
visible: rightText !== ""
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/gauge.svg"
leftText: qsTr("Speed")
rightText: ApiServicesModel.getSelectedServiceData("speed")
}
ParagraphTextType {
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
onLinkActivated: function(link) {
Qt.openUrlExternally(link)
}
textFormat: Text.RichText
text: {
var text = ApiServicesModel.getSelectedServiceData("features")
if (text === undefined) {
return ""
}
return text.replace("%1", LanguageModel.getCurrentSiteUrl())
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
LabelWithButtonType {
id: supportUuid
Layout.fillWidth: true
text: qsTr("Support tag")
descriptionText: SettingsController.getInstallationUuid()
descriptionOnTop: true
// parentFlickable: fl
// KeyNavigation.tab: passwordLabel.eyeButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied"))
if (!GC.isMobile()) {
this.rightButton.forceActiveFocus()
}
}
}
BasicButtonType {
id: resetButton
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 24
Layout.bottomMargin: 16
Layout.leftMargin: 8
implicitHeight: 32
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
textColor: AmneziaStyle.color.vibrantRed
text: qsTr("Reload API config")
// Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
var headerText = qsTr("Reload API config?")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Cannot reload API config during active connection"))
} else {
PageController.showBusyIndicator(true)
InstallController.updateServiceFromApi(ServersModel.processedIndex, "", "", true)
PageController.showBusyIndicator(false)
}
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
removeButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
BasicButtonType {
id: removeButton
Layout.alignment: Qt.AlignHCenter
Layout.bottomMargin: 16
Layout.leftMargin: 8
implicitHeight: 32
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
textColor: AmneziaStyle.color.vibrantRed
text: qsTr("Remove from application")
// Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
var headerText = qsTr("Remove from application?")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Cannot remove server during active connection"))
} else {
PageController.showBusyIndicator(true)
InstallController.removeProcessedServer()
PageController.showBusyIndicator(false)
}
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
removeButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
}
}
}

View file

@ -10,6 +10,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -214,7 +215,7 @@ PageType {
text: appPath
rightImageSource: "qrc:/images/controls/trash.svg"
rightImageColor: "#D7D8DB"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
var headerText = qsTr("Remove ") + appPath + "?"
@ -241,7 +242,7 @@ PageType {
Rectangle {
anchors.fill: addAppButton
anchors.bottomMargin: -24
color: "#0E0E11"
color: AmneziaStyle.color.midnightBlack
opacity: 0.8
}
@ -275,7 +276,7 @@ PageType {
if (Qt.platform.os === "windows") {
var fileName = SystemController.getFileName(qsTr("Open executable file"),
qsTr("Executable file (*.*)"))
qsTr("Executable files (*.*)"))
if (fileName !== "") {
AppSplitTunnelingController.addApp(fileName)
}

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -50,6 +51,8 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
HeaderType {
Layout.fillWidth: true
Layout.leftMargin: 16
@ -221,7 +224,7 @@ PageType {
text: qsTr("Reset settings and remove all data from the application")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
textColor: "#EB5757"
textColor: AmneziaStyle.color.vibrantRed
Keys.onTabPressed: lastItemTabClicked()
parentFlickable: fl
@ -238,7 +241,7 @@ PageType {
} else
{
SettingsController.clearSettings()
PageController.replaceStartPage()
PageController.goToPageHome()
}
if (!GC.isMobile()) {

View file

@ -6,6 +6,7 @@ import QtQuick.Dialogs
import QtCore
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -27,7 +28,6 @@ PageType {
function onRestoreBackupFinished() {
PageController.showNotificationMessage(qsTr("Settings restored from backup file"))
//goToStartPage()
PageController.goToPageHome()
}
@ -120,11 +120,11 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: -8
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Restore from backup")

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -37,13 +38,13 @@ PageType {
anchors.bottom: parent.bottom
contentHeight: content.height
property var isServerFromApi: ServersModel.getDefaultServerData("isServerFromApi")
property var isServerFromApi: ServersModel.isServerFromApi(ServersModel.defaultIndex)
enabled: !isServerFromApi
Component.onCompleted: {
if (isServerFromApi) {
PageController.showNotificationMessage(qsTr("Default server does not support custom dns"))
PageController.showNotificationMessage(qsTr("Default server does not support custom DNS"))
}
}
@ -101,11 +102,11 @@ PageType {
id: restoreDefaultButton
Layout.fillWidth: true
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Restore default")

View file

@ -6,6 +6,7 @@ import QtQuick.Dialogs
import QtCore
import PageEnum 1.0
import Style 1.0
import "../Controls2"
import "../Config"
@ -15,18 +16,6 @@ import "../Controls2/TextTypes"
PageType {
id: root
Connections {
target: SettingsController
function onLoggingStateChanged() {
if (SettingsController.isLoggingEnabled) {
var message = qsTr("Logging is enabled. Note that logs will be automatically \
disabled after 14 days, and all log files will be deleted.")
PageController.showNotificationMessage(message)
}
}
}
defaultActiveFocusItem: focusItem
Item {
@ -57,16 +46,15 @@ disabled after 14 days, and all log files will be deleted.")
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 16
anchors.rightMargin: 16
spacing: 16
spacing: 0
HeaderType {
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
headerText: qsTr("Logging")
descriptionText: qsTr("Enabling this function will save application's logs automatically, " +
descriptionText: qsTr("Enabling this function will save application's logs automatically. " +
"By default, logging functionality is disabled. Enable log saving in case of application malfunction.")
}
@ -74,11 +62,13 @@ disabled after 14 days, and all log files will be deleted.")
id: switcher
Layout.fillWidth: true
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Save logs")
text: qsTr("Enable logs")
checked: SettingsController.isLoggingEnabled
KeyNavigation.tab: openFolderButton
//KeyNavigation.tab: openFolderButton
onCheckedChanged: {
if (checked !== SettingsController.isLoggingEnabled) {
SettingsController.isLoggingEnabled = checked
@ -86,132 +76,200 @@ disabled after 14 days, and all log files will be deleted.")
}
}
RowLayout {
DividerType {}
LabelWithButtonType {
// id: labelWithButton2
Layout.fillWidth: true
Layout.topMargin: -8
ColumnLayout {
Layout.alignment: Qt.AlignBaseline
Layout.preferredWidth: GC.isMobile() ? 0 : root.width / 3
visible: !GC.isMobile()
text: qsTr("Clear logs")
leftImageSource: "qrc:/images/controls/trash.svg"
isSmallLeftImage: true
ImageButtonType {
id: openFolderButton
Layout.alignment: Qt.AlignHCenter
// KeyNavigation.tab: labelWithButton3
implicitWidth: 56
implicitHeight: 56
clickedFunction: function() {
var headerText = qsTr("Clear logs?")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
image: "qrc:/images/controls/folder-open.svg"
KeyNavigation.tab: saveButton
onClicked: SettingsController.openLogsFolder()
Keys.onReturnPressed: openFolderButton.clicked()
Keys.onEnterPressed: openFolderButton.clicked()
var yesButtonFunction = function() {
PageController.showBusyIndicator(true)
SettingsController.clearLogs()
PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs have been cleaned up"))
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
}
CaptionTextType {
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
text: qsTr("Open folder with logs")
color: "#D7D8DB"
}
}
ColumnLayout {
Layout.alignment: Qt.AlignBaseline
Layout.preferredWidth: root.width / ( GC.isMobile() ? 2 : 3 )
ImageButtonType {
id: saveButton
Layout.alignment: Qt.AlignHCenter
implicitWidth: 56
implicitHeight: 56
image: "qrc:/images/controls/save.svg"
KeyNavigation.tab: clearButton
Keys.onReturnPressed: saveButton.clicked()
Keys.onEnterPressed: saveButton.clicked()
onClicked: {
var fileName = ""
if (GC.isMobile()) {
fileName = "AmneziaVPN.log"
} else {
fileName = SystemController.getFileName(qsTr("Save"),
qsTr("Logs files (*.log)"),
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN",
true,
".log")
}
if (fileName !== "") {
PageController.showBusyIndicator(true)
SettingsController.exportLogsFile(fileName)
PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs file saved"))
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
}
CaptionTextType {
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
text: qsTr("Save logs to file")
color: "#D7D8DB"
ListItemTitleType {
Layout.fillWidth: true
Layout.topMargin: 8
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Client logs")
}
ParagraphTextType {
Layout.fillWidth: true
Layout.topMargin: 8
Layout.leftMargin: 16
Layout.rightMargin: 16
color: AmneziaStyle.color.mutedGray
text: qsTr("AmneziaVPN logs")
}
LabelWithButtonType {
// id: labelWithButton2
Layout.fillWidth: true
Layout.topMargin: -8
Layout.bottomMargin: -8
text: qsTr("Open logs folder")
leftImageSource: "qrc:/images/controls/folder-open.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
clickedFunction: function() {
SettingsController.openLogsFolder()
}
}
DividerType {}
LabelWithButtonType {
// id: labelWithButton2
Layout.fillWidth: true
Layout.topMargin: -8
Layout.bottomMargin: -8
text: qsTr("Export logs")
leftImageSource: "qrc:/images/controls/save.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
clickedFunction: function() {
var fileName = ""
if (GC.isMobile()) {
fileName = "AmneziaVPN.log"
} else {
fileName = SystemController.getFileName(qsTr("Save"),
qsTr("Logs files (*.log)"),
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN",
true,
".log")
}
if (fileName !== "") {
PageController.showBusyIndicator(true)
SettingsController.exportLogsFile(fileName)
PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs file saved"))
}
}
}
ColumnLayout {
Layout.alignment: Qt.AlignBaseline
Layout.preferredWidth: root.width / ( GC.isMobile() ? 2 : 3 )
DividerType {}
ImageButtonType {
id: clearButton
Layout.alignment: Qt.AlignHCenter
ListItemTitleType {
visible: !GC.isMobile()
implicitWidth: 56
implicitHeight: 56
Layout.fillWidth: true
Layout.topMargin: 32
Layout.leftMargin: 16
Layout.rightMargin: 16
image: "qrc:/images/controls/delete.svg"
Keys.onTabPressed: lastItemTabClicked(focusItem)
text: qsTr("Service logs")
}
Keys.onReturnPressed: clearButton.clicked()
Keys.onEnterPressed: clearButton.clicked()
onClicked: function() {
var headerText = qsTr("Clear logs?")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
ParagraphTextType {
visible: !GC.isMobile()
var yesButtonFunction = function() {
PageController.showBusyIndicator(true)
SettingsController.clearLogs()
PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs have been cleaned up"))
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
}
Layout.fillWidth: true
Layout.topMargin: 8
Layout.leftMargin: 16
Layout.rightMargin: 16
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
color: AmneziaStyle.color.mutedGray
text: qsTr("AmneziaVPN-service logs")
}
LabelWithButtonType {
// id: labelWithButton2
visible: !GC.isMobile()
Layout.fillWidth: true
Layout.topMargin: -8
Layout.bottomMargin: -8
text: qsTr("Open logs folder")
leftImageSource: "qrc:/images/controls/folder-open.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
clickedFunction: function() {
SettingsController.openServiceLogsFolder()
}
}
DividerType {
visible: !GC.isMobile()
}
LabelWithButtonType {
// id: labelWithButton2
visible: !GC.isMobile()
Layout.fillWidth: true
Layout.topMargin: -8
Layout.bottomMargin: -8
text: qsTr("Export logs")
leftImageSource: "qrc:/images/controls/save.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
clickedFunction: function() {
var fileName = ""
if (GC.isMobile()) {
fileName = "AmneziaVPN-service.log"
} else {
fileName = SystemController.getFileName(qsTr("Save"),
qsTr("Logs files (*.log)"),
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN-service",
true,
".log")
}
CaptionTextType {
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
text: qsTr("Clear logs")
color: "#D7D8DB"
if (fileName !== "") {
PageController.showBusyIndicator(true)
SettingsController.exportServiceLogsFile(fileName)
PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs file saved"))
}
}
}
DividerType {
visible: !GC.isMobile()
}
}
}
}

View file

@ -6,6 +6,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ProtocolEnum 1.0
import Style 1.0
import "../Controls2"
import "../Controls2/TextTypes"
@ -37,7 +38,7 @@ PageType {
function onRemoveProcessedServerFinished(finishedMessage) {
if (!ServersModel.getServersCount()) {
PageController.replaceStartPage()
PageController.goToPageHome()
} else {
PageController.goToStartPage()
PageController.goToPage(PageEnum.PageSettingsServersList)
@ -118,7 +119,7 @@ PageType {
Layout.fillWidth: true
text: qsTr("Reboot server")
textColor: "#EB5757"
textColor: AmneziaStyle.color.vibrantRed
KeyNavigation.tab: labelWithButton3
@ -159,7 +160,7 @@ PageType {
Layout.fillWidth: true
text: qsTr("Remove server from application")
textColor: "#EB5757"
textColor: AmneziaStyle.color.vibrantRed
Keys.onTabPressed: {
if (content.isServerWithWriteAccess) {
@ -207,7 +208,7 @@ PageType {
Layout.fillWidth: true
text: qsTr("Clear server from Amnezia software")
textColor: "#EB5757"
textColor: AmneziaStyle.color.vibrantRed
Keys.onTabPressed: labelWithButton5.visible ?
labelWithButton5.forceActiveFocus() :
@ -246,11 +247,11 @@ PageType {
LabelWithButtonType {
id: labelWithButton5
visible: ServersModel.getProcessedServerData("isServerFromApi")
visible: ServersModel.getProcessedServerData("isServerFromTelegramApi")
Layout.fillWidth: true
text: qsTr("Reset API config")
textColor: "#EB5757"
textColor: AmneziaStyle.color.vibrantRed
Keys.onTabPressed: root.lastItemTabClickedSignal()
@ -284,7 +285,7 @@ PageType {
}
DividerType {
visible: ServersModel.getProcessedServerData("isServerFromApi")
visible: ServersModel.getProcessedServerData("isServerFromTelegramApi")
}
}
}

View file

@ -8,6 +8,7 @@ import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerProps 1.0
import ProtocolProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -18,13 +19,19 @@ import "../Components"
PageType {
id: root
property int pageSettingsServerProtocols: 0
property int pageSettingsServerServices: 1
property int pageSettingsServerData: 2
property int pageSettingsApiServerInfo: 3
property int pageSettingsApiLanguageList: 4
defaultActiveFocusItem: focusItem
Connections {
target: PageController
function onGoToPageSettingsServerServices() {
tabBar.currentIndex = 1
tabBar.currentIndex = root.pageSettingsServerServices
}
}
@ -69,6 +76,15 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: headerContent.actionButton
backButtonFunction: function() {
if (nestedStackView.currentIndex === root.pageSettingsApiServerInfo &&
ServersModel.getProcessedServerData("isCountrySelectionAvailable")) {
nestedStackView.currentIndex = root.pageSettingsApiLanguageList
} else {
PageController.closePage()
}
}
}
HeaderType {
@ -77,11 +93,15 @@ PageType {
Layout.leftMargin: 16
Layout.rightMargin: 16
actionButtonImage: "qrc:/images/controls/edit-3.svg"
actionButtonImage: nestedStackView.currentIndex === root.pageSettingsApiLanguageList ? "qrc:/images/controls/settings.svg" : "qrc:/images/controls/edit-3.svg"
headerText: name
descriptionText: {
if (ServersModel.isProcessedServerHasWriteAccess()) {
if (ServersModel.getProcessedServerData("isServerFromGatewayApi")) {
return ApiServicesModel.getSelectedServiceData("serviceDescription")
} else if (ServersModel.getProcessedServerData("isServerFromTelegramApi")) {
return serverDescription
} else if (ServersModel.isProcessedServerHasWriteAccess()) {
return credentialsLogin + " · " + hostName
} else {
return hostName
@ -91,7 +111,11 @@ PageType {
KeyNavigation.tab: tabBar
actionButtonFunction: function() {
serverNameEditDrawer.open()
if (nestedStackView.currentIndex === root.pageSettingsApiLanguageList) {
nestedStackView.currentIndex = root.pageSettingsApiServerInfo
} else {
serverNameEditDrawer.open()
}
}
}
@ -171,13 +195,16 @@ PageType {
Layout.fillWidth: true
currentIndex: (ServersModel.getProcessedServerData("isServerFromApi")
&& !ServersModel.getProcessedServerData("hasInstalledContainers")) ? 2 : 0
currentIndex: (ServersModel.getProcessedServerData("isServerFromTelegramApi")
&& !ServersModel.getProcessedServerData("hasInstalledContainers")) ?
root.pageSettingsServerData : root.pageSettingsServerProtocols
background: Rectangle {
color: "transparent"
color: AmneziaStyle.color.transparent
}
visible: !ServersModel.getProcessedServerData("isServerFromGatewayApi")
activeFocusOnTab: true
onFocusChanged: {
if (activeFocus) {
@ -189,45 +216,53 @@ PageType {
id: protocolsTab
visible: protocolsPage.installedProtocolsCount
width: protocolsPage.installedProtocolsCount ? undefined : 0
isSelected: tabBar.currentIndex === 0
isSelected: tabBar.currentIndex === root.pageSettingsServerProtocols
text: qsTr("Protocols")
KeyNavigation.tab: servicesTab
Keys.onReturnPressed: tabBar.currentIndex = 0
Keys.onEnterPressed: tabBar.currentIndex = 0
Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerProtocols
Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerProtocols
}
TabButtonType {
id: servicesTab
visible: servicesPage.installedServicesCount
width: servicesPage.installedServicesCount ? undefined : 0
isSelected: tabBar.currentIndex === 1
isSelected: tabBar.currentIndex === root.pageSettingsServerServices
text: qsTr("Services")
KeyNavigation.tab: dataTab
Keys.onReturnPressed: tabBar.currentIndex = 1
Keys.onEnterPressed: tabBar.currentIndex = 1
Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerServices
Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerServices
}
TabButtonType {
id: dataTab
isSelected: tabBar.currentIndex === 2
isSelected: tabBar.currentIndex === root.pageSettingsServerData
text: qsTr("Management")
Keys.onReturnPressed: tabBar.currentIndex = 2
Keys.onEnterPressed: tabBar.currentIndex = 2
KeyNavigation.tab: stackView.currentIndex === 0 ?
protocolsPage :
stackView.currentIndex === 1 ?
servicesPage :
dataPage
Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerData
Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerData
Keys.onTabPressed: function() {
if (nestedStackView.currentIndex === root.pageSettingsServerProtocols) {
return protocolsPage
} else if (nestedStackView.currentIndex === root.pageSettingsServerProtocols) {
return servicesPage
} else {
return dataPage
}
}
}
}
StackLayout {
id: stackView
id: nestedStackView
Layout.preferredWidth: root.width
Layout.preferredHeight: root.height - tabBar.implicitHeight - header.implicitHeight
currentIndex: tabBar.currentIndex
currentIndex: ServersModel.getProcessedServerData("isServerFromGatewayApi") ?
(ServersModel.getProcessedServerData("isCountrySelectionAvailable") ?
root.pageSettingsApiLanguageList : root.pageSettingsApiServerInfo) : tabBar.currentIndex
PageSettingsServerProtocols {
id: protocolsPage
@ -235,18 +270,34 @@ PageType {
onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
PageSettingsServerServices {
id: servicesPage
stackView: root.stackView
onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
PageSettingsServerData {
id: dataPage
stackView: root.stackView
onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
PageSettingsApiServerInfo {
id: apiInfoPage
stackView: root.stackView
// onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
PageSettingsApiLanguageList {
id: apiLanguageListPage
stackView: root.stackView
// onLastItemTabClickedSignal: lastItemTabClicked(focusItem)
}
}
}

View file

@ -8,6 +8,7 @@ import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -18,6 +19,8 @@ import "../Components"
PageType {
id: root
property bool isClearCacheVisible: ServersModel.isProcessedServerHasWriteAccess() && !ContainersModel.isServiceContainer(ContainersModel.getProcessedContainerIndex())
defaultActiveFocusItem: focusItem
Item {
@ -76,7 +79,7 @@ PageType {
}
delegate: Item {
property var focusItem: button.rightButton
property var focusItem: clientSettings.rightButton
implicitWidth: protocols.width
implicitHeight: delegateContent.implicitHeight
@ -86,13 +89,49 @@ PageType {
anchors.fill: parent
property bool isClientSettingsVisible: protocolIndex === ProtocolEnum.WireGuard || protocolIndex === ProtocolEnum.Awg
property bool isServerSettingsVisible: ServersModel.isProcessedServerHasWriteAccess()
LabelWithButtonType {
id: button
id: clientSettings
Layout.fillWidth: true
text: protocolName
text: protocolName + qsTr(" connection settings")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
visible: delegateContent.isClientSettingsVisible
clickedFunction: function() {
if (isClientProtocolExists) {
switch (protocolIndex) {
case ProtocolEnum.WireGuard: WireGuardConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Awg: AwgConfigModel.updateModel(ProtocolsModel.getConfig()); break;
}
PageController.goToPage(clientProtocolPage);
} else {
PageController.showNotificationMessage(qsTr("Click the \"connect\" button to create a connection configuration"))
}
}
MouseArea {
anchors.fill: clientSettings
cursorShape: Qt.PointingHandCursor
enabled: false
}
}
DividerType {
visible: delegateContent.isClientSettingsVisible
}
LabelWithButtonType {
id: serverSettings
Layout.fillWidth: true
text: protocolName + qsTr(" server settings")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
visible: delegateContent.isServerSettingsVisible
clickedFunction: function() {
switch (protocolIndex) {
@ -102,19 +141,23 @@ PageType {
case ProtocolEnum.WireGuard: WireGuardConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Awg: AwgConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Xray: XrayConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Sftp: SftpConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Ipsec: Ikev2ConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Socks5Proxy: Socks5ProxyConfigModel.updateModel(ProtocolsModel.getConfig()); break;
}
PageController.goToPage(protocolPage);
PageController.goToPage(serverProtocolPage);
}
MouseArea {
anchors.fill: button
anchors.fill: serverSettings
cursorShape: Qt.PointingHandCursor
enabled: false
}
}
DividerType {}
DividerType {
visible: delegateContent.isServerSettingsVisible
}
}
}
}
@ -124,14 +167,14 @@ PageType {
Layout.fillWidth: true
visible: ServersModel.isProcessedServerHasWriteAccess()
visible: root.isClearCacheVisible
KeyNavigation.tab: removeButton
text: qsTr("Clear %1 profile").arg(ContainersModel.getProcessedContainerName())
text: qsTr("Clear profile")
clickedFunction: function() {
var headerText = qsTr("Clear %1 profile?").arg(ContainersModel.getProcessedContainerName())
var descriptionText = qsTr("")
var descriptionText = qsTr("The connection configuration will be deleted for this device only")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
@ -167,7 +210,7 @@ PageType {
Layout.leftMargin: 16
Layout.rightMargin: 16
visible: ServersModel.isProcessedServerHasWriteAccess()
visible: root.isClearCacheVisible
}
LabelWithButtonType {
@ -178,8 +221,8 @@ PageType {
visible: ServersModel.isProcessedServerHasWriteAccess()
Keys.onTabPressed: lastItemTabClicked(focusItem)
text: qsTr("Remove ") + ContainersModel.getProcessedContainerName()
textColor: "#EB5757"
text: qsTr("Remove ")
textColor: AmneziaStyle.color.vibrantRed
clickedFunction: function() {
var headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getProcessedContainerName())

View file

@ -8,6 +8,7 @@ import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerProps 1.0
import ContainersModelFilters 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -60,7 +61,8 @@ PageType {
id: proxyContainersModel
sourceModel: ContainersModel
sorters: [
RoleSorter { roleName: "isInstalled"; sortOrder: Qt.DescendingOrder }
RoleSorter { roleName: "isInstalled"; sortOrder: Qt.DescendingOrder },
RoleSorter { roleName: "installPageOrder"; sortOrder: Qt.AscendingOrder }
]
}

View file

@ -8,6 +8,7 @@ import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerProps 1.0
import ContainersModelFilters 1.0
import Style 1.0
import "./"
import "../Controls2"

View file

@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -119,7 +120,11 @@ PageType {
servicesNameString += servicesName[i] + " · "
}
return servicesNameString + hostName
if (ServersModel.isServerFromApi(index)) {
return servicesNameString + serverDescription
} else {
return servicesNameString + hostName
}
}
rightImageSource: "qrc:/images/controls/chevron-right.svg"

View file

@ -10,6 +10,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ProtocolEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -20,7 +21,7 @@ import "../Components"
PageType {
id: root
property var isServerFromApi: ServersModel.getDefaultServerData("isServerFromApi")
property var isServerFromTelegramApi: ServersModel.getDefaultServerData("isServerFromTelegramApi")
defaultActiveFocusItem: searchField.textField
@ -35,7 +36,7 @@ PageType {
if (ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Cannot change split tunneling settings during active connection"))
root.pageEnabled = false
} else if (ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && isServerFromApi) {
} else if (ServersModel.isDefaultServerDefaultContainerHasSplitTunneling) {
PageController.showNotificationMessage(qsTr("Default server does not support split tunneling function"))
root.pageEnabled = false
} else {
@ -265,7 +266,7 @@ PageType {
text: url
descriptionText: ip
rightImageSource: "qrc:/images/controls/trash.svg"
rightImageColor: "#D7D8DB"
rightImageColor: AmneziaStyle.color.paleGray
clickedFunction: function() {
var headerText = qsTr("Remove ") + url + "?"
@ -299,7 +300,7 @@ PageType {
Rectangle {
anchors.fill: addSiteButton
anchors.bottomMargin: -24
color: "#0E0E11"
color: AmneziaStyle.color.midnightBlack
opacity: 0.8
}
@ -340,7 +341,7 @@ PageType {
implicitHeight: 56
image: "qrc:/images/controls/more-vertical.svg"
imageColor: "#D7D8DB"
imageColor: AmneziaStyle.color.paleGray
onClicked: function () {
moreActionsDrawer.open()

View file

@ -0,0 +1,154 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
FlickableType {
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
contentHeight: content.height + continueButton.implicitHeight + continueButton.anchors.bottomMargin + continueButton.anchors.topMargin
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
Layout.topMargin: 20
// KeyNavigation.tab: fileButton.rightButton
}
HeaderType {
Layout.fillWidth: true
Layout.topMargin: 8
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 32
headerText: ApiServicesModel.getSelectedServiceData("name")
descriptionText: ApiServicesModel.getSelectedServiceData("serviceDescription")
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/map-pin.svg"
leftText: qsTr("For the region")
rightText: ApiServicesModel.getSelectedServiceData("region")
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/tag.svg"
leftText: qsTr("Price")
rightText: ApiServicesModel.getSelectedServiceData("price")
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/history.svg"
leftText: qsTr("Work period")
rightText: ApiServicesModel.getSelectedServiceData("workPeriod")
visible: rightText !== ""
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/gauge.svg"
leftText: qsTr("Speed")
rightText: ApiServicesModel.getSelectedServiceData("speed")
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16
imageSource: "qrc:/images/controls/info.svg"
leftText: qsTr("Features")
rightText: ""
}
ParagraphTextType {
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
onLinkActivated: function(link) {
Qt.openUrlExternally(link)
}
textFormat: Text.RichText
text: {
var text = ApiServicesModel.getSelectedServiceData("features")
return text.replace("%1", LanguageModel.getCurrentSiteUrl())
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
}
}
BasicButtonType {
id: continueButton
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: 32
anchors.rightMargin: 16
anchors.leftMargin: 16
anchors.bottomMargin: 32
text: qsTr("Connect")
clickedFunc: function() {
var endpoint = ApiServicesModel.getStoreEndpoint()
if (endpoint !== undefined && endpoint !== "") {
Qt.openUrlExternally(endpoint)
PageController.closePage()
PageController.closePage()
} else {
PageController.showBusyIndicator(true)
InstallController.installServiceFromApi()
PageController.showBusyIndicator(false)
}
}
}
}

View file

@ -0,0 +1,102 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
PageType {
id: root
defaultActiveFocusItem: focusItem
FlickableType {
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
Layout.topMargin: 20
// KeyNavigation.tab: fileButton.rightButton
}
HeaderType {
Layout.fillWidth: true
Layout.topMargin: 8
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 32
headerText: qsTr("VPN by Amnezia")
descriptionText: qsTr("Choose a VPN service that suits your needs.")
}
ListView {
id: containers
width: parent.width
height: containers.contentItem.height
spacing: 16
currentIndex: 1
interactive: false
model: ApiServicesModel
delegate: Item {
implicitWidth: containers.width
implicitHeight: delegateContent.implicitHeight
ColumnLayout {
id: delegateContent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
CardWithIconsType {
id: card
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
headerText: name
bodyText: cardDescription
footerText: price
rightImageSource: "qrc:/images/controls/chevron-right.svg"
onClicked: {
if (isServiceAvailable) {
ApiServicesModel.setServiceIndex(index)
PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo)
}
}
}
}
}
}
}
}
}

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -17,7 +18,9 @@ PageType {
target: ImportController
function onQrDecodingFinished() {
PageController.closePage()
if (Qt.platform.os === "ios") {
PageController.closePage()
}
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
}
}
@ -41,46 +44,234 @@ PageType {
Item {
id: focusItem
KeyNavigation.tab: backButton
KeyNavigation.tab: textKey.textField
}
BackButtonType {
id: backButton
Layout.topMargin: 20
KeyNavigation.tab: fileButton.rightButton
}
HeaderType {
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
Layout.fillWidth: true
Layout.topMargin: 8
Layout.topMargin: 24
Layout.rightMargin: 16
Layout.leftMargin: 16
headerText: qsTr("Server connection")
descriptionText: qsTr("Do not use connection codes from untrusted sources, as they may be created to intercept your data.")
headerText: qsTr("Connection")
actionButtonImage: isVisible ? "qrc:/images/controls/more-vertical.svg" : ""
actionButtonFunction: function() {
moreActionsDrawer.open()
}
DrawerType2 {
id: moreActionsDrawer
parent: root
anchors.fill: parent
expandedHeight: root.height * 0.5
expandedContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
HeaderType {
Layout.fillWidth: true
Layout.topMargin: 32
Layout.leftMargin: 16
Layout.rightMargin: 16
headerText: qsTr("Settings")
}
SwitcherType {
id: switcher
Layout.fillWidth: true
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Enable logs")
visible: PageController.isStartPageVisible()
checked: SettingsController.isLoggingEnabled
onCheckedChanged: {
if (checked !== SettingsController.isLoggingEnabled) {
SettingsController.isLoggingEnabled = checked
}
}
}
LabelWithButtonType {
id: supportUuid
Layout.fillWidth: true
Layout.topMargin: 16
text: qsTr("Support tag")
descriptionText: SettingsController.getInstallationUuid()
descriptionOnTop: true
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
visible: SettingsController.getInstallationUuid() !== ""
clickedFunction: function() {
GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied"))
if (!GC.isMobile()) {
this.rightButton.forceActiveFocus()
}
}
}
}
}
}
Header2TextType {
ParagraphTextType {
Layout.fillWidth: true
Layout.topMargin: 32
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 24
text: qsTr("Insert the key, add a configuration file or scan the QR-code")
}
TextFieldWithHeaderType {
id: textKey
Layout.fillWidth: true
Layout.topMargin: 48
Layout.rightMargin: 16
Layout.leftMargin: 16
text: qsTr("What do you have?")
headerText: qsTr("Insert key")
buttonText: qsTr("Insert")
clickedFunc: function() {
textField.text = ""
textField.paste()
}
KeyNavigation.tab: continueButton
}
LabelWithButtonType {
id: fileButton
BasicButtonType {
id: continueButton
Layout.fillWidth: true
Layout.topMargin: 16
Layout.rightMargin: 16
Layout.leftMargin: 16
visible: textKey.textFieldText !== ""
text: qsTr("Continue")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
if (ImportController.extractConfigFromData(textKey.textFieldText)) {
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
}
}
}
ParagraphTextType {
Layout.fillWidth: true
Layout.topMargin: 32
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 24
color: AmneziaStyle.color.charcoalGray
text: qsTr("Other connection options")
}
CardWithIconsType {
id: apiInstalling
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
headerText: qsTr("VPN by Amnezia")
bodyText: qsTr("Connect to classic paid and free VPN services from Amnezia")
text: !ServersModel.getServersCount() ? qsTr("File with connection settings or backup") : qsTr("File with connection settings")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/folder-open.svg"
leftImageSource: "qrc:/images/controls/amnezia.svg"
KeyNavigation.tab: qrButton.visible ? qrButton.rightButton : textButton.rightButton
onClicked: function() {
PageController.showBusyIndicator(true)
var result = InstallController.fillAvailableServices()
PageController.showBusyIndicator(false)
if (result) {
PageController.goToPage(PageEnum.PageSetupWizardApiServicesList)
}
}
}
clickedFunction: function() {
CardWithIconsType {
id: manualInstalling
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
headerText: qsTr("Self-hosted VPN")
bodyText: qsTr("Configure Amnezia VPN on your own server")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/server.svg"
onClicked: {
PageController.goToPage(PageEnum.PageSetupWizardCredentials)
}
}
CardWithIconsType {
id: backupRestore
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
visible: PageController.isStartPageVisible()
headerText: qsTr("Restore from backup")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/archive-restore.svg"
onClicked: {
var filePath = SystemController.getFileName(qsTr("Open backup file"),
qsTr("Backup files (*.backup)"))
if (filePath !== "") {
PageController.showBusyIndicator(true)
SettingsController.restoreAppConfig(filePath)
PageController.showBusyIndicator(false)
}
}
}
CardWithIconsType {
id: openFile
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
headerText: qsTr("File with connection settings")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/folder-search-2.svg"
onClicked: {
var nameFilter = !ServersModel.getServersCount() ? "Config or backup files (*.vpn *.ovpn *.conf *.json *.backup)" :
"Config files (*.vpn *.ovpn *.conf *.json)"
var fileName = SystemController.getFileName(qsTr("Open config file"), nameFilter)
@ -92,20 +283,22 @@ PageType {
}
}
DividerType {}
CardWithIconsType {
id: scanQr
LabelWithButtonType {
id: qrButton
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
visible: SettingsController.isCameraPresent()
text: qsTr("QR-code")
headerText: qsTr("QR code")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/qr-code.svg"
leftImageSource: "qrc:/images/controls/scan-line.svg"
KeyNavigation.tab: textButton.rightButton
clickedFunction: function() {
onClicked: {
ImportController.startDecodingQr()
if (Qt.platform.os === "ios") {
PageController.goToPage(PageEnum.PageSetupWizardQrReader)
@ -113,26 +306,25 @@ PageType {
}
}
DividerType {
visible: SettingsController.isCameraPresent()
}
CardWithIconsType {
id: siteLink
LabelWithButtonType {
id: textButton
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
visible: PageController.isStartPageVisible()
headerText: qsTr("I have nothing")
text: qsTr("Key as text")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/text-cursor.svg"
leftImageSource: "qrc:/images/controls/help-circle.svg"
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSetupWizardTextKey)
onClicked: {
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl())
}
}
DividerType {}
}
}
}

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -59,9 +60,6 @@ PageType {
Layout.fillWidth: true
headerText: qsTr("Server IP address [:port]")
textFieldPlaceholderText: qsTr("255.255.255.255:22")
textField.validator: RegularExpressionValidator {
regularExpression: InstallController.ipAddressPortRegExp()
}
textField.onFocusChanged: {
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
@ -142,6 +140,23 @@ PageType {
text: qsTr("All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties")
}
CardWithIconsType {
id: siteLink
Layout.fillWidth: true
Layout.bottomMargin: 16
headerText: qsTr("How to run your VPN server")
bodyText: qsTr("Where to get connection data, step-by-step instructions for buying a VPS")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/help-circle.svg"
onClicked: {
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl() + "/starter-guide")
}
}
}
}

View file

@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerProps 1.0
import ProtocolProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -185,11 +186,11 @@ PageType {
anchors.topMargin: 8
anchors.bottomMargin: 24
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
Keys.onTabPressed: lastItemTabClicked(focusItem)

View file

@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -46,11 +47,7 @@ PageType {
ServersModel.processedIndex = ServersModel.defaultIndex
}
PageController.goToStartPage()
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) {
PageController.replaceStartPage()
}
PageController.goToPageHome()
PageController.showNotificationMessage(finishedMessage)
}

View file

@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerProps 1.0
import ProtocolProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -93,11 +94,11 @@ PageType {
implicitHeight: 32
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#FBB26A"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.goldenApricot
text: qsTr("More detailed")
KeyNavigation.tab: transportProtoSelector
@ -194,7 +195,7 @@ PageType {
Rectangle {
Layout.fillHeight: true
color: "transparent"
color: AmneziaStyle.color.transparent
}
BasicButtonType {
@ -247,7 +248,7 @@ PageType {
Rectangle {
Layout.fillHeight: true
color: "transparent"
color: AmneziaStyle.color.transparent
}
BasicButtonType {
@ -261,6 +262,13 @@ PageType {
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
if (!port.textField.acceptableInput &&
ContainerProps.containerTypeToString(dockerContainer) !== "torwebsite" &&
ContainerProps.containerTypeToString(dockerContainer) !== "ikev2") {
port.errorText = qsTr("The port must be in the range of 1 to 65535")
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.install(dockerContainer, port.textFieldText, transportProtoSelector.currentIndex)
}

View file

@ -6,6 +6,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ProtocolEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -34,6 +35,10 @@ PageType {
value: true
}
]
sorters: RoleSorter {
roleName: "installPageOrder"
sortOrder: Qt.AscendingOrder
}
}
ColumnLayout {

View file

@ -5,6 +5,7 @@ import QtQuick.Dialogs
import PageEnum 1.0
import QRCodeReader 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -60,7 +61,7 @@ PageType {
anchors.rightMargin: 16
anchors.bottomMargin: 34
color: "transparent"
color: AmneziaStyle.color.transparent
//radius: 16
QRCodeReader {

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -13,183 +14,44 @@ import "../Components"
PageType {
id: root
property bool isControlsDisabled: false
defaultActiveFocusItem: focusItem
Connections {
target: PageController
ColumnLayout {
id: content
function onGoToPageViewConfig() {
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
anchors.fill: parent
spacing: 0
Image {
id: image
source: "qrc:/images/amneziaBigLogo.png"
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.topMargin: 32
Layout.preferredWidth: 360
Layout.preferredHeight: 287
}
function onClosePage() {
if (stackView.depth <= 1) {
PageController.hideWindow()
return
}
stackView.pop()
Item {
id: focusItem
KeyNavigation.tab: startButton
}
function onGoToPage(page, slide) {
var pagePath = PageController.getPagePath(page)
if (slide) {
stackView.push(pagePath, { "objectName" : pagePath }, StackView.PushTransition)
} else {
stackView.push(pagePath, { "objectName" : pagePath }, StackView.Immediate)
}
}
BasicButtonType {
id: startButton
Layout.fillWidth: true
Layout.bottomMargin: 48
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.alignment: Qt.AlignBottom
function onGoToStartPage() {
while (stackView.depth > 1) {
stackView.pop()
}
}
text: qsTr("Let's get started")
function onDisableControls(disabled) {
isControlsDisabled = disabled
}
function onDisableTabBar(disabled) {
isControlsDisabled = disabled
}
function onEscapePressed() {
if (isControlsDisabled) {
return
clickedFunc: function() {
PageController.goToPage(PageEnum.PageSetupWizardConfigSource)
}
PageController.closePage()
}
}
Connections {
target: SettingsController
function onRestoreBackupFinished() {
PageController.showNotificationMessage(qsTr("Settings restored from backup file"))
PageController.replaceStartPage()
}
}
Connections {
target: InstallController
function onInstallationErrorOccurred(errorMessage) {
PageController.showBusyIndicator(false)
PageController.showErrorMessage(errorMessage)
var currentPageName = stackView.currentItem.objectName
if (currentPageName === PageController.getPagePath(PageEnum.PageSetupWizardInstalling)) {
PageController.closePage()
}
}
}
Connections {
target: ImportController
function onRestoreAppConfig(data) {
PageController.showBusyIndicator(true)
SettingsController.restoreAppConfigFromData(data)
PageController.showBusyIndicator(false)
}
function onImportErrorOccurred(errorMessage, goToPageHome) {
PageController.showErrorMessage(errorMessage)
}
}
FlickableType {
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
Image {
id: image
source: "qrc:/images/amneziaBigLogo.png"
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 32
Layout.leftMargin: 8
Layout.rightMargin: 8
Layout.preferredWidth: 344
Layout.preferredHeight: 279
}
ParagraphTextType {
Layout.fillWidth: true
Layout.topMargin: 50
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Free service for creating a personal VPN on your server.") +
qsTr(" Helps you access blocked content without revealing your privacy, even to VPN providers.")
}
Item {
id: focusItem
KeyNavigation.tab: startButton
}
BasicButtonType {
id: startButton
Layout.fillWidth: true
Layout.topMargin: 32
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("I have the data to connect")
clickedFunc: function() {
connectionTypeSelection.open()
}
KeyNavigation.tab: startButton2
}
BasicButtonType {
id: startButton2
Layout.fillWidth: true
Layout.topMargin: 8
Layout.leftMargin: 16
Layout.rightMargin: 16
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
borderWidth: 1
text: qsTr("I have nothing")
clickedFunc: function() {
Qt.openUrlExternally(qsTr("https://amnezia.org/instructions/0_starter-guide"))
}
Keys.onTabPressed: lastItemTabClicked(focusItem)
}
}
}
ConnectionTypeSelectionDrawer {
id: connectionTypeSelection
onClosed: {
PageController.forceTabBarActiveFocus()
root.defaultActiveFocusItem.forceActiveFocus()
Keys.onTabPressed: lastItemTabClicked(focusItem)
}
}
}

View file

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -36,7 +37,7 @@ PageType {
Connections {
target: ImportController
function onImportErrorOccurred(errorMessage, goToPageHome) {
function onImportErrorOccurred(error, goToPageHome) {
if (goToPageHome) {
PageController.goToStartPage()
} else {
@ -50,10 +51,7 @@ PageType {
ServersModel.processedIndex = ServersModel.defaultIndex
}
PageController.goToStartPage()
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) {
PageController.replaceStartPage()
}
PageController.goToPageHome()
}
}
@ -102,11 +100,11 @@ PageType {
Layout.leftMargin: -8
implicitHeight: 32
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#FBB26A"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.goldenApricot
text: showContent ? qsTr("Collapse content") : qsTr("Show content")
KeyNavigation.tab: connectButton
@ -135,8 +133,8 @@ PageType {
iconPath: "qrc:/images/controls/alert-circle.svg"
textColor: "#EB5757"
imageColor: "#EB5757"
textColor: AmneziaStyle.color.vibrantRed
imageColor: AmneziaStyle.color.vibrantRed
}
WarningType {
@ -155,7 +153,7 @@ PageType {
implicitHeight: configContent.implicitHeight
radius: 10
color: "#1C1D21"
color: AmneziaStyle.color.onyxBlack
visible: showContent
@ -176,7 +174,7 @@ PageType {
Rectangle {
anchors.fill: columnContent
anchors.bottomMargin: -24
color: "#0E0E11"
color: AmneziaStyle.color.midnightBlack
opacity: 0.8
}

View file

@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -78,7 +79,7 @@ PageType {
}
case PageShare.ConfigType.ShadowSocks: {
ExportController.generateShadowSocksConfig()
shareConnectionDrawer.configCaption = qsTr("Save ShadowSocks config")
shareConnectionDrawer.configCaption = qsTr("Save Shadowsocks config")
shareConnectionDrawer.configExtension = ".json"
shareConnectionDrawer.configFileName = "amnezia_for_shadowsocks"
break
@ -102,9 +103,10 @@ PageType {
PageController.showBusyIndicator(false)
}
function onExportErrorOccurred(errorMessage) {
function onExportErrorOccurred(error) {
shareConnectionDrawer.close()
PageController.showErrorMessage(errorMessage)
PageController.showErrorMessage(error)
}
}
@ -137,7 +139,7 @@ PageType {
}
QtObject {
id: shadowSocksConnectionFormat
property string name: qsTr("ShadowSocks native format")
property string name: qsTr("Shadowsocks native format")
property var type: PageShare.ConfigType.ShadowSocks
}
QtObject {
@ -200,7 +202,7 @@ PageType {
parent: root
anchors.fill: parent
expandedHeight: root.height * 0.45
expandedHeight: root.height
onClosed: {
if (!GC.isMobile()) {
clientNameTextField.textField.forceActiveFocus()
@ -208,6 +210,7 @@ PageType {
}
expandedContent: ColumnLayout {
id: shareFullAccessDrawerContent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@ -215,6 +218,10 @@ PageType {
spacing: 0
onImplicitHeightChanged: {
shareFullAccessDrawer.expandedHeight = shareFullAccessDrawerContent.implicitHeight + 32
}
Connections {
target: shareFullAccessDrawer
enabled: !GC.isMobile()
@ -266,7 +273,7 @@ PageType {
implicitWidth: accessTypeSelectorContent.implicitWidth
implicitHeight: accessTypeSelectorContent.implicitHeight
color: "#1C1D21"
color: AmneziaStyle.color.onyxBlack
radius: 16
RowLayout {
@ -320,7 +327,7 @@ PageType {
visible: accessTypeSelector.currentIndex === 0
text: qsTr("Share VPN access without the ability to manage the server")
color: "#878B91"
color: AmneziaStyle.color.mutedGray
}
TextFieldWithHeaderType {
@ -651,7 +658,7 @@ PageType {
ImageButtonType {
id: closeSearchButton
image: "qrc:/images/controls/close.svg"
imageColor: "#D7D8DB"
imageColor: AmneziaStyle.color.paleGray
Keys.onTabPressed: {
if (!GC.isMobile()) {
@ -765,7 +772,8 @@ PageType {
}
}
anchors.fill: parent
width: root.width
height: root.height
expandedContent: ColumnLayout {
id: expandedContent
@ -776,8 +784,6 @@ PageType {
anchors.leftMargin: 16
anchors.rightMargin: 16
spacing: 8
onImplicitHeightChanged: {
clientInfoDrawer.expandedHeight = expandedContent.implicitHeight + 32
}
@ -790,49 +796,54 @@ PageType {
}
}
Header2Type {
Layout.fillWidth: true
headerText: clientName
}
ColumnLayout
{
id: textColumn
property string textColor: "#878B91"
Header2TextType {
Layout.maximumWidth: parent.width
Layout.bottomMargin: 24
ParagraphTextType {
color: textColumn.textColor
visible: creationDate
Layout.fillWidth: true
text: clientName
maximumLineCount: 2
wrapMode: Text.Wrap
elide: Qt.ElideRight
}
text: qsTr("Creation date: %1").arg(creationDate)
}
ParagraphTextType {
color: AmneziaStyle.color.mutedGray
visible: creationDate
Layout.fillWidth: true
ParagraphTextType {
color: textColumn.textColor
visible: latestHandshake
Layout.fillWidth: true
text: qsTr("Creation date: %1").arg(creationDate)
}
text: qsTr("Latest handshake: %1").arg(latestHandshake)
}
ParagraphTextType {
color: AmneziaStyle.color.mutedGray
visible: latestHandshake
Layout.fillWidth: true
ParagraphTextType {
color: textColumn.textColor
visible: dataReceived
Layout.fillWidth: true
text: qsTr("Latest handshake: %1").arg(latestHandshake)
}
text: qsTr("Data received: %1").arg(dataReceived)
}
ParagraphTextType {
color: AmneziaStyle.color.mutedGray
visible: dataReceived
Layout.fillWidth: true
ParagraphTextType {
color: textColumn.textColor
visible: dataSent
Layout.fillWidth: true
text: qsTr("Data received: %1").arg(dataReceived)
}
text: qsTr("Data sent: %1").arg(dataSent)
}
ParagraphTextType {
color: AmneziaStyle.color.mutedGray
visible: dataSent
Layout.fillWidth: true
text: qsTr("Data sent: %1").arg(dataSent)
}
ParagraphTextType {
color: AmneziaStyle.color.mutedGray
visible: allowedIps
Layout.fillWidth: true
text: qsTr("Allowed IPs: %1").arg(allowedIps)
}
Item {
@ -845,11 +856,11 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 24
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Rename")
@ -937,12 +948,13 @@ PageType {
BasicButtonType {
id: revokeButton
Layout.fillWidth: true
Layout.topMargin: 8
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Revoke")

View file

@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0
import ContainerProps 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -66,7 +67,7 @@ PageType {
text: qsTr("We recommend that you use full access to the server only for your own additional devices.\n") +
qsTr("If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. ")
color: "#878B91"
color: AmneziaStyle.color.mutedGray
}
DropDownType {
@ -139,22 +140,23 @@ PageType {
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
PageController.showBusyIndicator(true)
if (Qt.platform.os === "android" && !SystemController.isAuthenticated()) {
PageController.showBusyIndicator(false)
ExportController.exportErrorOccurred(qsTr("Access error!"))
return
} else {
ExportController.generateFullAccessConfig()
}
shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text
shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text
shareConnectionDrawer.open()
shareConnectionDrawer.contentVisible = false
PageController.showBusyIndicator(true)
if (Qt.platform.os === "android") {
ExportController.generateFullAccessConfigAndroid();
} else {
ExportController.generateFullAccessConfig();
}
shareConnectionDrawer.contentVisible = true
PageController.showBusyIndicator(false)
shareConnectionDrawer.contentVisible = true
}
}
}

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts
import QtQuick.Shapes
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
@ -23,8 +24,14 @@ PageType {
target: PageController
function onGoToPageHome() {
tabBar.setCurrentIndex(0)
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
if (PageController.isStartPageVisible()) {
tabBar.visible = false
tabBarStackView.goToTabBarPage(PageEnum.PageSetupWizardStart)
} else {
tabBar.visible = true
tabBar.setCurrentIndex(0)
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
}
}
function onGoToPageSettings() {
@ -64,7 +71,6 @@ PageType {
}
function onGoToStartPage() {
connectionTypeSelection.close()
while (tabBarStackView.depth > 1) {
tabBarStackView.pop()
}
@ -77,9 +83,9 @@ PageType {
var pageName = tabBarStackView.currentItem.objectName
if ((pageName === PageController.getPagePath(PageEnum.PageShare)) ||
(pageName === PageController.getPagePath(PageEnum.PageSettings))) {
(pageName === PageController.getPagePath(PageEnum.PageSettings)) ||
(pageName === PageController.getPagePath(PageEnum.PageSetupWizardConfigSource))) {
PageController.goToPageHome()
tabBar.previousIndex = 0
} else {
PageController.closePage()
}
@ -99,9 +105,10 @@ PageType {
Connections {
target: InstallController
function onInstallationErrorOccurred(errorMessage) {
function onInstallationErrorOccurred(error) {
PageController.showBusyIndicator(false)
PageController.showErrorMessage(errorMessage)
PageController.showErrorMessage(error)
var needCloseCurrentPage = false
var currentPageName = tabBarStackView.currentItem.objectName
@ -116,6 +123,10 @@ PageType {
}
}
function onWrongInstallationUser(message) {
onInstallationErrorOccurred(message)
}
function onUpdateContainerFinished(message) {
PageController.showNotificationMessage(message)
PageController.closePage()
@ -124,6 +135,33 @@ PageType {
function onCachedProfileCleared(message) {
PageController.showNotificationMessage(message)
}
function onApiConfigRemoved(message) {
PageController.showNotificationMessage(message)
}
function onInstallServerFromApiFinished(message) {
PageController.showBusyIndicator(false)
if (!ConnectionController.isConnected) {
ServersModel.setDefaultServerIndex(ServersModel.getServersCount() - 1);
ServersModel.processedIndex = ServersModel.defaultIndex
}
PageController.goToPageHome()
PageController.showNotificationMessage(message)
}
function onChangeApiCountryFinished(message) {
PageController.showBusyIndicator(false)
PageController.goToPageHome()
PageController.showNotificationMessage(message)
}
function onReloadServerFromApiFinished(message) {
PageController.goToPageHome()
PageController.showNotificationMessage(message)
}
}
Connections {
@ -146,8 +184,14 @@ PageType {
Connections {
target: ImportController
function onImportErrorOccurred(errorMessage, goToPageHome) {
PageController.showErrorMessage(errorMessage)
function onImportErrorOccurred(error, goToPageHome) {
PageController.showErrorMessage(error)
}
function onRestoreAppConfig(data) {
PageController.showBusyIndicator(true)
SettingsController.restoreAppConfigFromData(data)
PageController.showBusyIndicator(false)
}
}
@ -157,6 +201,19 @@ PageType {
function onLoggingDisableByWatcher() {
PageController.showNotificationMessage(qsTr("Logging was disabled after 14 days, log files were deleted"))
}
function onRestoreBackupFinished() {
PageController.showNotificationMessage(qsTr("Settings restored from backup file"))
PageController.goToPageHome()
}
function onLoggingStateChanged() {
if (SettingsController.isLoggingEnabled) {
var message = qsTr("Logging is enabled. Note that logs will be automatically" +
"disabled after 14 days, and all log files will be deleted.")
PageController.showNotificationMessage(message)
}
}
}
StackViewType {
@ -167,31 +224,37 @@ PageType {
anchors.left: parent.left
anchors.bottom: tabBar.top
width: parent.width
height: root.height - tabBar.implicitHeight
enabled: !root.isControlsDisabled
function goToTabBarPage(page) {
connectionTypeSelection.close()
var pagePath = PageController.getPagePath(page)
tabBarStackView.clear(StackView.Immediate)
tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate)
}
Component.onCompleted: {
var pagePath = PageController.getPagePath(PageEnum.PageHome)
ServersModel.processedIndex = ServersModel.defaultIndex
var pagePath
if (PageController.isStartPageVisible()) {
tabBar.visible = false
pagePath = PageController.getPagePath(PageEnum.PageSetupWizardStart)
} else {
tabBar.visible = true
pagePath = PageController.getPagePath(PageEnum.PageHome)
ServersModel.processedIndex = ServersModel.defaultIndex
}
tabBarStackView.push(pagePath, { "objectName" : pagePath })
}
Keys.onPressed: function(event) {
PageController.keyPressEvent(event.key)
event.accepted = true
}
}
TabBar {
id: tabBar
property int previousIndex: 0
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
@ -201,6 +264,8 @@ PageType {
leftPadding: 96
rightPadding: 96
height: visible ? homeTabButton.implicitHeight + tabBar.topPadding + tabBar.bottomPadding : 0
enabled: !root.isControlsDisabled && !root.isTabBarDisabled
background: Shape {
@ -212,13 +277,13 @@ PageType {
startY: 0
PathLine { x: width; y: 0 }
PathLine { x: width; y: height - 1 }
PathLine { x: 0; y: height - 1 }
PathLine { x: width; y: tabBar.height - 1 }
PathLine { x: 0; y: tabBar.height - 1 }
PathLine { x: 0; y: 0 }
strokeWidth: 1
strokeColor: "#2C2D30"
fillColor: "#1C1D21"
strokeColor: AmneziaStyle.color.slateGray
fillColor: AmneziaStyle.color.onyxBlack
}
}
@ -230,7 +295,6 @@ PageType {
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
ServersModel.processedIndex = ServersModel.defaultIndex
tabBar.currentIndex = 0
tabBar.previousIndex = 0
}
KeyNavigation.tab: shareTabButton
@ -259,7 +323,6 @@ PageType {
clickedFunc: function () {
tabBarStackView.goToTabBarPage(PageEnum.PageShare)
tabBar.currentIndex = 1
tabBar.previousIndex = 1
}
KeyNavigation.tab: settingsTabButton
@ -272,7 +335,6 @@ PageType {
clickedFunc: function () {
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)
tabBar.currentIndex = 2
tabBar.previousIndex = 2
}
KeyNavigation.tab: plusTabButton
@ -283,19 +345,11 @@ PageType {
isSelected: tabBar.currentIndex === 3
image: "qrc:/images/controls/plus.svg"
clickedFunc: function () {
connectionTypeSelection.open()
tabBarStackView.goToTabBarPage(PageEnum.PageSetupWizardConfigSource)
tabBar.currentIndex = 3
}
Keys.onTabPressed: PageController.forceStackActiveFocus()
}
}
ConnectionTypeSelectionDrawer {
id: connectionTypeSelection
onAboutToHide: {
PageController.forceTabBarActiveFocus()
tabBar.setCurrentIndex(tabBar.previousIndex)
}
}
}

View file

@ -5,10 +5,12 @@ import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "Config"
import "Controls2"
import "Components"
import "Pages2"
Window {
id: root
@ -21,7 +23,7 @@ Window {
maximumWidth: 600
maximumHeight: 800
color: "#0E0E11"
color: AmneziaStyle.color.midnightBlack
onClosing: function() {
console.debug("QML onClosing signal")
@ -30,34 +32,9 @@ Window {
title: "AmneziaVPN"
StackViewType {
id: rootStackView
width: root.width
height: root.height
focus: true
Component.onCompleted: {
var pagePath = PageController.getInitialPage()
rootStackView.push(pagePath, { "objectName" : pagePath })
}
Keys.onPressed: function(event) {
PageController.keyPressEvent(event.key)
event.accepted = true
}
}
Connections {
target: PageController
function onReplaceStartPage() {
var pagePath = PageController.getInitialPage()
rootStackView.clear()
PageController.updateNavigationBarColor(PageController.getInitialPageNavigationBarColor())
rootStackView.replace(pagePath, { "objectName" : pagePath })
}
function onRaiseMainWindow() {
root.show()
root.raise()
@ -106,6 +83,11 @@ Window {
}
}
PageStart {
width: root.width
height: root.height
}
Item {
anchors.right: parent.right
anchors.left: parent.left
@ -198,11 +180,11 @@ Window {
Layout.fillWidth: true
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
borderWidth: 1
text: qsTr("Save")