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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue