From dc88f5c3c406c8bd66fcd8f1f355711f5ef64807 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 29 Apr 2015 16:10:50 +0300 Subject: Add ability to get attach from mail message. --- src/gui/windows/mailviewwindow.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') 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); + } } -- cgit v1.2.3-70-g09d2