aboutsummaryrefslogtreecommitdiff
path: root/qml/SettingsPage.qml
blob: 57e35fa28e8eea2bf3da195114cbcdab4fc00c17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import org.kde.kirigami 2.12 as Kirigami

import DeltaChat 1.0

Kirigami.ScrollablePage {
    id: settingsPageRoot

    title: "Settings"

    required property DcContext context

    Kirigami.FormLayout {
        Image {
            Kirigami.FormData.label: "Avatar: "

            source: "file:" + settingsPageRoot.context.getConfig("selfavatar")
        }

        TextField {
            id: displayNameField

            Kirigami.FormData.label: "Name: "
            text: settingsPageRoot.context.getConfig("displayname")
            onEditingFinished: settingsPageRoot.context.setConfig("displayname", text)
        }

        TextArea {
            Kirigami.FormData.label: "Signature: "

            text: settingsPageRoot.context.getConfig("selfstatus")
            onEditingFinished: settingsPageRoot.context.setConfig("selfstatus", text)
            selectByMouse: true
        }

        Switch {
            text: "Prefer end-to-end encryption"
            checked: settingsPageRoot.context.getConfig("e2ee_enabled") == "1"
            onToggled: settingsPageRoot.context.setConfig("e2ee_enabled", checked ? "1" : "0")
        }

        Switch {
            text: "Read receipts"
            checked: settingsPageRoot.context.getConfig("mdns_enabled") == "1"
            onToggled: settingsPageRoot.context.setConfig("mdns_enabled", checked ? "1" : "0")
        }

        Switch {
            text: "Watch Inbox"
            checked: settingsPageRoot.context.getConfig("inbox_watch") == "1"
            onToggled: settingsPageRoot.context.setConfig("inbox_watch", checked ? "1" : "0")
        }

        Switch {
            text: "Watch Sent"
            checked: settingsPageRoot.context.getConfig("sentbox_watch") == "1"
            onToggled: settingsPageRoot.context.setConfig("sentbox_watch", checked ? "1" : "0")
        }

        Switch {
            text: "Watch DeltaChat"
            checked: settingsPageRoot.context.getConfig("mvbox_watch") == "1"
            onToggled: settingsPageRoot.context.setConfig("mvbox_watch", checked ? "1" : "0")
        }

        Switch {
            text: "Send copy to self"
            checked: settingsPageRoot.context.getConfig("bcc_self") == "1"
            onToggled: settingsPageRoot.context.setConfig("bcc_self", checked ? "1" : "0")
        }

        Switch {
            text: "Move to DeltaChat"
            checked: settingsPageRoot.context.getConfig("mvbox_move") == "1"
            onToggled: settingsPageRoot.context.setConfig("mvbox_move", checked ? "1" : "0")
        }

        ComboBox {
            Kirigami.FormData.label: "Show classic emails: "

            model: ListModel {
                id: certificateChecksModel
                ListElement { text: "No, chats only" }
                ListElement { text: "For accepted contacts" }
                ListElement { text: "All" }
            }
            textRole: "text"
            currentIndex: settingsPageRoot.context.getConfig("show_emails")
            onActivated: settingsPageRoot.context.setConfig("show_emails", currentIndex)
        }
    }
}