aboutsummaryrefslogtreecommitdiff
path: root/qml/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/main.qml')
-rw-r--r--qml/main.qml58
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()
+ }
+}