diff options
author | link2xt <link2xt@testrun.org> | 2020-09-12 14:10:13 +0300 |
---|---|---|
committer | link2xt <link2xt@testrun.org> | 2020-10-03 00:20:03 +0300 |
commit | b8762ddb38dd975b0acb217b793594dfed83a824 (patch) | |
tree | 23ccefbba703fed6c07acce82ff72e32ba77c9ba /qml/main.qml | |
download | kdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.tar.gz kdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.zip |
Initial commit
Diffstat (limited to 'qml/main.qml')
-rw-r--r-- | qml/main.qml | 58 |
1 files changed, 58 insertions, 0 deletions
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() + } +} |