extended the validation of the contents of the imported file (#670)
Extended the validation of the contents of the imported file
This commit is contained in:
parent
0a90fd110d
commit
c5a5bfde69
8 changed files with 109 additions and 58 deletions
|
@ -73,12 +73,7 @@ PageType {
|
|||
"Config files (*.vpn *.ovpn *.conf)"
|
||||
var fileName = SystemController.getFileName(qsTr("Open config file"), nameFilter)
|
||||
if (fileName !== "") {
|
||||
if (fileName.indexOf(".backup") !== -1 && !ServersModel.getServersCount()) {
|
||||
PageController.showBusyIndicator(true)
|
||||
SettingsController.restoreAppConfig(fileName)
|
||||
PageController.showBusyIndicator(false)
|
||||
} else {
|
||||
ImportController.extractConfigFromFile(fileName)
|
||||
if (ImportController.extractConfigFromFile(fileName)) {
|
||||
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,6 +81,20 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ImportController
|
||||
|
||||
function onRestoreAppConfig(data) {
|
||||
PageController.showBusyIndicator(true)
|
||||
SettingsController.restoreAppConfigFromData(data)
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
|
||||
function onImportErrorOccurred(errorMessage) {
|
||||
PageController.showErrorMessage(errorMessage)
|
||||
}
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: parent.top
|
||||
|
|
|
@ -77,7 +77,7 @@ PageType {
|
|||
text: qsTr("Continue")
|
||||
|
||||
clickedFunc: function() {
|
||||
ImportController.extractConfigFromCode(textKey.textFieldText)
|
||||
ImportController.extractConfigFromData(textKey.textFieldText)
|
||||
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,6 +121,14 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ImportController
|
||||
|
||||
function onImportErrorOccurred(errorMessage) {
|
||||
PageController.showErrorMessage(errorMessage)
|
||||
}
|
||||
}
|
||||
|
||||
StackViewType {
|
||||
id: tabBarStackView
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue