From b8762ddb38dd975b0acb217b793594dfed83a824 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 12 Sep 2020 14:10:13 +0300 Subject: Initial commit --- qml/main.qml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 qml/main.qml (limited to 'qml/main.qml') diff --git a/qml/main.qml b/qml/main.qml new file mode 100644 index 0000000..8131133 --- /dev/null +++ b/qml/main.qml @@ -0,0 +1,58 @@ +import QtQuick 2.14 +import QtQuick.Controls 2.14 as Controls +import org.kde.kirigami 2.12 as Kirigami + +import DeltaChat 1.0 + + +Kirigami.ApplicationWindow { + id: root + + property DcAccountsEventEmitter eventEmitter + + title: qsTr("Delta Chat") + + pageStack.initialPage: AccountsPage {} + + globalDrawer: Kirigami.GlobalDrawer { + header: Controls.Switch { + text: "Start IO" + onCheckedChanged: { + if (checked) { + accountsModel.startIo() + } else { + accountsModel.stopIo() + } + } + } + + actions: [ + Kirigami.Action { + text: "Maybe network" + iconName: "view-refresh" + onTriggered: accountsModel.maybeNetwork() + } + ] + } + + contextDrawer: Kirigami.ContextDrawer { + id: contextDrawer + } + + AccountsModel { + id: accountsModel + } + + Component.onCompleted: { + console.log('starting') + eventEmitter = accountsModel.getEventEmitter() + eventEmitter.start(); + } + + onClosing: { + console.log('stopping') + pageStack.pop(null) + delete root.accountsModel + eventEmitter.stop() + } +} -- cgit v1.2.3-70-g09d2