summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/mailwindow.cpp18
-rw-r--r--src/gui/windows/mailwindow.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index 966077e93..e9933b307 100644
--- a/src/gui/windows/mailwindow.cpp
+++ b/src/gui/windows/mailwindow.cpp
@@ -27,6 +27,7 @@
#include "gui/mailmessage.h"
#include "gui/windows/mailedit.h"
+#include "gui/windows/mailview.h"
#include "gui/windows/setupwindow.h"
#include "gui/widgets/button.h"
@@ -110,6 +111,14 @@ void MailWindow::action(const ActionEvent &event)
{
new MailEdit();
}
+ else if (eventId == "open")
+ {
+ const int sel = mListBox->getSelected();
+ if (sel < 0)
+ return;
+ const MailMessage *const mail = mMessages[sel];
+ mailHandler->readMessage(mail->id);
+ }
}
void MailWindow::clear()
@@ -122,5 +131,12 @@ void MailWindow::clear()
void MailWindow::addMail(MailMessage *const message)
{
mMessages.push_back(message);
- mMailModel->add(message->title);
+ mMailModel->add(strprintf("%s %s",
+ message->unread ? " " : "U",
+ message->title.c_str()));
+}
+
+void MailWindow::showMessage(const MailMessage *const mail)
+{
+ new MailView(mail);
}
diff --git a/src/gui/windows/mailwindow.h b/src/gui/windows/mailwindow.h
index 459a6ffc7..b92b21d9e 100644
--- a/src/gui/windows/mailwindow.h
+++ b/src/gui/windows/mailwindow.h
@@ -54,6 +54,8 @@ class MailWindow final : public Window,
void clear();
+ void showMessage(const MailMessage *const mail);
+
private:
std::vector<MailMessage*> mMessages;
ExtendedNamesModel *mMailModel;