diff --git a/client/fileUtilites.cpp b/client/fileUtilites.cpp index 4eedfc9a..96f1c741 100644 --- a/client/fileUtilites.cpp +++ b/client/fileUtilites.cpp @@ -81,5 +81,5 @@ QString FileUtilites::getFileName(QString fileName) return fileName; #endif - return QUrl(FileUtilites::getFileName(fileName)).toLocalFile(); + return QUrl(fileName).toLocalFile(); } diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index 0c2408be..fc4dd8b3 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -53,6 +53,12 @@ ListView { checkable: isInstalled checked: isDefault + onPressed: function(mouse) { + if (!isSupported) { + PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform")) + } + } + onClicked: { if (checked) { isDefault = true diff --git a/client/ui/qml/Filters/ContainersModelFilters.qml b/client/ui/qml/Filters/ContainersModelFilters.qml index fa8bd83b..dd6d9525 100644 --- a/client/ui/qml/Filters/ContainersModelFilters.qml +++ b/client/ui/qml/Filters/ContainersModelFilters.qml @@ -32,16 +32,16 @@ Item { } function getWriteAccessProtocolsListFilters() { - return [vpnTypeFilter, supportedFilter] + return [vpnTypeFilter] } function getReadAccessProtocolsListFilters() { - return [vpnTypeFilter, supportedFilter, installedFilter] + return [vpnTypeFilter, installedFilter] } function getWriteAccessServicesListFilters() { - return [serviceTypeFilter, supportedFilter] + return [serviceTypeFilter } function getReadAccessServicesListFilters() { - return [serviceTypeFilter, supportedFilter, installedFilter] + return [serviceTypeFilter, installedFilter] } } diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index 15c5e531..8ae90351 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -22,7 +22,7 @@ PageType { if (isInstalledContainerFound) { message = qsTr("All installed containers have been added to the application") } else { - message = qsTr("No installed containers found") + message = qsTr("No new installed containers found") } PageController.showErrorMessage(message) diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index 535ab18c..e074b4ce 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -241,8 +241,10 @@ PageType { buttonImageSource: "qrc:/images/controls/plus.svg" clickedFunc: function() { + PageController.showBusyIndicator(true) SitesController.addSite(textFieldText) textFieldText = "" + PageController.showBusyIndicator(false) } } @@ -312,8 +314,10 @@ PageType { currentFile: StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/sites" defaultSuffix: ".json" onAccepted: { + PageController.showBusyIndicator(true) SitesController.exportSites(saveFileDialog.currentFile.toString()) moreActionsDrawer.close() + PageController.showBusyIndicator(false) } } } @@ -394,9 +398,11 @@ PageType { acceptLabel: qsTr("Open sites file") nameFilters: [ "Sites files (*.json)" ] onAccepted: { + PageController.showBusyIndicator(true) SitesController.importSites(openFileDialog.selectedFile.toString(), replaceExistingSites) importSitesDrawer.close() moreActionsDrawer.close() + PageController.showBusyIndicator(false) } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml index de8b8c87..6362ca6d 100644 --- a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml +++ b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml @@ -65,7 +65,7 @@ It's okay as long as it's from someone you trust.") Layout.fillWidth: true Layout.topMargin: 16 - text: qsTr("File with connection settings") + text: qsTr("File with connection settings or backup") rightImageSource: "qrc:/images/controls/chevron-right.svg" leftImageSource: "qrc:/images/controls/folder-open.svg" @@ -76,10 +76,16 @@ It's okay as long as it's from someone you trust.") FileDialog { id: fileDialog acceptLabel: qsTr("Open config file") - nameFilters: [ "Config files (*.vpn *.ovpn *.conf)" ] + nameFilters: [ "Config or backup files (*.vpn *.ovpn *.conf *.backup)" ] onAccepted: { - ImportController.extractConfigFromFile(fileDialog.selectedFile.toString()) - goToPage(PageEnum.PageSetupWizardViewConfig) + if (fileDialog.selectedFile.toString().indexOf(".backup") != -1) { + PageController.showBusyIndicator(true) + SettingsController.restoreAppConfig(fileDialog.selectedFile.toString()) + PageController.showBusyIndicator(false) + } else { + ImportController.extractConfigFromFile(fileDialog.selectedFile.toString()) + goToPage(PageEnum.PageSetupWizardViewConfig) + } } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardStart.qml b/client/ui/qml/Pages2/PageSetupWizardStart.qml index 11d7ba29..3bc57495 100644 --- a/client/ui/qml/Pages2/PageSetupWizardStart.qml +++ b/client/ui/qml/Pages2/PageSetupWizardStart.qml @@ -19,6 +19,19 @@ PageType { function onGoToPageViewConfig() { goToPage(PageEnum.PageSetupWizardViewConfig) } + + function onShowBusyIndicator(visible) { + busyIndicator.visible = visible + } + } + + Connections { + target: SettingsController + + function onRestoreBackupFinished() { + PageController.showNotificationMessage(qsTr("Settings restored from backup file")) + PageController.replaceStartPage() + } } FlickableType { @@ -93,4 +106,10 @@ PageType { id: connectionTypeSelection } } + + BusyIndicatorType { + id: busyIndicator + anchors.centerIn: parent + z: 1 + } } diff --git a/client/ui/qml/main2.qml b/client/ui/qml/main2.qml index 6ae434d7..d3c3aa1b 100644 --- a/client/ui/qml/main2.qml +++ b/client/ui/qml/main2.qml @@ -47,9 +47,7 @@ Window { function onReplaceStartPage() { var pagePath = PageController.getInitialPage() - while (rootStackView.depth > 1) { - rootStackView.pop() - } + rootStackView.clear() PageController.updateNavigationBarColor(PageController.getInitialPageNavigationBarColor()) rootStackView.replace(pagePath, { "objectName" : pagePath }) }