From 82f0c273e759a5801c1959aa6cd500ac040fdaff Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 9 Sep 2019 14:49:54 -0400 Subject: [PATCH] LogoutPopup: implement export keys button callback --- TODO.md | 2 ++ src/qml/Dialogs/ExportKeys.qml | 4 ++++ src/qml/Popups/LogoutPopup.qml | 14 +++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index a11910b5..93d35d0e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1,5 @@ +- ! Banner forget room popup + - Refactoring - Room header elide detection - Use HBox for Profile diff --git a/src/qml/Dialogs/ExportKeys.qml b/src/qml/Dialogs/ExportKeys.qml index 21b4194a..2c489a01 100644 --- a/src/qml/Dialogs/ExportKeys.qml +++ b/src/qml/Dialogs/ExportKeys.qml @@ -12,6 +12,9 @@ HFileDialogOpener { } + signal done() + + property string userId: "" property bool exporting: false @@ -23,6 +26,7 @@ HFileDialogOpener { py.callClientCoro(userId, "export_keys", [path, passphrase], () => { exporting = false + done() }) } diff --git a/src/qml/Popups/LogoutPopup.qml b/src/qml/Popups/LogoutPopup.qml index 1fba9393..0fda92e9 100644 --- a/src/qml/Popups/LogoutPopup.qml +++ b/src/qml/Popups/LogoutPopup.qml @@ -1,4 +1,5 @@ import QtQuick 2.12 +import "../utils.js" as Utils BoxPopup { id: popup @@ -24,7 +25,18 @@ BoxPopup { ] box.buttonCallbacks: ({ ok: button => { - console.error("Not implemented yet") + Utils.makeObject( + "Dialogs/ExportKeys.qml", + mainUI, + { userId }, + obj => { + button.loading = Qt.binding(() => obj.exporting) + obj.done.connect(() => { + box.buttonCallbacks["signout"](button) + }) + obj.dialog.open() + } + ) }, signout: button => {