added output of notifications/errors after installation/import
This commit is contained in:
parent
0411792ca5
commit
1092abe776
39 changed files with 488 additions and 303 deletions
|
|
@ -78,11 +78,5 @@ ListView {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (isDefault) {
|
||||
root.currentContainerName = name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ DrawerType {
|
|||
|
||||
delegate: Item {
|
||||
implicitWidth: root.width
|
||||
implicitHeight: content.implicitHeight
|
||||
implicitHeight: delegateContent.implicitHeight
|
||||
|
||||
ColumnLayout {
|
||||
id: delegateContent
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ CheckBox {
|
|||
id: root
|
||||
|
||||
property string descriptionText
|
||||
property string descriptionTextColor: "#878B91"
|
||||
property string descriptionTextDisabledColor: "#494B50"
|
||||
|
||||
property string textColor: "#D7D8DB"
|
||||
property string textDisabledColor: "#878B91"
|
||||
|
||||
property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
|
||||
property string defaultColor: "transparent"
|
||||
|
|
@ -16,14 +21,16 @@ CheckBox {
|
|||
|
||||
property string defaultBorderColor: "#D7D8DB"
|
||||
property string checkedBorderColor: "#FBB26A"
|
||||
property string checkedBorderDisabledColor: "#5A330C"
|
||||
|
||||
property string checkedImageColor: "#FBB26A"
|
||||
property string pressedImageColor: "#A85809"
|
||||
property string defaultImageColor: "transparent"
|
||||
property string checkedDisabledImageColor: "#84603D"
|
||||
|
||||
property string imageSource: "qrc:/images/controls/check.svg"
|
||||
|
||||
hoverEnabled: true
|
||||
hoverEnabled: enabled ? true : false
|
||||
|
||||
indicator: Rectangle {
|
||||
id: background
|
||||
|
|
@ -52,7 +59,7 @@ CheckBox {
|
|||
width: 24
|
||||
height: 24
|
||||
color: "transparent"
|
||||
border.color: root.checked ? checkedBorderColor : defaultBorderColor
|
||||
border.color: root.checked ? (root.enabled ? checkedBorderColor : checkedBorderDisabledColor) : defaultBorderColor
|
||||
border.width: 1
|
||||
radius: 4
|
||||
|
||||
|
|
@ -63,7 +70,19 @@ CheckBox {
|
|||
layer {
|
||||
enabled: true
|
||||
effect: ColorOverlay {
|
||||
color: root.pressed ? pressedImageColor : root.checked ? checkedImageColor : defaultImageColor
|
||||
color: {
|
||||
if (root.pressed) {
|
||||
return root.pressedImageColor
|
||||
} else if (root.checked) {
|
||||
if (root.enabled) {
|
||||
return root.checkedImageColor
|
||||
} else {
|
||||
return root.checkedDisabledImageColor
|
||||
}
|
||||
} else {
|
||||
return root.defaultImageColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -90,6 +109,7 @@ CheckBox {
|
|||
Layout.fillWidth: true
|
||||
|
||||
text: root.text
|
||||
color: root.enabled ? root.textColor : root.textDisabledColor
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
|
|
@ -98,7 +118,7 @@ CheckBox {
|
|||
Layout.fillWidth: true
|
||||
|
||||
text: root.descriptionText
|
||||
color: "#878b91"
|
||||
color: root.enabled ? root.descriptionTextColor : root.descriptionTextDisabledColor
|
||||
|
||||
visible: root.descriptionText !== ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,16 @@ RadioButton {
|
|||
|
||||
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 checkedColor: Qt.rgba(1, 1, 1, 0)
|
||||
property string disabledColor: "transparent"
|
||||
|
||||
property string textColor: "#0E0E11"
|
||||
property string textColor: "#D7D8DB"
|
||||
property string textDisabledColor: "#878B91"
|
||||
|
||||
property string pressedBorderColor: "#494B50"
|
||||
property string selectedBorderColor: "#FBB26A"
|
||||
property string checkedBorderColor: "#FBB26A"
|
||||
property string defaultBodredColor: "transparent"
|
||||
property string checkedDisabledBorderColor: "#84603D"
|
||||
property int borderWidth: 0
|
||||
|
||||
implicitWidth: content.implicitWidth
|
||||
|
|
@ -27,39 +29,39 @@ RadioButton {
|
|||
radius: 16
|
||||
|
||||
color: {
|
||||
// if (root.enabled) {
|
||||
if (root.enabled) {
|
||||
if (root.hovered) {
|
||||
return hoveredColor
|
||||
return root.hoveredColor
|
||||
} else if (root.checked) {
|
||||
return selectedColor
|
||||
return root.checkedColor
|
||||
}
|
||||
return defaultColor
|
||||
// } else {
|
||||
// return disabledColor
|
||||
// }
|
||||
return root.defaultColor
|
||||
} else {
|
||||
return root.disabledColor
|
||||
}
|
||||
}
|
||||
|
||||
border.color: {
|
||||
// if (root.enabled) {
|
||||
if (root.enabled) {
|
||||
if (root.pressed) {
|
||||
return pressedBorderColor
|
||||
return root.pressedBorderColor
|
||||
} else if (root.checked) {
|
||||
return selectedBorderColor
|
||||
return root.checkedBorderColor
|
||||
}
|
||||
return defaultBodredColor
|
||||
// }
|
||||
// return defaultBodredColor
|
||||
return root.defaultBodredColor
|
||||
} else {
|
||||
if (root.checked) {
|
||||
return root.checkedDisabledBorderColor
|
||||
}
|
||||
return root.defaultBodredColor
|
||||
}
|
||||
}
|
||||
|
||||
border.width: {
|
||||
// if (root.enabled) {
|
||||
if(root.checked) {
|
||||
return 1
|
||||
}
|
||||
return root.pressed ? 1 : 0
|
||||
// } else {
|
||||
// return 0
|
||||
// }
|
||||
if(root.checked) {
|
||||
return 1
|
||||
}
|
||||
return root.pressed ? 1 : 0
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
|
|
@ -77,6 +79,7 @@ RadioButton {
|
|||
|
||||
ButtonTextType {
|
||||
text: root.text
|
||||
color: root.enabled ? root.textColor : root.textDisabledColor
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import "TextTypes"
|
|||
Popup {
|
||||
id: root
|
||||
|
||||
property string popupErrorMessageText
|
||||
property string text
|
||||
property bool closeButtonVisible: true
|
||||
|
||||
leftMargin: 25
|
||||
|
|
@ -17,46 +17,56 @@ Popup {
|
|||
width: parent.width - leftMargin - rightMargin
|
||||
|
||||
anchors.centerIn: parent
|
||||
modal: true
|
||||
modal: root.closeButtonVisible
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
visible: root.closeButtonVisible
|
||||
color: Qt.rgba(14/255, 14/255, 17/255, 0.8)
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
color: "white"//Qt.rgba(215/255, 216/255, 219/255, 0.95)
|
||||
color: "white"
|
||||
radius: 4
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
contentItem: Item {
|
||||
implicitWidth: content.implicitWidth
|
||||
implicitHeight: content.implicitHeight
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 16
|
||||
anchors.rightMargin: 16
|
||||
|
||||
CaptionTextType {
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
Layout.fillWidth: true
|
||||
RowLayout {
|
||||
id: content
|
||||
|
||||
text: root.popupErrorMessageText
|
||||
}
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 16
|
||||
anchors.rightMargin: 16
|
||||
|
||||
BasicButtonType {
|
||||
visible: closeButtonVisible
|
||||
CaptionTextType {
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
Layout.fillWidth: true
|
||||
|
||||
defaultColor: "white"//"transparent"//Qt.rgba(215/255, 216/255, 219/255, 0.95)
|
||||
hoveredColor: "#C1C2C5"
|
||||
pressedColor: "#AEB0B7"
|
||||
disabledColor: "#494B50"
|
||||
text: root.text
|
||||
}
|
||||
|
||||
textColor: "#0E0E11"
|
||||
borderWidth: 0
|
||||
BasicButtonType {
|
||||
visible: closeButtonVisible
|
||||
|
||||
text: qsTr("Close")
|
||||
onClicked: {
|
||||
root.close()
|
||||
defaultColor: "white"
|
||||
hoveredColor: "#C1C2C5"
|
||||
pressedColor: "#AEB0B7"
|
||||
disabledColor: "#494B50"
|
||||
|
||||
textColor: "#0E0E11"
|
||||
borderWidth: 0
|
||||
|
||||
text: qsTr("Close")
|
||||
onClicked: {
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,24 @@ Switch {
|
|||
id: root
|
||||
|
||||
property alias descriptionText: description.text
|
||||
property string descriptionTextColor: "#878B91"
|
||||
property string descriptionTextDisabledColor: "#494B50"
|
||||
|
||||
property string textColor: "#D7D8DB"
|
||||
property string textDisabledColor: "#878B91"
|
||||
|
||||
property string checkedIndicatorColor: "#412102"
|
||||
property string defaultIndicatorColor: "transparent"
|
||||
property string checkedDisabledIndicatorColor: "#5A330C"
|
||||
|
||||
property string checkedIndicatorBorderColor: "#412102"
|
||||
property string defaultIndicatorBorderColor: "#494B50"
|
||||
property string checkedDisabledIndicatorBorderColor: "#5A330C"
|
||||
|
||||
property string checkedInnerCircleColor: "#FBB26A"
|
||||
property string defaultInnerCircleColor: "#D7D8DB"
|
||||
property string checkedDisabledInnerCircleColor: "#84603D"
|
||||
property string defaultDisabledInnerCircleColor: "#494B50"
|
||||
|
||||
property string hoveredIndicatorBackgroundColor: Qt.rgba(1, 1, 1, 0.08)
|
||||
property string defaultIndicatorBackgroundColor: "transparent"
|
||||
|
|
@ -23,6 +33,8 @@ Switch {
|
|||
implicitWidth: content.implicitWidth + switcher.implicitWidth
|
||||
implicitHeight: content.implicitHeight
|
||||
|
||||
hoverEnabled: enabled ? true : false
|
||||
|
||||
indicator: Rectangle {
|
||||
id: switcher
|
||||
|
||||
|
|
@ -33,8 +45,10 @@ Switch {
|
|||
implicitHeight: 32
|
||||
|
||||
radius: 16
|
||||
color: root.checked ? checkedIndicatorColor : defaultIndicatorColor
|
||||
border.color: root.checked ? checkedIndicatorBorderColor : defaultIndicatorBorderColor
|
||||
color: root.checked ? (root.enabled ? root.checkedIndicatorColor : root.checkedDisabledIndicatorColor)
|
||||
: root.defaultIndicatorColor
|
||||
border.color: root.checked ? (root.enabled ? root.checkedIndicatorBorderColor : root.checkedDisabledIndicatorBorderColor)
|
||||
: root.defaultIndicatorBorderColor
|
||||
|
||||
Behavior on color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
|
|
@ -51,7 +65,8 @@ Switch {
|
|||
width: root.checked ? 24 : 16
|
||||
height: root.checked ? 24 : 16
|
||||
radius: 23
|
||||
color: root.checked ? checkedInnerCircleColor : defaultInnerCircleColor
|
||||
color: root.checked ? (root.enabled ? root.checkedInnerCircleColor : root.checkedDisabledInnerCircleColor)
|
||||
: (root.enabled ? root.defaultInnerCircleColor : root.defaultDisabledInnerCircleColor)
|
||||
|
||||
Behavior on x {
|
||||
PropertyAnimation { duration: 200 }
|
||||
|
|
@ -63,7 +78,7 @@ Switch {
|
|||
width: 40
|
||||
height: 40
|
||||
radius: 23
|
||||
color: hovered ? hoveredIndicatorBackgroundColor : defaultIndicatorBackgroundColor
|
||||
color: root.hovered ? root.hoveredIndicatorBackgroundColor : root.defaultIndicatorBackgroundColor
|
||||
|
||||
Behavior on color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
|
|
@ -81,6 +96,7 @@ Switch {
|
|||
Layout.fillWidth: true
|
||||
|
||||
text: root.text
|
||||
color: root.enabled ? root.textColor : root.textDisabledColor
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
|
|
@ -88,7 +104,7 @@ Switch {
|
|||
|
||||
Layout.fillWidth: true
|
||||
|
||||
color: "#878B91"
|
||||
color: root.enabled ? root.descriptionTextColor : root.descriptionTextDisabledColor
|
||||
|
||||
visible: text !== ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,22 +22,14 @@ PageType {
|
|||
|
||||
property string borderColor: "#2C2D30"
|
||||
|
||||
property string currentServerName
|
||||
property string currentServerHostName
|
||||
property string currentContainerName
|
||||
property string defaultServerName: ServersModel.defaultServerName
|
||||
property string defaultServerHostName: ServersModel.defaultServerHostName
|
||||
property string defaultContainerName: ContainersModel.defaultContainerName
|
||||
|
||||
ConnectButton {
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ContainersModel
|
||||
|
||||
function onDefaultContainerChanged() {
|
||||
root.currentContainerName = ContainersModel.getDefaultContainerName()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: PageController
|
||||
|
||||
|
|
@ -79,7 +71,7 @@ PageType {
|
|||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
Header1TextType {
|
||||
text: root.currentServerName
|
||||
text: root.defaultServerName
|
||||
}
|
||||
|
||||
Image {
|
||||
|
|
@ -107,7 +99,7 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
description += root.currentContainerName + " | " + root.currentServerHostName
|
||||
description += root.defaultContainerName + " | " + root.defaultServerHostName
|
||||
return description
|
||||
}
|
||||
}
|
||||
|
|
@ -139,14 +131,14 @@ PageType {
|
|||
Layout.topMargin: 24
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
text: root.currentServerName
|
||||
text: root.defaultServerName
|
||||
}
|
||||
|
||||
LabelTextType {
|
||||
Layout.bottomMargin: 24
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
text: root.currentServerHostName
|
||||
text: root.defaultServerHostName
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
@ -161,7 +153,7 @@ PageType {
|
|||
rootButtonImageColor: "#0E0E11"
|
||||
rootButtonBackgroundColor: "#D7D8DB"
|
||||
|
||||
text: root.currentContainerName
|
||||
text: root.defaultContainerName
|
||||
textColor: "#0E0E11"
|
||||
headerText: qsTr("Connection protocol")
|
||||
headerBackButtonImage: "qrc:/images/controls/arrow-left.svg"
|
||||
|
|
@ -299,9 +291,6 @@ PageType {
|
|||
|
||||
ServersModel.currentlyProcessedIndex = index
|
||||
ServersModel.defaultIndex = index
|
||||
|
||||
root.currentServerName = name
|
||||
root.currentServerHostName = hostName
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
|
@ -331,13 +320,6 @@ PageType {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (serversMenuContent.currentIndex === index) {
|
||||
root.currentServerName = name
|
||||
root.currentServerHostName = hostName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -425,16 +425,13 @@ PageType {
|
|||
|
||||
onClicked: {
|
||||
questionDrawer.headerText = qsTr("Remove OpenVpn from server?")
|
||||
// questionDrawer.descriptionText = qsTr("")
|
||||
questionDrawer.yesButtonText = qsTr("Continue")
|
||||
questionDrawer.noButtonText = qsTr("Cancel")
|
||||
|
||||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
goToPage(PageEnum.PageDeinstalling)
|
||||
ContainersModel.removeCurrentlyProcessedContainer()
|
||||
closePage()
|
||||
closePage() //todo auto close to deinstall page?
|
||||
InstallController.removeCurrentlyProcessedContainer()
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
|
|
|
|||
|
|
@ -173,8 +173,19 @@ PageType {
|
|||
textColor: "#EB5757"
|
||||
|
||||
clickedFunction: function() {
|
||||
ContainersModel.removeCurrentlyProcessedContainer()
|
||||
closePage()
|
||||
questionDrawer.headerText = qsTr("Remove ") + ContainersModel.getCurrentlyProcessedContainerName() + qsTr(" from server?")
|
||||
questionDrawer.yesButtonText = qsTr("Continue")
|
||||
questionDrawer.noButtonText = qsTr("Cancel")
|
||||
|
||||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
goToPage(PageEnum.PageDeinstalling)
|
||||
InstallController.removeCurrentlyProcessedContainer()
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
}
|
||||
questionDrawer.visible = true
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
|
@ -186,5 +197,9 @@ PageType {
|
|||
|
||||
DividerType {}
|
||||
}
|
||||
|
||||
QuestionDrawer {
|
||||
id: questionDrawer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -258,9 +258,7 @@ PageType {
|
|||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
goToPage(PageEnum.PageDeinstalling)
|
||||
ContainersModel.removeCurrentlyProcessedContainer()
|
||||
closePage()
|
||||
closePage() //todo auto close to deinstall page?
|
||||
InstallController.removeCurrentlyProcessedContainer()
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
|
|
|
|||
|
|
@ -150,9 +150,7 @@ PageType {
|
|||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
goToPage(PageEnum.PageDeinstalling)
|
||||
ContainersModel.removeCurrentlyProcessedContainer()
|
||||
closePage()
|
||||
closePage() //todo auto close to deinstall page?
|
||||
InstallController.removeCurrentlyProcessedContainer()
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ PageType {
|
|||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
SettingsController.clearSettings()
|
||||
PageController.replaceStartPage()
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
|
|
|
|||
|
|
@ -12,6 +12,20 @@ import "../Controls2/TextTypes"
|
|||
PageType {
|
||||
id: root
|
||||
|
||||
Connections {
|
||||
target: SettingsController
|
||||
|
||||
function onChangeSettingsErrorOccurred(errorMessage) {
|
||||
PageController.showErrorMessage(errorMessage)
|
||||
}
|
||||
|
||||
function onRestoreBackupFinished() {
|
||||
PageController.showNotificationMessage(qsTr("Settings restored from backup file"))
|
||||
goToStartPage()
|
||||
PageController.goToPageHome()
|
||||
}
|
||||
}
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
|
||||
|
|
@ -66,7 +80,9 @@ PageType {
|
|||
text: qsTr("Make a backup")
|
||||
|
||||
onClicked: {
|
||||
PageController.showBusyIndicator(true)
|
||||
SettingsController.backupAppConfig()
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +100,9 @@ PageType {
|
|||
text: qsTr("Restore from backup")
|
||||
|
||||
onClicked: {
|
||||
PageController.showBusyIndicator(true)
|
||||
SettingsController.restoreAppConfig()
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ PageType {
|
|||
headerText: "Primary DNS"
|
||||
|
||||
textFieldText: SettingsController.primaryDns
|
||||
textField.validator: RegularExpressionValidator {
|
||||
regularExpression: InstallController.ipAddressRegExp()
|
||||
}
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
|
|
@ -64,6 +67,9 @@ PageType {
|
|||
headerText: "Secondary DNS"
|
||||
|
||||
textFieldText: SettingsController.secondaryDns
|
||||
textField.validator: RegularExpressionValidator {
|
||||
regularExpression: InstallController.ipAddressRegExp()
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,32 @@ PageType {
|
|||
|
||||
PageController.showErrorMessage(message)
|
||||
}
|
||||
|
||||
function onInstallationErrorOccurred(errorMessage) {
|
||||
closePage() // close deInstalling page
|
||||
PageController.showErrorMessage(errorMessage)
|
||||
}
|
||||
|
||||
function onRemoveCurrentlyProcessedServerFinished(finishedMessage) {
|
||||
if (!ServersModel.getServersCount()) {
|
||||
PageController.replaceStartPage()
|
||||
} else {
|
||||
goToStartPage()
|
||||
goToPage(PageEnum.PageSettingsServersList)
|
||||
}
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
|
||||
function onRemoveAllContainersFinished(finishedMessage) {
|
||||
closePage() // close deInstalling page
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
|
||||
function onRemoveCurrentlyProcessedContainerFinished(finishedMessage) {
|
||||
closePage() // close deInstalling page
|
||||
closePage() // close page with remove button
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
@ -112,16 +138,12 @@ PageType {
|
|||
|
||||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
PageController.showBusyIndicator(true)
|
||||
if (ServersModel.isDefaultServerCurrentlyProcessed && ConnectionController.isConnected) {
|
||||
ConnectionController.closeConnection()
|
||||
}
|
||||
ServersModel.removeServer()
|
||||
if (!ServersModel.getServersCount()) {
|
||||
PageController.replaceStartPage()
|
||||
} else {
|
||||
goToStartPage()
|
||||
goToPage(PageEnum.PageSettingsServersList)
|
||||
}
|
||||
InstallController.removeCurrentlyProcessedServer()
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
|
|
@ -151,8 +173,7 @@ PageType {
|
|||
if (ServersModel.isDefaultServerCurrentlyProcessed && ConnectionController.isConnected) {
|
||||
ConnectionController.closeVpnConnection()
|
||||
}
|
||||
ContainersModel.removeAllContainers()
|
||||
closePage()
|
||||
InstallController.removeAllContainers()
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ PageType {
|
|||
Layout.fillWidth: true
|
||||
headerText: qsTr("Server name")
|
||||
textFieldText: name
|
||||
textField.maximumLength: 20
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
|
|
|
|||
|
|
@ -81,13 +81,12 @@ PageType {
|
|||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
var containerIndex = ContainersModel.getCurrentlyProcessedContainerIndex()
|
||||
switch (containerIndex) {
|
||||
case ContainerEnum.OpenVpn: OpenVpnConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
case ContainerEnum.ShadowSocks: ShadowSocksConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
case ContainerEnum.Cloak: CloakConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
case ContainerEnum.WireGuard: WireGuardConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
case ContainerEnum.Ipsec: Ikev2ConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
switch (protocolIndex) {
|
||||
case ProtocolEnum.OpenVpn: OpenVpnConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
case ProtocolEnum.ShadowSocks: ShadowSocksConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
case ProtocolEnum.Cloak: CloakConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
case ProtocolEnum.WireGuard: WireGuardConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
case ProtocolEnum.Ipsec: Ikev2ConfigModel.updateModel(ProtocolsModel.getConfig()); break;
|
||||
}
|
||||
goToPage(protocolPage);
|
||||
}
|
||||
|
|
@ -113,8 +112,19 @@ PageType {
|
|||
textColor: "#EB5757"
|
||||
|
||||
clickedFunction: function() {
|
||||
ContainersModel.removeCurrentlyProcessedContainer()
|
||||
closePage()
|
||||
questionDrawer.headerText = qsTr("Remove ") + ContainersModel.getCurrentlyProcessedContainerName() + qsTr(" from server?")
|
||||
questionDrawer.yesButtonText = qsTr("Continue")
|
||||
questionDrawer.noButtonText = qsTr("Cancel")
|
||||
|
||||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
goToPage(PageEnum.PageDeinstalling)
|
||||
InstallController.removeCurrentlyProcessedContainer()
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
}
|
||||
questionDrawer.visible = true
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
|
@ -126,5 +136,9 @@ PageType {
|
|||
|
||||
DividerType {}
|
||||
}
|
||||
|
||||
QuestionDrawer {
|
||||
id: questionDrawer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ PageType {
|
|||
PageController.showErrorMessage(errorMessage)
|
||||
}
|
||||
|
||||
function onInstallContainerFinished(isInstalledContainerFound) {
|
||||
function onInstallContainerFinished(finishedMessage) {
|
||||
goToStartPage()
|
||||
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
|
||||
PageController.restorePageHomeState(true)
|
||||
|
|
@ -33,14 +33,10 @@ PageType {
|
|||
goToPage(PageEnum.PageHome)
|
||||
}
|
||||
|
||||
if (isInstalledContainerFound) {
|
||||
//todo change to info message
|
||||
PageController.showErrorMessage(qsTr("The container you are trying to install is already installed on the server. " +
|
||||
"All installed containers have been added to the application"))
|
||||
}
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
|
||||
function onInstallServerFinished(isInstalledContainerFound) {
|
||||
function onInstallServerFinished(finishedMessage) {
|
||||
goToStartPage()
|
||||
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
|
||||
PageController.restorePageHomeState()
|
||||
|
|
@ -50,10 +46,7 @@ PageType {
|
|||
PageController.replaceStartPage()
|
||||
}
|
||||
|
||||
if (isInstalledContainerFound) {
|
||||
PageController.showErrorMessage(qsTr("The container you are trying to install is already installed on the server. " +
|
||||
"All installed containers have been added to the application"))
|
||||
}
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
}
|
||||
|
||||
function onServerAlreadyExists(serverIndex) {
|
||||
|
|
|
|||
|
|
@ -123,15 +123,16 @@ PageType {
|
|||
anchors.bottom: parent.bottom
|
||||
contentHeight: {
|
||||
var emptySpaceHeight = parent.height - showDetailsBackButton.implicitHeight - showDetailsBackButton.anchors.topMargin
|
||||
|
||||
return (showDetailsDrawerContent.implicitHeight > emptySpaceHeight) ?
|
||||
showDetailsDrawerContent.implicitHeight : emptySpaceHeight
|
||||
return (showDetailsDrawerContent.height > emptySpaceHeight) ?
|
||||
showDetailsDrawerContent.height : emptySpaceHeight
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: showDetailsDrawerContent
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,6 @@ PageType {
|
|||
Connections {
|
||||
target: PageController
|
||||
|
||||
function onShowErrorMessage(errorMessage) {
|
||||
popupErrorMessage.popupErrorMessageText = errorMessage
|
||||
popupErrorMessage.open()
|
||||
}
|
||||
|
||||
function onGoToPageViewConfig() {
|
||||
goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||
}
|
||||
|
|
@ -98,16 +93,4 @@ PageType {
|
|||
id: connectionTypeSelection
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
implicitHeight: popupErrorMessage.height
|
||||
|
||||
PopupType {
|
||||
id: popupErrorMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ PageType {
|
|||
property string fullConfigServerSelectorText
|
||||
property string connectionServerSelectorText
|
||||
property bool showContent: false
|
||||
property bool shareButtonEnabled: false
|
||||
property bool shareButtonEnabled: true
|
||||
property list<QtObject> connectionTypesModel: [
|
||||
amneziaConnectionFormat
|
||||
]
|
||||
|
|
@ -140,6 +140,7 @@ PageType {
|
|||
onClicked: {
|
||||
accessTypeSelector.currentIndex = 1
|
||||
serverSelector.text = root.fullConfigServerSelectorText
|
||||
root.shareButtonEnabled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,11 +31,6 @@ PageType {
|
|||
tabBarStackView.push(pagePath, { "objectName" : pagePath }, StackView.PushTransition)
|
||||
}
|
||||
|
||||
function onShowErrorMessage(errorMessage) {
|
||||
popupErrorMessage.popupErrorMessageText = errorMessage
|
||||
popupErrorMessage.open()
|
||||
}
|
||||
|
||||
function onShowBusyIndicator(visible) {
|
||||
busyIndicator.visible = visible
|
||||
tabBarStackView.enabled = !visible
|
||||
|
|
@ -119,14 +114,15 @@ PageType {
|
|||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onDefaultServerIndexChanged() {
|
||||
shareTabButton.visible = ServersModel.isCurrentlyProcessedServerHasWriteAccess()
|
||||
shareTabButton.width = ServersModel.isCurrentlyProcessedServerHasWriteAccess() ? undefined : 0
|
||||
function onModelReset() {
|
||||
var hasServerWithWriteAccess = ServersModel.hasServerWithWriteAccess()
|
||||
shareTabButton.visible = hasServerWithWriteAccess
|
||||
shareTabButton.width = hasServerWithWriteAccess ? undefined : 0
|
||||
}
|
||||
}
|
||||
|
||||
visible: ServersModel.isCurrentlyProcessedServerHasWriteAccess()
|
||||
width: ServersModel.isCurrentlyProcessedServerHasWriteAccess() ? undefined : 0
|
||||
visible: ServersModel.hasServerWithWriteAccess()
|
||||
width: ServersModel.hasServerWithWriteAccess() ? undefined : 0
|
||||
|
||||
isSelected: tabBar.currentIndex === 1
|
||||
image: "qrc:/images/controls/share-2.svg"
|
||||
|
|
@ -151,18 +147,6 @@ PageType {
|
|||
enabled: false
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
implicitHeight: popupErrorMessage.height
|
||||
|
||||
PopupType {
|
||||
id: popupErrorMessage
|
||||
}
|
||||
}
|
||||
|
||||
BusyIndicatorType {
|
||||
id: busyIndicator
|
||||
anchors.centerIn: parent
|
||||
|
|
|
|||
|
|
@ -63,5 +63,52 @@ Window {
|
|||
function onHideMainWindow() {
|
||||
root.hide()
|
||||
}
|
||||
|
||||
function onShowErrorMessage(errorMessage) {
|
||||
popupErrorMessage.text = errorMessage
|
||||
popupErrorMessage.open()
|
||||
}
|
||||
|
||||
function onShowNotificationMessage(message) {
|
||||
popupNotificationMessage.text = message
|
||||
popupNotificationMessage.closeButtonVisible = false
|
||||
popupNotificationMessage.open()
|
||||
popupNotificationTimer.start()
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
implicitHeight: popupNotificationMessage.height
|
||||
|
||||
PopupType {
|
||||
id: popupNotificationMessage
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: popupNotificationTimer
|
||||
|
||||
interval: 3000
|
||||
repeat: false
|
||||
running: false
|
||||
onTriggered: {
|
||||
popupNotificationMessage.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
implicitHeight: popupErrorMessage.height
|
||||
|
||||
PopupType {
|
||||
id: popupErrorMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue