Dekko
Loading...
Searching...
No Matches
MessageViewContextMenu.qml
1/* Copyright (C) 2016 - 2017 Dan Chapman <dpniel@ubuntu.com>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18import QtQuick 2.4
19import Lomiri.Components 1.3
20import Lomiri.Components.Popups 1.3
21import Dekko.Components 1.0
22import Dekko.Mail 1.0
23import Dekko.Mail.API 1.0
24import Dekko.Lomiri.Components 1.0
26Popover {
27 id: actionPopover
28 z: 100 // Prevent being rendered below the message header
29 property var msg
30 property var ctxtModel
31
32 Column {
33 id: containerLayout
34
35 anchors {
36 left: parent.left
37 top: parent.top
38 right: parent.right
39 }
40
41 ContextGroup {
42 // only show this group on links
43 visible: ctxtModel && ctxtModel.linkUrl.toString()
44 contextActions: [
45 ContextAction {
46 description: qsTr("Open in browser")
47 actionIcon: Icons.BrowserIcon
48 onTriggered: {
49 Qt.openUrlExternally(ctxtModel.linkUrl.toString())
50 PopupUtils.close(actionPopover)
51 }
52 },
54 description: qsTr("Copy link")
55 actionIcon: Icons.CopyIcon
56 onTriggered: {
57 Clipboard.push(["text/plain", ctxtModel.linkUrl.toString()])
58 PopupUtils.close(actionPopover)
59 }
60 }
61 ]
62 }
63
65 contextActions: [
67 description: qsTr("Reply")
68 actionIcon: Icons.MailRepliedAllIcon
69 onTriggered: {
70 ComposerActions.respondToMessage(msg.isListPost ? SubmissionManager.ReplyList : SubmissionManager.Reply, msg.messageId)
71 PopupUtils.close(actionPopover)
72 }
73 },
74
76 description: qsTr("Reply all")
77 actionIcon: Icons.MailRepliedIcon
78 onTriggered: {
79 ComposerActions.respondToMessage(SubmissionManager.ReplyAll, msg.messageId)
80 PopupUtils.close(actionPopover)
81 }
82 },
84 description: qsTr("Forward")
85 actionIcon: Icons.MailForwardedIcon
86 onTriggered: {
87 ComposerActions.forwardMessage(SubmissionManager.ForwardInline, msg.messageId)
88 PopupUtils.close(actionPopover)
89 }
90 },
92 description: qsTr("Forward As Attachment")
93 actionIcon: Icons.MailForwardedIcon
94 onTriggered: {
95 ComposerActions.forwardMessage(SubmissionManager.ForwardAsAttachment, msg.messageId)
96 PopupUtils.close(actionPopover)
97 }
98 }
99 ]
100 }
101 }
102}