diff options
Diffstat (limited to 'qml/ConfigurePage.qml')
-rw-r--r-- | qml/ConfigurePage.qml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/qml/ConfigurePage.qml b/qml/ConfigurePage.qml index 8a5d9d3..4e0dd49 100644 --- a/qml/ConfigurePage.qml +++ b/qml/ConfigurePage.qml @@ -2,6 +2,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import QtQml.Models 2.1 +import QtQuick.Dialogs 1.3 import org.kde.kirigami 2.12 as Kirigami import DeltaChat 1.0 @@ -13,6 +14,28 @@ Kirigami.Page { required property DcContext context required property DcAccountsEventEmitter eventEmitter + contextualActions: [ + Kirigami.Action { + text: "Import backup" + iconName: "document-import" + onTriggered: importBackupDialog.open() + } + ] + + FileDialog { + id: importBackupDialog + title: "Import backup" + folder: shortcuts.home + onAccepted: { + var url = importBackupDialog.fileUrl.toString() + if (url.startsWith("file://")) { + var filename = url.substring(7) + console.log("Importing " + filename) + configurePage.context.importBackup(filename) + } + } + } + Kirigami.FormLayout { anchors.fill: parent |