aboutsummaryrefslogtreecommitdiff
path: root/qml
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-07-04 22:31:32 +0300
committerlink2xt <link2xt@testrun.org>2021-07-04 22:31:32 +0300
commit92de31840ed3ec7cc8ec90fe58b1955278a8acff (patch)
tree2f3ce4a997d93772cf2180afbb2a1fd8a71110fd /qml
parent76b844bd6461d90f91a42fc02002accb694ec56d (diff)
downloadkdeltachat-92de31840ed3ec7cc8ec90fe58b1955278a8acff.tar.gz
kdeltachat-92de31840ed3ec7cc8ec90fe58b1955278a8acff.zip
Replace Accounts.importAccount() with Context.importBackup()
dc_accounts_import_account() is going to be removed from the core.
Diffstat (limited to 'qml')
-rw-r--r--qml/AccountsPage.qml28
-rw-r--r--qml/ConfigurePage.qml23
2 files changed, 23 insertions, 28 deletions
diff --git a/qml/AccountsPage.qml b/qml/AccountsPage.qml
index 0088777..bf39d7e 100644
--- a/qml/AccountsPage.qml
+++ b/qml/AccountsPage.qml
@@ -1,7 +1,6 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
-import QtQuick.Dialogs 1.3
import org.kde.kirigami 2.12 as Kirigami
Kirigami.Page {
@@ -30,33 +29,6 @@ Kirigami.Page {
}
}
- contextualActions: [
- Kirigami.Action {
- text: "Import account"
- iconName: "document-import"
- onTriggered: importAccountDialog.open()
- }
- ]
-
- FileDialog {
- id: importAccountDialog
- title: "Import account"
- folder: shortcuts.home
- onAccepted: {
- var url = importAccountDialog.fileUrl.toString()
- if (url.startsWith("file://")) {
- var filename = url.substring(7)
- console.log("Importing " + filename)
- var accountId = dcAccounts.importAccount(filename)
- if (accountId == 0) {
- console.log("Import failed")
- } else {
- console.log("Import succeeded")
- }
- }
- }
- }
-
ListModel {
id: accountsModel
}
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