mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
update: files encrypt on export and files data decrypt on import
This commit is contained in:
@@ -145,7 +145,7 @@ PageType {
|
||||
qsTr("Backup files (*.backup)"))
|
||||
if (filePath !== "") {
|
||||
passwordDrawer.fileName = filePath
|
||||
SystemController.isFileEncrypted(filePath) ? passwordDrawer.openTriggered() : passwordDrawer.securedFunc()
|
||||
SystemController.isFileEncrypted(filePath) ? passwordDrawer.openTriggered() : restoreBackup(filePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ PageType {
|
||||
expandedHeight: root.height * 0.45
|
||||
|
||||
securedFunc: function() {
|
||||
restoreBackup(fileName)
|
||||
passwordDrawer.restoreSecuredBackup()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
@@ -261,6 +262,15 @@ PageType {
|
||||
}
|
||||
}
|
||||
|
||||
PasswordDrawer {
|
||||
id: passwordDrawer
|
||||
|
||||
parent: root
|
||||
|
||||
anchors.fill: parent
|
||||
expandedHeight: root.height * 0.45
|
||||
}
|
||||
|
||||
property list<QtObject> variants: [
|
||||
amneziaVpn,
|
||||
selfHostVpn,
|
||||
@@ -311,7 +321,12 @@ PageType {
|
||||
qsTr("Backup files (*.backup)"))
|
||||
if (filePath !== "") {
|
||||
PageController.showBusyIndicator(true)
|
||||
SettingsController.restoreAppConfig(filePath)
|
||||
if (SystemController.isFileEncrypted(filePath)) {
|
||||
passwordDrawer.fileName = filePath
|
||||
passwordDrawer.restoreSecuredBackup()
|
||||
} else {
|
||||
SettingsController.restoreAppConfig(filePath)
|
||||
}
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
@@ -329,8 +344,13 @@ PageType {
|
||||
"Config files (*.vpn *.ovpn *.conf *.json)"
|
||||
var fileName = SystemController.getFileName(qsTr("Open config file"), nameFilter)
|
||||
if (fileName !== "") {
|
||||
if (ImportController.extractConfigFromFile(fileName)) {
|
||||
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||
if (SystemController.isFileEncrypted(fileName)) {
|
||||
passwordDrawer.fileName = fileName
|
||||
passwordDrawer.importSecuredFile()
|
||||
} else {
|
||||
if (ImportController.extractConfigFromFile(fileName)) {
|
||||
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user