summaryrefslogtreecommitdiff
path: root/src/gui/windows/mailviewwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-30 17:32:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-30 17:32:06 +0300
commitc10e0009f7ad6930cb59caea6e971127bef441ee (patch)
treec9bdbd9fcf96841db0308e18b6de1c9d36ef3df3 /src/gui/windows/mailviewwindow.cpp
parent7404124bf2578b713f613a749b283e8a1ed1faa3 (diff)
downloadplus-c10e0009f7ad6930cb59caea6e971127bef441ee.tar.gz
plus-c10e0009f7ad6930cb59caea6e971127bef441ee.tar.bz2
plus-c10e0009f7ad6930cb59caea6e971127bef441ee.tar.xz
plus-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.cpp18
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();
+ }
}