diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-30 17:32:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-30 17:32:06 +0300 |
commit | c10e0009f7ad6930cb59caea6e971127bef441ee (patch) | |
tree | c9bdbd9fcf96841db0308e18b6de1c9d36ef3df3 /src/gui/windows/mailviewwindow.cpp | |
parent | 7404124bf2578b713f613a749b283e8a1ed1faa3 (diff) | |
download | manaverse-c10e0009f7ad6930cb59caea6e971127bef441ee.tar.gz manaverse-c10e0009f7ad6930cb59caea6e971127bef441ee.tar.bz2 manaverse-c10e0009f7ad6930cb59caea6e971127bef441ee.tar.xz manaverse-c10e0009f7ad6930cb59caea6e971127bef441ee.zip |
Add reply button for reply to mail message.
Diffstat (limited to 'src/gui/windows/mailviewwindow.cpp')
-rw-r--r-- | src/gui/windows/mailviewwindow.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp index 13961dfde..380e04f3f 100644 --- a/src/gui/windows/mailviewwindow.cpp +++ b/src/gui/windows/mailviewwindow.cpp @@ -26,6 +26,7 @@ #include "gui/mailmessage.h" +#include "gui/windows/maileditwindow.h" #include "gui/windows/mailwindow.h" #include "gui/widgets/button.h" @@ -61,6 +62,8 @@ MailViewWindow::MailViewWindow(const MailMessage *const message) : mCloseButton(new Button(this, _("Close"), "close", this)), mPrevButton(new Button(this, "<", "prev", this)), mNextButton(new Button(this, ">", "next", this)), + // TRANSLATORS: mail view window button + mReplyButton(new Button(this, _("Reply"), "reply", this)), // TRANSLATORS: mail view window label mTimeLabel(new Label(this, strprintf("%s %s", _("Time:"), message->strTime.c_str()))), @@ -136,7 +139,8 @@ MailViewWindow::MailViewWindow(const MailMessage *const message) : placer2(0, 0, mPrevButton); placer2(1, 0, mNextButton); - placer2(2, 0, mCloseButton); + placer2(3, 0, mReplyButton); + placer2(4, 0, mCloseButton); loadWindowState(); enableVisibleSound(true); @@ -176,4 +180,16 @@ void MailViewWindow::action(const ActionEvent &event) if (mMessage) mailWindow->viewPrev(mMessage->id); } + else if (eventId == "reply") + { + if (!mMessage) + return; + if (mailEditWindow) + mailEditWindow->scheduleDelete(); + mailEditWindow = new MailEditWindow; + mailEditWindow->setTo(mMessage->sender); + mailEditWindow->setSubject("Re:" + mMessage->title); + mailEditWindow->setMessage(">" + mMessage->text); + scheduleDelete(); + } } |