diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-24 20:47:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-24 20:47:07 +0300 |
commit | f2f123e95adc6aa6a1a81bef0414705df30986e3 (patch) | |
tree | 5a0d7adf14a8410c65865aaf82a03f8e45e4c9be /src/gui/windows/mailwindow.cpp | |
parent | 42531b3cf82aace768f2960f0ea6d07815274026 (diff) | |
download | manaverse-f2f123e95adc6aa6a1a81bef0414705df30986e3.tar.gz manaverse-f2f123e95adc6aa6a1a81bef0414705df30986e3.tar.bz2 manaverse-f2f123e95adc6aa6a1a81bef0414705df30986e3.tar.xz manaverse-f2f123e95adc6aa6a1a81bef0414705df30986e3.zip |
Refresh mail list from new mail system.
Diffstat (limited to 'src/gui/windows/mailwindow.cpp')
-rw-r--r-- | src/gui/windows/mailwindow.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index 063f1a29f..3d157ad3b 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -20,8 +20,11 @@ #include "gui/windows/mailwindow.h" +#include "settings.h" + #include "enums/gui/layouttype.h" +#include "net/mail2handler.h" #include "net/mailhandler.h" #include "gui/models/extendednamesmodel.h" @@ -70,7 +73,8 @@ MailWindow::MailWindow() : // TRANSLATORS: mail window button mReturnButton(new Button(this, _("Return"), "return", this)), // TRANSLATORS: mail window button - mOpenButton(new Button(this, _("Open"), "open", this)) + mOpenButton(new Button(this, _("Open"), "open", this)), + mUseMail2(settings.enableNewMailSystem) { setWindowName("Mail"); setCloseButton(true); @@ -119,7 +123,7 @@ void MailWindow::action(const ActionEvent &event) const std::string &eventId = event.getId(); if (eventId == "refresh") { - mailHandler->refresh(); + refreshMails(); } else if (eventId == "new") { @@ -284,7 +288,15 @@ void MailWindow::mouseClicked(MouseEvent &event) void MailWindow::postConnection() { - mailHandler->refresh(); + refreshMails(); +} + +void MailWindow::refreshMails() +{ + if (mUseMail2) + mail2Handler->refreshMailList(MailOpenType::Mail, 0); + else + mailHandler->refresh(); } void MailWindow::createMail(const std::string &to) |