added the ability to restore settings from backup on the initial screen
- fixed the display of services in the settings for mobile devices
This commit is contained in:
parent
cbcf187814
commit
b58295d1d6
8 changed files with 48 additions and 13 deletions
|
@ -81,5 +81,5 @@ QString FileUtilites::getFileName(QString fileName)
|
|||
return fileName;
|
||||
#endif
|
||||
|
||||
return QUrl(FileUtilites::getFileName(fileName)).toLocalFile();
|
||||
return QUrl(fileName).toLocalFile();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue