diff options
-rw-r--r-- | applications/kmail-quick/package/contents/ui/main.qml | 39 | ||||
-rw-r--r-- | framework/mail/maillistcontroller.cpp | 29 | ||||
-rw-r--r-- | framework/mail/maillistcontroller.h | 13 |
3 files changed, 75 insertions, 6 deletions
diff --git a/applications/kmail-quick/package/contents/ui/main.qml b/applications/kmail-quick/package/contents/ui/main.qml index 63b66c6d..88d2edde 100644 --- a/applications/kmail-quick/package/contents/ui/main.qml +++ b/applications/kmail-quick/package/contents/ui/main.qml | |||
@@ -51,7 +51,6 @@ ApplicationWindow { | |||
51 | Row { | 51 | Row { |
52 | anchors.fill: parent | 52 | anchors.fill: parent |
53 | 53 | ||
54 | |||
55 | PlasmaComponents.ToolButton { | 54 | PlasmaComponents.ToolButton { |
56 | 55 | ||
57 | height: parent.height | 56 | height: parent.height |
@@ -60,14 +59,42 @@ ApplicationWindow { | |||
60 | 59 | ||
61 | text: "Compose" | 60 | text: "Compose" |
62 | } | 61 | } |
63 | } | ||
64 | 62 | ||
65 | PlasmaComponents.ToolButton { | 63 | PlasmaComponents.ToolButton { |
64 | |||
65 | height: parent.height | ||
66 | |||
67 | iconName: "mail-mark-unread" | ||
68 | text: "Mark Unread" | ||
69 | |||
70 | onClicked: { | ||
71 | mailList.markMailUnread(true) | ||
72 | } | ||
73 | } | ||
74 | |||
75 | PlasmaComponents.ToolButton { | ||
76 | |||
77 | height: parent.height | ||
78 | |||
79 | iconName: "mail-mark-important" | ||
80 | text: "Mark Important" | ||
81 | |||
82 | onClicked: { | ||
83 | mailList.markMailImportant(true) | ||
84 | } | ||
85 | } | ||
86 | |||
87 | PlasmaComponents.ToolButton { | ||
66 | 88 | ||
67 | anchors.right: parent.right | 89 | height: parent.height |
68 | 90 | ||
69 | //FIXME: proper item name | 91 | iconName: "edit-delete" |
70 | iconName: "applications-system" | 92 | text: "Delete Mail" |
93 | |||
94 | onClicked: { | ||
95 | mailList.deleteMail() | ||
96 | } | ||
97 | } | ||
71 | } | 98 | } |
72 | } | 99 | } |
73 | 100 | ||
diff --git a/framework/mail/maillistcontroller.cpp b/framework/mail/maillistcontroller.cpp index 859aed91..07baeb01 100644 --- a/framework/mail/maillistcontroller.cpp +++ b/framework/mail/maillistcontroller.cpp | |||
@@ -58,3 +58,32 @@ void MailListController::loadImportantMail() | |||
58 | query.propertyFilter.insert("important", true); | 58 | query.propertyFilter.insert("important", true); |
59 | m_model->runQuery(query); | 59 | m_model->runQuery(query); |
60 | } | 60 | } |
61 | |||
62 | QString MailListController::selectedMail() const | ||
63 | { | ||
64 | return m_selectedMail; | ||
65 | } | ||
66 | |||
67 | void MailListController::setSelectedMail(const QString& id) | ||
68 | { | ||
69 | if (m_selectedMail != id) { | ||
70 | m_selectedMail = id; | ||
71 | emit selectedMailChanged(); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | void MailListController::markMailImportant(bool important) | ||
76 | { | ||
77 | qDebug() << "user action: mark mail important "; | ||
78 | } | ||
79 | |||
80 | void MailListController::markMailUnread(bool unread) | ||
81 | { | ||
82 | qDebug() << "user action: mark mail unread "; | ||
83 | } | ||
84 | |||
85 | void MailListController::deleteMail() | ||
86 | { | ||
87 | qDebug() << "user action: delete mail"; | ||
88 | } | ||
89 | |||
diff --git a/framework/mail/maillistcontroller.h b/framework/mail/maillistcontroller.h index ebdc990b..3c969403 100644 --- a/framework/mail/maillistcontroller.h +++ b/framework/mail/maillistcontroller.h | |||
@@ -11,18 +11,31 @@ class MailListController : public QObject | |||
11 | { | 11 | { |
12 | Q_OBJECT | 12 | Q_OBJECT |
13 | Q_PROPERTY (MailListModel *model READ model CONSTANT) | 13 | Q_PROPERTY (MailListModel *model READ model CONSTANT) |
14 | Q_PROPERTY (QString selectedMail READ selectedMail WRITE setSelectedMail NOTIFY selectedMailChanged) | ||
14 | 15 | ||
15 | public: | 16 | public: |
16 | explicit MailListController(QObject *parent = Q_NULLPTR); | 17 | explicit MailListController(QObject *parent = Q_NULLPTR); |
17 | 18 | ||
18 | MailListModel *model() const; | 19 | MailListModel *model() const; |
19 | 20 | ||
21 | QString selectedMail() const; | ||
22 | void setSelectedMail(const QString &id); | ||
23 | |||
24 | signals: | ||
25 | void selectedMailChanged(); | ||
26 | |||
20 | public slots: | 27 | public slots: |
21 | void loadAllMail(); | 28 | void loadAllMail(); |
22 | void loadUnreadMail(); | 29 | void loadUnreadMail(); |
23 | void loadImportantMail(); | 30 | void loadImportantMail(); |
24 | void loadMailFolder(const QString &folderId); | 31 | void loadMailFolder(const QString &folderId); |
25 | 32 | ||
33 | void markMailImportant(bool important); | ||
34 | void markMailUnread(bool unread); | ||
35 | void deleteMail(); | ||
36 | |||
26 | private: | 37 | private: |
27 | QScopedPointer<MailListModel> m_model; | 38 | QScopedPointer<MailListModel> m_model; |
39 | |||
40 | QString m_selectedMail; | ||
28 | }; | 41 | }; |