summaryrefslogtreecommitdiff
path: root/src
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
parent1854355195f6124e62aa9bdf42e1bb0d93d9a900 (diff)
downloadplus-8e0bbcbabb8752d8c28618e98a1ea46309252f3a.tar.gz
plus-8e0bbcbabb8752d8c28618e98a1ea46309252f3a.tar.bz2
plus-8e0bbcbabb8752d8c28618e98a1ea46309252f3a.tar.xz
plus-8e0bbcbabb8752d8c28618e98a1ea46309252f3a.zip
Add ability for return mail message to sender.
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/mailwindow.cpp11
-rw-r--r--src/gui/windows/mailwindow.h1
2 files changed, 12 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()
diff --git a/src/gui/windows/mailwindow.h b/src/gui/windows/mailwindow.h
index 236b3c7e1..15964aafe 100644
--- a/src/gui/windows/mailwindow.h
+++ b/src/gui/windows/mailwindow.h
@@ -64,6 +64,7 @@ class MailWindow final : public Window,
Button *mRefreshButton;
Button *mNewButton;
Button *mDeleteButton;
+ Button *mReturnButton;
Button *mOpenButton;
};