From c10e0009f7ad6930cb59caea6e971127bef441ee Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Apr 2015 17:32:06 +0300 Subject: Add reply button for reply to mail message. --- src/gui/windows/mailviewwindow.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/gui/windows/mailviewwindow.cpp') 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(); + } } -- cgit v1.2.3-70-g09d2