aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/qtmaildir/MailGeneralModule.qml
blob: 02ecd5a475011c90795018cac2f3eb2a290f41e1 (plain)
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
// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

import QtQuick
import "../.."

// qtmaildir's [general], [sync] and [completion].
Module {
    // Not "mail": that is the drawer's unread-mail page.
    name: "mail-general"
    label: "Mail"
    // nf-fa-envelope, present in Inconsolata Nerd Font.
    icon: "\uf0e0"
    settings: true
    group: "Mail"
    dirty: Qtm.dirty
    keywords: ["qtmaildir", "startup", "language", "toolbar", "zoom", "date", "sync", "contacts",
               "calendar", "notmuch", "mimetype", "forward"]
    readonly property var fields: [
        ["general", "startup_query", "Startup query"], ["general", "startup_account", "Startup account"],
        ["general", "language", "Language"], ["general", "toolbar_icon_size", "Toolbar icon size"],
        ["general", "message_zoom", "Message zoom"], ["general", "date_format", "Date format"],
        ["general", "forward_prefixes", "Forward prefixes"], ["general", "mark_read_delay_ms", "Mark read after"],
        ["general", "completion_on_focus", "Complete on focus"], ["sync", "command", "Sync command"],
        ["sync", "log", "Sync log"], ["general", "auto_sync_delay_ms", "Sync after tagging"],
        ["general", "sync_on_exit", "On quit with changes"], ["general", "contacts_dir", "Contacts"],
        ["general", "calendars_dir", "Calendars"], ["general", "default_calendar", "Default calendar"],
        ["general", "calendar_sync_command", "Calendar sync"], ["general", "notmuch_config", "notmuch config"],
        ["completion", "extra_mimetypes", "Extra mimetypes"]]
    searchItems: fields.map(f => ({ text: f[2], key: f[0] + "/" + f[1] }))
    function refresh() { Qtm.refresh(); }

    page: Component {
        Page {
            title: "Mail"
            // One draft behind all four Mail pages: Save writes them all.
            actions: Component {
                SaveBar { dirty: Qtm.dirty; valid: Qtm.valid; onSave: Qtm.save(); onDiscard: Qtm.discard() }
            }
            GeneralPage { width: parent.width }
        }
    }
}