summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);
+ }
}