summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-29 16:10:50 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-29 16:10:50 +0300
commitdc88f5c3c406c8bd66fcd8f1f355711f5ef64807 (patch)
treebd10c4288ba8096a21002af1de098167010028e5
parentb7258f41b38b1fd1d8c6fec6984aa931f847e718 (diff)
downloadplus-dc88f5c3c406c8bd66fcd8f1f355711f5ef64807.tar.gz
plus-dc88f5c3c406c8bd66fcd8f1f355711f5ef64807.tar.bz2
plus-dc88f5c3c406c8bd66fcd8f1f355711f5ef64807.tar.xz
plus-dc88f5c3c406c8bd66fcd8f1f355711f5ef64807.zip
Add ability to get attach from mail message.
-rw-r--r--src/gui/windows/mailviewwindow.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp
index baafc0d93..3caf7dc53 100644
--- a/src/gui/windows/mailviewwindow.cpp
+++ b/src/gui/windows/mailviewwindow.cpp
@@ -56,7 +56,7 @@ MailViewWindow::MailViewWindow(const MailMessage *const message) :
ActionListener(),
mMessage(message),
// TRANSLATORS: mail view window button
- mGetAttachButton(new Button(this, _("Get attach"), "attach", this)),
+ mGetAttachButton(nullptr),
// TRANSLATORS: mail view window button
mCloseButton(new Button(this, _("Close"), "close", this)),
// TRANSLATORS: mail view window label
@@ -116,8 +116,11 @@ MailViewWindow::MailViewWindow(const MailMessage *const message) :
placer(0, n, mItemLabel);
placer(1, n++, mIcon);
}
-
- placer(0, n, mGetAttachButton);
+ if (message->money || message->itemId)
+ {
+ mGetAttachButton = new Button(this, _("Get attach"), "attach", this);
+ placer(0, n, mGetAttachButton);
+ }
placer(2, n, mCloseButton);
loadWindowState();
@@ -143,4 +146,9 @@ void MailViewWindow::action(const ActionEvent &event)
{
scheduleDelete();
}
+ else if (eventId == "attach")
+ {
+ if (mGetAttachButton)
+ mailHandler->getAttach(mMessage->id);
+ }
}