aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/qtmaildir/MailComposeModule.qml
blob: f97f9efb3c43daeb2de3b784d47a5b14d50214a1 (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
// 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 [compose].
Module {
    name: "mail-compose"
    label: "Compose"
    // nf-fa-pencil, present in Inconsolata Nerd Font.
    icon: "\uf040"
    settings: true
    group: "Mail"
    dirty: Qtm.dirty
    keywords: ["qtmaildir", "html", "quote", "reply", "send", "undo", "autosave", "attachment", "draft"]
    searchItems: [["send_html", "Send HTML"], ["quote_position", "Quote"], ["default_account", "Default account"],
                  ["send_delay_ms", "Undo send window"], ["autosave_interval_ms", "Autosave every"],
                  ["attachment_warn_bytes", "Warn attaching over"]]
        .map(f => ({ text: f[1], key: "compose/" + f[0] }))
    function refresh() { Qtm.refresh(); }

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