added import backup file from outside for ios

This commit is contained in:
vladimir.kuznetsov 2023-09-13 16:11:08 +05:00
parent e2aef1fc1d
commit 4ae608ed93
10 changed files with 157 additions and 111 deletions

View file

@ -169,7 +169,7 @@ DrawerType {
Layout.topMargin: 16
}
TextArea {
TextField {
id: configText
Layout.fillWidth: true
@ -180,6 +180,8 @@ DrawerType {
leftPadding: 0
height: 24
readOnly: true
color: "#D7D8DB"
selectionColor: "#633303"
selectedTextColor: "#D7D8DB"

View file

@ -10,6 +10,7 @@ import PageEnum 1.0
import "./"
import "../Controls2"
import "../Config"
import "../Components"
import "../Controls2/TextTypes"
PageType {
@ -27,6 +28,10 @@ PageType {
//goToStartPage()
PageController.goToPageHome()
}
function onImportBackupFromOutside(filePath) {
restoreBackup(filePath)
}
}
BackButtonType {
@ -116,15 +121,35 @@ PageType {
text: qsTr("Restore from backup")
onClicked: {
var fileName = SystemController.getFileName(qsTr("Open backup file"),
var filePath = SystemController.getFileName(qsTr("Open backup file"),
qsTr("Backup files (*.backup)"))
if (fileName !== "") {
PageController.showBusyIndicator(true)
SettingsController.restoreAppConfig(fileName)
PageController.showBusyIndicator(false)
if (filePath !== "") {
restoreBackup(filePath)
}
}
}
}
}
function restoreBackup(filePath) {
questionDrawer.headerText = qsTr("Import settings from a backup file?")
questionDrawer.descriptionText = qsTr("All current settings will be reset");
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false
PageController.showBusyIndicator(true)
SettingsController.restoreAppConfig(filePath)
PageController.showBusyIndicator(false)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false
}
questionDrawer.visible = true
}
QuestionDrawer {
id: questionDrawer
}
}

View file

@ -81,6 +81,10 @@ Window {
function onShowPassphraseRequestDrawer() {
privateKeyPassphraseDrawer.open()
}
function onGoToPageSettingsBackup() {
PageController.goToPage(PageEnum.PageSettingsBackup)
}
}
Connections {