reworking of getting the path to the file when saving/opening files
This commit is contained in:
parent
e1fa24c251
commit
b5dd48ad7b
21 changed files with 167 additions and 243 deletions
|
|
@ -70,8 +70,19 @@ It's okay as long as it's from someone you trust.")
|
|||
leftImageSource: "qrc:/images/controls/folder-open.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.setupFileDialogForConfig()
|
||||
SystemController.getFileName()
|
||||
var nameFilter = !ServersModel.getServersCount() ? "Config or backup files (*.vpn *.ovpn *.conf *.backup)" :
|
||||
"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)
|
||||
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue