added page transition effects
- added functionality for buttons on PageSettingsServerData page
This commit is contained in:
parent
1e180489a4
commit
de0cd976de
38 changed files with 656 additions and 335 deletions
|
|
@ -7,7 +7,7 @@ import ConnectionState 1.0
|
|||
Button {
|
||||
id: root
|
||||
|
||||
text: "Подключиться"
|
||||
text: qsTr("Connect")
|
||||
|
||||
background: Image {
|
||||
id: border
|
||||
|
|
@ -60,37 +60,37 @@ Button {
|
|||
case ConnectionState.Disconnected: {
|
||||
console.log("Disconnected")
|
||||
connectionProccess.running = false
|
||||
root.text = "Подключиться"
|
||||
root.text = qsTr("Connect")
|
||||
break
|
||||
}
|
||||
case ConnectionState.Preparing: {
|
||||
console.log("Preparing")
|
||||
connectionProccess.running = true
|
||||
root.text = "Подключение..."
|
||||
root.text = qsTr("Connection...")
|
||||
break
|
||||
}
|
||||
case ConnectionState.Connecting: {
|
||||
console.log("Connecting")
|
||||
connectionProccess.running = true
|
||||
root.text = "Подключение..."
|
||||
root.text = qsTr("Connection...")
|
||||
break
|
||||
}
|
||||
case ConnectionState.Connected: {
|
||||
console.log("Connected")
|
||||
connectionProccess.running = false
|
||||
root.text = "Подключено"
|
||||
root.text = qsTr("Connected")
|
||||
break
|
||||
}
|
||||
case ConnectionState.Disconnecting: {
|
||||
console.log("Disconnecting")
|
||||
connectionProccess.running = true
|
||||
root.text = "Отключение..."
|
||||
root.text = qsTr("Disconnection...")
|
||||
break
|
||||
}
|
||||
case ConnectionState.Reconnecting: {
|
||||
console.log("Reconnecting")
|
||||
connectionProccess.running = true
|
||||
root.text = "Переподключение..."
|
||||
root.text = qsTr("Reconnection...")
|
||||
break
|
||||
}
|
||||
case ConnectionState.Error: {
|
||||
|
|
|
|||
|
|
@ -8,16 +8,12 @@ import "../Controls2"
|
|||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
|
||||
Drawer {
|
||||
DrawerType {
|
||||
id: root
|
||||
|
||||
edge: Qt.BottomEdge
|
||||
width: parent.width
|
||||
height: parent.height * 0.4375
|
||||
|
||||
clip: true
|
||||
modal: true
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: -radius
|
||||
|
|
|
|||
|
|
@ -29,64 +29,23 @@ ListView {
|
|||
implicitWidth: rootWidth
|
||||
implicitHeight: containerRadioButton.implicitHeight
|
||||
|
||||
RadioButton {
|
||||
VerticalRadioButton {
|
||||
id: containerRadioButton
|
||||
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: containerRadioButtonContent.implicitHeight
|
||||
anchors.fill: parent
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
hoverEnabled: true
|
||||
text: name
|
||||
descriptionText: description
|
||||
|
||||
ButtonGroup.group: containersRadioButtonGroup
|
||||
|
||||
checked: isDefault
|
||||
|
||||
indicator: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: containerRadioButton.hovered ? "#2C2D30" : "#1C1D21"
|
||||
|
||||
Behavior on color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
}
|
||||
imageSource: "qrc:/images/controls/download.svg"
|
||||
showImage: !isInstalled
|
||||
|
||||
checkable: isInstalled
|
||||
|
||||
RowLayout {
|
||||
id: containerRadioButtonContent
|
||||
anchors.fill: parent
|
||||
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
z: 1
|
||||
|
||||
Image {
|
||||
source: isInstalled ? "qrc:/images/controls/check.svg" : "qrc:/images/controls/download.svg"
|
||||
visible: isInstalled ? containerRadioButton.checked : true
|
||||
|
||||
width: 24
|
||||
height: 24
|
||||
|
||||
Layout.rightMargin: 8
|
||||
}
|
||||
|
||||
Text {
|
||||
id: containerRadioButtonText
|
||||
|
||||
text: name
|
||||
color: "#D7D8DB"
|
||||
font.pixelSize: 16
|
||||
font.weight: 400
|
||||
font.family: "PT Root UI VF"
|
||||
|
||||
height: 24
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
Layout.bottomMargin: 20
|
||||
}
|
||||
}
|
||||
checked: isDefault
|
||||
|
||||
onClicked: {
|
||||
if (checked) {
|
||||
|
|
@ -14,6 +14,7 @@ import "../Controls2/TextTypes"
|
|||
ListView {
|
||||
id: root
|
||||
|
||||
width: parent.width
|
||||
height: root.contentItem.height
|
||||
|
||||
clip: true
|
||||
|
|
@ -23,7 +24,7 @@ ListView {
|
|||
}
|
||||
|
||||
delegate: Item {
|
||||
implicitWidth: parent.width
|
||||
implicitWidth: root.width
|
||||
implicitHeight: containerRadioButton.implicitHeight
|
||||
|
||||
RadioButton {
|
||||
20
client/ui/qml/Controls2/DrawerType.qml
Normal file
20
client/ui/qml/Controls2/DrawerType.qml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Drawer {
|
||||
edge: Qt.BottomEdge
|
||||
|
||||
clip: true
|
||||
modal: true
|
||||
|
||||
enter: Transition {
|
||||
SmoothedAnimation {
|
||||
velocity: 4
|
||||
}
|
||||
}
|
||||
exit: Transition {
|
||||
SmoothedAnimation {
|
||||
velocity: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -111,16 +111,12 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Drawer {
|
||||
DrawerType {
|
||||
id: menu
|
||||
|
||||
edge: Qt.BottomEdge
|
||||
width: parent.width
|
||||
height: parent.height * 0.9
|
||||
|
||||
clip: true
|
||||
modal: true
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: -radius
|
||||
|
|
|
|||
|
|
@ -8,10 +8,11 @@ Item {
|
|||
property StackView stackView: StackView.view
|
||||
|
||||
function goToPage(page, slide = true) {
|
||||
var pagePath = PageController.getPagePath(page)
|
||||
if (slide) {
|
||||
root.stackView.push(PageController.getPagePath(page), {}, StackView.PushTransition)
|
||||
root.stackView.push(pagePath, { "objectName" : pagePath }, StackView.PushTransition)
|
||||
} else {
|
||||
root.stackView.push(PageController.getPagePath(page), {}, StackView.Immediate)
|
||||
root.stackView.push(pagePath, { "objectName" : pagePath }, StackView.Immediate)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
61
client/ui/qml/Controls2/StackViewType.qml
Normal file
61
client/ui/qml/Controls2/StackViewType.qml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
StackView {
|
||||
id: root
|
||||
|
||||
pushEnter: Transition {
|
||||
PropertyAnimation {
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to:1
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
|
||||
pushExit: Transition {
|
||||
PropertyAnimation {
|
||||
property: "opacity"
|
||||
from: 1
|
||||
to:0
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
|
||||
popEnter: Transition {
|
||||
PropertyAnimation {
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to:1
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
|
||||
popExit: Transition {
|
||||
PropertyAnimation {
|
||||
property: "opacity"
|
||||
from: 1
|
||||
to:0
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
|
||||
replaceEnter: Transition {
|
||||
PropertyAnimation {
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to:1
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
|
||||
replaceExit: Transition {
|
||||
PropertyAnimation {
|
||||
property: "opacity"
|
||||
from: 1
|
||||
to:0
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,6 +59,7 @@ Switch {
|
|||
}
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
contentItem: ColumnLayout {
|
||||
id: content
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import QtQuick.Controls
|
|||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import "TextTypes"
|
||||
|
||||
RadioButton {
|
||||
id: root
|
||||
|
||||
|
|
@ -13,7 +15,8 @@ RadioButton {
|
|||
property string disabledColor: Qt.rgba(1, 1, 1, 0)
|
||||
property string selectedColor: Qt.rgba(1, 1, 1, 0)
|
||||
|
||||
property string textColor: "#0E0E11"
|
||||
property string textColor: "#D7D8DB"
|
||||
property string selectedTextColor: "#FBB26A"
|
||||
|
||||
property string pressedBorderColor: Qt.rgba(251/255, 178/255, 106/255, 0.3)
|
||||
property string selectedBorderColor: "#FBB26A"
|
||||
|
|
@ -26,11 +29,16 @@ RadioButton {
|
|||
|
||||
property string defaultInnerCircleColor: "#FBB26A"
|
||||
|
||||
property string imageSource
|
||||
property bool showImage
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
indicator: Rectangle {
|
||||
id: background
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
implicitWidth: 56
|
||||
implicitHeight: 56
|
||||
radius: 16
|
||||
|
|
@ -52,6 +60,16 @@ RadioButton {
|
|||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
|
||||
Image {
|
||||
source: imageSource
|
||||
visible: showImage
|
||||
|
||||
anchors.centerIn: parent
|
||||
|
||||
width: 24
|
||||
height: 24
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: outerCircle
|
||||
|
||||
|
|
@ -59,6 +77,8 @@ RadioButton {
|
|||
height: 24
|
||||
radius: 16
|
||||
|
||||
visible: !showImage
|
||||
|
||||
anchors.centerIn: parent
|
||||
|
||||
color: "transparent"
|
||||
|
|
@ -120,34 +140,41 @@ RadioButton {
|
|||
|
||||
contentItem: ColumnLayout {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 8 + background.width
|
||||
|
||||
Text {
|
||||
text: root.text
|
||||
wrapMode: Text.WordWrap
|
||||
color: "#D7D8DB"
|
||||
font.pixelSize: 16
|
||||
font.weight: 400
|
||||
font.family: "PT Root UI VF"
|
||||
spacing: 4
|
||||
|
||||
ListItemTitleType {
|
||||
text: root.text
|
||||
|
||||
color: {
|
||||
if (root.checked) {
|
||||
return selectedTextColor
|
||||
}
|
||||
return textColor
|
||||
}
|
||||
|
||||
height: 24
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
Layout.bottomMargin: description.visible ? 0 : 16
|
||||
|
||||
Behavior on color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
font.family: "PT Root UI VF"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 13
|
||||
font.letterSpacing: 0.02
|
||||
CaptionTextType {
|
||||
id: description
|
||||
|
||||
color: "#878B91"
|
||||
text: root.descriptionText
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
visible: root.descriptionText !== ""
|
||||
|
||||
Layout.fillWidth: true
|
||||
height: 16
|
||||
Layout.bottomMargin: 16
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,17 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: PageController
|
||||
|
||||
function onRestorePageHomeState(isContainerInstalled) {
|
||||
menu.visible = true
|
||||
if (isContainerInstalled) {
|
||||
containersDropDown.menuVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: buttonBackground
|
||||
anchors.fill: buttonContent
|
||||
|
|
@ -96,16 +107,12 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
Drawer {
|
||||
DrawerType {
|
||||
id: menu
|
||||
|
||||
edge: Qt.BottomEdge
|
||||
width: parent.width
|
||||
height: parent.height * 0.90
|
||||
|
||||
clip: true
|
||||
modal: true
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: -radius
|
||||
|
|
@ -180,7 +187,7 @@ PageType {
|
|||
containersDropDown.menuVisible = true
|
||||
}
|
||||
|
||||
listView: ContainersPageHomeListView {
|
||||
listView: HomeContainersListView {
|
||||
rootWidth: root.width
|
||||
|
||||
model: proxyContainersModel
|
||||
|
|
@ -251,81 +258,63 @@ PageType {
|
|||
property variant delegateData: model
|
||||
|
||||
implicitWidth: serversMenuContent.width
|
||||
implicitHeight: serverRadioButton.implicitHeight
|
||||
implicitHeight: serverRadioButtonContent.implicitHeight
|
||||
|
||||
RadioButton {
|
||||
id: serverRadioButton
|
||||
ColumnLayout {
|
||||
id: serverRadioButtonContent
|
||||
anchors.fill: parent
|
||||
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: serverRadioButtonContent.implicitHeight
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
checked: index === serversMenuContent.currentIndex
|
||||
|
||||
ButtonGroup.group: serversRadioButtonGroup
|
||||
|
||||
indicator: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: serverRadioButton.hovered ? "#2C2D30" : "#1C1D21"
|
||||
|
||||
Behavior on color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
}
|
||||
spacing: 0
|
||||
|
||||
RowLayout {
|
||||
id: serverRadioButtonContent
|
||||
anchors.fill: parent
|
||||
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
z: 1
|
||||
|
||||
Image {
|
||||
source: "qrc:/images/controls/check.svg"
|
||||
visible: serverRadioButton.checked
|
||||
width: 24
|
||||
height: 24
|
||||
|
||||
Layout.rightMargin: 8
|
||||
}
|
||||
|
||||
Text {
|
||||
id: serverRadioButtonText
|
||||
|
||||
text: name
|
||||
color: "#D7D8DB"
|
||||
font.pixelSize: 16
|
||||
font.weight: 400
|
||||
font.family: "PT Root UI VF"
|
||||
|
||||
height: 24
|
||||
VerticalRadioButton {
|
||||
id: serverRadioButton
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
Layout.bottomMargin: 20
|
||||
|
||||
text: name
|
||||
descriptionText: "description"
|
||||
|
||||
checked: index === serversMenuContent.currentIndex
|
||||
|
||||
ButtonGroup.group: serversRadioButtonGroup
|
||||
|
||||
onClicked: {
|
||||
serversMenuContent.currentIndex = index
|
||||
|
||||
isDefault = true
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(index)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: serverRadioButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
image: "qrc:/images/controls/settings.svg"
|
||||
|
||||
// onClicked:
|
||||
implicitWidth: 56
|
||||
implicitHeight: 56
|
||||
|
||||
z: 1
|
||||
|
||||
onClicked: function() {
|
||||
ServersModel.setCurrentlyProcessedServerIndex(index)
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(index)
|
||||
goToPage(PageEnum.PageSettingsServerInfo)
|
||||
menu.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
serversMenuContent.currentIndex = index
|
||||
|
||||
ServersModel.setDefaultServerIndex(index)
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(index)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: serverRadioButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
enabled: false
|
||||
DividerType {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,142 +1,109 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import ContainerProps 1.0
|
||||
import ProtocolProps 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyServersModel
|
||||
sourceModel: ServersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "isCurrentlyProcessed"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: root.top
|
||||
anchors.bottom: root.bottom
|
||||
contentHeight: content.height
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
spacing: 16
|
||||
HeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
Repeater {
|
||||
id: header
|
||||
model: proxyServersModel
|
||||
headerText: qsTr("Settings")
|
||||
}
|
||||
|
||||
delegate: HeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
actionButtonImage: "qrc:/images/controls/edit-3.svg"
|
||||
backButtonImage: "qrc:/images/controls/arrow-left.svg"
|
||||
text: qsTr("Servers")
|
||||
buttonImage: "qrc:/images/controls/chevron-right.svg"
|
||||
iconImage: "qrc:/images/controls/server.svg"
|
||||
|
||||
headerText: name
|
||||
descriptionText: hostName
|
||||
|
||||
actionButtonFunction: function() {
|
||||
connectionTypeSelection.visible = true
|
||||
}
|
||||
|
||||
backButtonFunction: function() {
|
||||
closePage()
|
||||
}
|
||||
clickedFunction: function() {
|
||||
goToPage(PageEnum.PageSettingsServersList)
|
||||
}
|
||||
}
|
||||
|
||||
TabBar {
|
||||
id: tabBar
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
text: qsTr("Connection")
|
||||
buttonImage: "qrc:/images/controls/chevron-right.svg"
|
||||
iconImage: "qrc:/images/controls/radio.svg"
|
||||
|
||||
TabButtonType {
|
||||
isSelected: tabBar.currentIndex === 0
|
||||
text: qsTr("Protocols")
|
||||
}
|
||||
TabButtonType {
|
||||
isSelected: tabBar.currentIndex === 1
|
||||
text: qsTr("Services")
|
||||
}
|
||||
TabButtonType {
|
||||
isSelected: tabBar.currentIndex === 2
|
||||
text: qsTr("Data")
|
||||
clickedFunction: function() {
|
||||
}
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
id: stackLayout
|
||||
currentIndex: tabBar.currentIndex
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
height: root.height
|
||||
|
||||
StackView {
|
||||
id: protocolsStackView
|
||||
initialItem: PageSettingsContainersListView {
|
||||
model: SortFilterProxyModel {
|
||||
sourceModel: ContainersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Vpn
|
||||
},
|
||||
ValueFilter {
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
text: qsTr("Application")
|
||||
buttonImage: "qrc:/images/controls/chevron-right.svg"
|
||||
iconImage: "qrc:/images/controls/app.svg"
|
||||
|
||||
StackView {
|
||||
id: servicesStackView
|
||||
initialItem: PageSettingsContainersListView {
|
||||
model: SortFilterProxyModel {
|
||||
sourceModel: ContainersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Other
|
||||
},
|
||||
ValueFilter {
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StackView {
|
||||
id: dataStackView
|
||||
initialItem: PageSettingsData {
|
||||
|
||||
}
|
||||
clickedFunction: function() {
|
||||
goToPage(PageEnum.PageSetupWizardTextKey)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Backup")
|
||||
buttonImage: "qrc:/images/controls/chevron-right.svg"
|
||||
iconImage: "qrc:/images/controls/save.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
goToPage(PageEnum.PageSetupWizardTextKey)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("About AmneziaVPN")
|
||||
buttonImage: "qrc:/images/controls/chevron-right.svg"
|
||||
iconImage: "qrc:/images/controls/amnezia.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
goToPage(PageEnum.PageSetupWizardTextKey)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ PageType {
|
|||
descriptionText: "May be needed when changing other settings"
|
||||
|
||||
clickedFunction: function() {
|
||||
ContainersModel.clearCachedProfiles()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -45,6 +46,15 @@ PageType {
|
|||
textColor: "#EB5757"
|
||||
|
||||
clickedFunction: function() {
|
||||
if (ServersModel.isDefaultServerCurrentlyProcessed && ConnectionController.isConnected()) {
|
||||
ConnectionController.closeVpnConnection()
|
||||
}
|
||||
ServersModel.removeServer()
|
||||
if (!ServersModel.getServersCount()) {
|
||||
PageController.replaceStartPage()
|
||||
} else {
|
||||
goToStartPage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,6 +67,9 @@ PageType {
|
|||
textColor: "#EB5757"
|
||||
|
||||
clickedFunction: function() {
|
||||
if (ServersModel.isDefaultServerCurrentlyProcessed && ConnectionController.isConnected()) {
|
||||
ConnectionController.closeVpnConnection()
|
||||
}
|
||||
ContainersModel.removeAllContainers()
|
||||
}
|
||||
}
|
||||
134
client/ui/qml/Pages2/PageSettingsServerInfo.qml
Normal file
134
client/ui/qml/Pages2/PageSettingsServerInfo.qml
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import ContainerProps 1.0
|
||||
import ProtocolProps 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyServersModel
|
||||
sourceModel: ServersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "isCurrentlyProcessed"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
spacing: 16
|
||||
|
||||
Repeater {
|
||||
id: header
|
||||
model: proxyServersModel
|
||||
|
||||
delegate: HeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
actionButtonImage: "qrc:/images/controls/edit-3.svg"
|
||||
backButtonImage: "qrc:/images/controls/arrow-left.svg"
|
||||
|
||||
headerText: name
|
||||
descriptionText: hostName
|
||||
|
||||
actionButtonFunction: function() {
|
||||
connectionTypeSelection.visible = true
|
||||
}
|
||||
|
||||
backButtonFunction: function() {
|
||||
closePage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TabBar {
|
||||
id: tabBar
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
|
||||
TabButtonType {
|
||||
isSelected: tabBar.currentIndex === 0
|
||||
text: qsTr("Protocols")
|
||||
// onClicked: {
|
||||
// tabBarStackView.goToTabBarPage(PageEnum.PageSettingsServerProtocols)
|
||||
// }
|
||||
}
|
||||
TabButtonType {
|
||||
isSelected: tabBar.currentIndex === 1
|
||||
text: qsTr("Services")
|
||||
// onClicked: {
|
||||
// tabBarStackView.goToTabBarPage(PageEnum.PageSettingsServerServices)
|
||||
// }
|
||||
}
|
||||
TabButtonType {
|
||||
isSelected: tabBar.currentIndex === 2
|
||||
text: qsTr("Data")
|
||||
// onClicked: {
|
||||
// tabBarStackView.goToTabBarPage(PageEnum.PageSettingsServerData)
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
Layout.preferredWidth: root.width
|
||||
Layout.preferredHeight: root.height - tabBar.implicitHeight - header.implicitHeight
|
||||
|
||||
currentIndex: tabBar.currentIndex
|
||||
|
||||
PageSettingsServerProtocols {
|
||||
stackView: root.stackView
|
||||
}
|
||||
PageSettingsServerServices {
|
||||
stackView: root.stackView
|
||||
}
|
||||
PageSettingsServerData {
|
||||
stackView: root.stackView
|
||||
}
|
||||
}
|
||||
|
||||
// StackViewType {
|
||||
// id: tabBarStackView
|
||||
|
||||
// Layout.preferredWidth: root.width
|
||||
// Layout.preferredHeight: root.height - tabBar.implicitHeight - header.implicitHeight
|
||||
|
||||
// function goToTabBarPage(page) {
|
||||
// var pagePath = PageController.getPagePath(page)
|
||||
// while (tabBarStackView.depth > 1) {
|
||||
// tabBarStackView.pop()
|
||||
// }
|
||||
// tabBarStackView.replace(pagePath, { "objectName" : pagePath })
|
||||
// }
|
||||
|
||||
// Component.onCompleted: {
|
||||
// var pagePath = PageController.getPagePath(PageEnum.PageSettingsServerProtocols)
|
||||
// tabBarStackView.push(pagePath, { "objectName" : pagePath })
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
38
client/ui/qml/Pages2/PageSettingsServerProtocols.qml
Normal file
38
client/ui/qml/Pages2/PageSettingsServerProtocols.qml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import ContainerProps 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: containersProxyModel
|
||||
sourceModel: ContainersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Vpn
|
||||
},
|
||||
ValueFilter {
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
SettingsContainersListView {
|
||||
model: containersProxyModel
|
||||
}
|
||||
}
|
||||
38
client/ui/qml/Pages2/PageSettingsServerServices.qml
Normal file
38
client/ui/qml/Pages2/PageSettingsServerServices.qml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import ContainerProps 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: containersProxyModel
|
||||
sourceModel: ContainersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Other
|
||||
},
|
||||
ValueFilter {
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
SettingsContainersListView {
|
||||
model: containersProxyModel
|
||||
}
|
||||
}
|
||||
|
|
@ -36,10 +36,6 @@ PageType {
|
|||
actionButtonFunction: function() {
|
||||
connectionTypeSelection.visible = true
|
||||
}
|
||||
|
||||
backButtonFunction: function() {
|
||||
PageController.goToPageHome()
|
||||
}
|
||||
}
|
||||
|
||||
ConnectionTypeSelectionDrawer {
|
||||
|
|
@ -87,7 +83,8 @@ PageType {
|
|||
|
||||
clickedFunction: function() {
|
||||
ServersModel.setCurrentlyProcessedServerIndex(index)
|
||||
goToPage(PageEnum.PageSettings)
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(index)
|
||||
goToPage(PageEnum.PageSettingsServerInfo)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,10 +26,26 @@ PageType {
|
|||
|
||||
function onInstallContainerFinished() {
|
||||
goToStartPage()
|
||||
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
|
||||
PageController.restorePageHomeState(true)
|
||||
} else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) {
|
||||
goToPage(PageEnum.PageSettingsServersList, false)
|
||||
goToPage(PageEnum.PageSettingsServerInfo, false)
|
||||
} else {
|
||||
goToPage(PageEnum.PageHome)
|
||||
}
|
||||
}
|
||||
|
||||
function onInstallServerFinished() {
|
||||
goToStartPage()
|
||||
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
|
||||
PageController.restorePageHomeState()
|
||||
} else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) {
|
||||
goToPage(PageEnum.PageSettingsServersList, false)
|
||||
} else {
|
||||
var pagePath = PageController.getPagePath(PageEnum.PageStart)
|
||||
stackView.replace(pagePath, { "objectName" : pagePath })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,16 +22,6 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: InstallController
|
||||
|
||||
function onInstallServerFinished() {
|
||||
//todo add smt like changeStartPage
|
||||
goToStartPage()
|
||||
goToPage(PageEnum.PageStart)
|
||||
}
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: root.top
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ PageType {
|
|||
|
||||
function onGoToPageHome() {
|
||||
tabBar.currentIndex = 0
|
||||
tabBarStackView.goToTabBarPage(PageController.getPagePath(PageEnum.PageHome))
|
||||
}
|
||||
|
||||
function onShowErrorMessage(errorMessage) {
|
||||
|
|
@ -25,9 +26,8 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
id: stackLayout
|
||||
currentIndex: tabBar.currentIndex
|
||||
StackViewType {
|
||||
id: tabBarStackView
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
|
|
@ -37,20 +37,15 @@ PageType {
|
|||
width: parent.width
|
||||
height: root.height - tabBar.implicitHeight
|
||||
|
||||
StackView {
|
||||
initialItem: PageHome {
|
||||
id: pageHome
|
||||
}
|
||||
function goToTabBarPage(page) {
|
||||
var pagePath = PageController.getPagePath(page)
|
||||
tabBarStackView.clear(StackView.PopTransition)
|
||||
tabBarStackView.replace(pagePath, { "objectName" : pagePath })
|
||||
}
|
||||
|
||||
Item {
|
||||
|
||||
}
|
||||
|
||||
StackView {
|
||||
initialItem: PageSettingsServersList {
|
||||
id: pageSettingsServersList
|
||||
}
|
||||
Component.onCompleted: {
|
||||
var pagePath = PageController.getPagePath(PageEnum.PageHome)
|
||||
tabBarStackView.push(pagePath, { "objectName" : pagePath })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -70,12 +65,12 @@ PageType {
|
|||
color: "#1C1D21"
|
||||
}
|
||||
|
||||
|
||||
TabImageButtonType {
|
||||
isSelected: tabBar.currentIndex === 0
|
||||
image: "qrc:/images/controls/home.svg"
|
||||
onClicked: {
|
||||
pageSettingsServersList.goToStartPage()
|
||||
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(ServersModel.getDefaultServerIndex())
|
||||
}
|
||||
}
|
||||
TabImageButtonType {
|
||||
|
|
@ -86,7 +81,7 @@ PageType {
|
|||
isSelected: tabBar.currentIndex === 2
|
||||
image: "qrc:/images/controls/settings-2.svg"
|
||||
onClicked: {
|
||||
pageHome.goToStartPage()
|
||||
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@ import QtQuick.Controls
|
|||
import QtQuick.Layouts
|
||||
|
||||
import PageType 1.0
|
||||
import PageEnum 1.0
|
||||
|
||||
import "Config"
|
||||
import "Controls2"
|
||||
|
||||
Window {
|
||||
id: root
|
||||
|
|
@ -27,9 +29,27 @@ Window {
|
|||
color: "#0E0E11"
|
||||
}
|
||||
|
||||
StackView {
|
||||
StackViewType {
|
||||
id: rootStackView
|
||||
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
initialItem: PageController.getInitialPage()
|
||||
|
||||
Component.onCompleted: {
|
||||
var pagePath = PageController.getPagePath(PageEnum.PageStart)
|
||||
rootStackView.push(pagePath, { "objectName" : pagePath })
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: PageController
|
||||
|
||||
function onReplaceStartPage() {
|
||||
var pagePath = PageController.getInitialPage()
|
||||
while (rootStackView.depth > 1) {
|
||||
rootStackView.pop()
|
||||
}
|
||||
rootStackView.replace(pagePath, { "objectName" : pagePath })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue