summaryrefslogtreecommitdiff
path: root/src/gui/windows/mailwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-25 20:45:38 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-25 20:45:38 +0300
commitf7d3792df9fd01ea7baabaf9b612031b1f28d7ab (patch)
treea38b12795443c2c364059cf418d6171171d4434b /src/gui/windows/mailwindow.cpp
parent6adafcc07e2101ab085bd9f2182c965ef70d0519 (diff)
downloadmanaverse-f7d3792df9fd01ea7baabaf9b612031b1f28d7ab.tar.gz
manaverse-f7d3792df9fd01ea7baabaf9b612031b1f28d7ab.tar.bz2
manaverse-f7d3792df9fd01ea7baabaf9b612031b1f28d7ab.tar.xz
manaverse-f7d3792df9fd01ea7baabaf9b612031b1f28d7ab.zip
Add basic support for view mail message.
Diffstat (limited to 'src/gui/windows/mailwindow.cpp')
-rw-r--r--src/gui/windows/mailwindow.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index c12b719fc..8dc54cf94 100644
--- a/src/gui/windows/mailwindow.cpp
+++ b/src/gui/windows/mailwindow.cpp
@@ -140,7 +140,10 @@ void MailWindow::action(const ActionEvent &event)
if (sel < 0)
return;
const MailMessage *const mail = mMessages[sel];
- mailHandler->readMessage(mail->id);
+ if (mUseMail2)
+ mail2Handler->readMail(mOpenType, mail->id);
+ else
+ mailHandler->readMessage(mail->id);
}
else if (eventId == "delete")
{
@@ -234,7 +237,8 @@ void MailWindow::removeMail(const int64_t id)
}
}
-void MailWindow::showMessage(MailMessage *const mail)
+void MailWindow::showMessage(MailMessage *const mail,
+ const int itemsCount)
{
if (mail == nullptr)
return;
@@ -247,7 +251,8 @@ void MailWindow::showMessage(MailMessage *const mail)
mail->strTime = mail2->strTime;
}
delete mailViewWindow;
- CREATEWIDGETV(mailViewWindow, MailViewWindow, mail);
+ CREATEWIDGETV(mailViewWindow, MailViewWindow, mail,
+ itemsCount);
}
void MailWindow::viewNext(const int64_t id)
@@ -337,3 +342,11 @@ void MailWindow::createMail(const std::string &to)
CREATEWIDGETV0(mailEditWindow, MailEditWindow);
mailEditWindow->setTo(to);
}
+
+MailMessage *MailWindow::findMail(const int64_t id)
+{
+ std::map<int64_t, MailMessage*>::iterator it = mMessagesMap.find(id);
+ if (it != mMessagesMap.end())
+ return (*it).second;
+ return nullptr;
+}