Dekko
Loading...
Searching...
No Matches
NavViewContextMenu.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 property var folder
29
30 contentWidth: units.gu(25)
31
32 Column {
33 id: containerLayout
34 anchors {
35 left: parent.left
36 top: parent.top
37 right: parent.right
38 }
39
40 ContextGroup {
41 contextActions: [
42 ContextAction {
43 visible: folder.supportedActions & MessageSet.SyncAction
44 description: qsTr("Sync folder")
45 actionIcon: Icons.SyncIcon
46 onTriggered: {
47 MailboxActions.syncStandardFolders(folder.folderType)
48 PopupUtils.close(actionPopover)
49 }
50 },
52 visible: folder.supportedActions & MessageSet.ExportPending
53 description: qsTr("Send pending")
54 actionIcon: Icons.SendIcon
55 onTriggered: {
56 MessageActions.sendPendingMessages()
57 PopupUtils.close(actionPopover)
58 }
59 },
61 visible: folder.supportedActions & MessageSet.MarkAsRead
62 description: qsTr("Mark folder read")
63 actionIcon: Icons.MailReadIcon
64 onTriggered: {
65 MailboxActions.markStandardFoldersRead(folder.folderType)
66 PopupUtils.close(actionPopover)
67 }
68 }
69 ]
70 }
71
73 contextActions: [
75 visible: folder.supportedActions & MessageSet.EmptyTrash
76 description: qsTr("Empty trash")
77 actionIcon: Icons.DeleteIcon
78 onTriggered: {
79 MailboxActions.emptyTrash()
80 PopupUtils.close(actionPopover)
81 }
82 }
83 ]
84 }
85 }
86}