summaryrefslogtreecommitdiff
path: root/src/gui/windows/mailwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-29 17:18:55 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-29 17:18:55 +0300
commit8e0bbcbabb8752d8c28618e98a1ea46309252f3a (patch)
treea2fd55724d70fca908e75a6ca35ae0397be8d965 /src/gui/windows/mailwindow.cpp
parent1854355195f6124e62aa9bdf42e1bb0d93d9a900 (diff)
downloadmanaplus-8e0bbcbabb8752d8c28618e98a1ea46309252f3a.tar.gz
manaplus-8e0bbcbabb8752d8c28618e98a1ea46309252f3a.tar.bz2
manaplus-8e0bbcbabb8752d8c28618e98a1ea46309252f3a.tar.xz
manaplus-8e0bbcbabb8752d8c28618e98a1ea46309252f3a.zip
Add ability for return mail message to sender.
Diffstat (limited to 'src/gui/windows/mailwindow.cpp')
-rw-r--r--src/gui/windows/mailwindow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index a37367f6f..15faf779a 100644
--- a/src/gui/windows/mailwindow.cpp
+++ b/src/gui/windows/mailwindow.cpp
@@ -61,6 +61,8 @@ MailWindow::MailWindow() :
// TRANSLATORS: mail window button
mDeleteButton(new Button(this, _("Delete"), "delete", this)),
// TRANSLATORS: mail window button
+ mReturnButton(new Button(this, _("Return"), "return", this)),
+ // TRANSLATORS: mail window button
mOpenButton(new Button(this, _("Open"), "open", this))
{
mListBox->postInit();
@@ -87,6 +89,7 @@ MailWindow::MailWindow() :
placer(4, 1, mOpenButton);
placer(4, 2, mNewButton);
placer(4, 3, mDeleteButton);
+ placer(4, 4, mReturnButton);
Layout &layout = getLayout();
layout.setRowHeight(0, LayoutType::SET);
@@ -131,6 +134,14 @@ void MailWindow::action(const ActionEvent &event)
const MailMessage *const mail = mMessages[sel];
mailHandler->deleteMessage(mail->id);
}
+ else if (eventId == "return")
+ {
+ const int sel = mListBox->getSelected();
+ if (sel < 0)
+ return;
+ const MailMessage *const mail = mMessages[sel];
+ mailHandler->returnMessage(mail->id);
+ }
}
void MailWindow::clear()