summaryrefslogtreecommitdiff
path: root/src/gui/windows/mailviewwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-26 20:06:09 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-26 20:06:09 +0300
commit7a94bb34d78f88c93e280da04dd8542b26686ed1 (patch)
tree5b149edf9799e8a482a4bdc26bc0f83a8df7ca7a /src/gui/windows/mailviewwindow.cpp
parent86735e142e86391e46b0eafbcb7ef01e25fc969a (diff)
downloadmv-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.gz
mv-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.bz2
mv-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.xz
mv-7a94bb34d78f88c93e280da04dd8542b26686ed1.zip
Add support for getting attached money from mail message.
Diffstat (limited to 'src/gui/windows/mailviewwindow.cpp')
-rw-r--r--src/gui/windows/mailviewwindow.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp
index b250fad43..15c28480c 100644
--- a/src/gui/windows/mailviewwindow.cpp
+++ b/src/gui/windows/mailviewwindow.cpp
@@ -251,3 +251,28 @@ void MailViewWindow::removeItems(const int64_t mailId)
if (mailWindow)
mailWindow->refreshMailNames();
}
+
+void MailViewWindow::removeMoney(const int64_t mailId)
+{
+ if (mailId != mMessage->id)
+ return;
+ mMessage->type = static_cast<MailMessageType::Type>(
+ CAST_S32(mMessage->type) | CAST_S32(MailMessageType::Money));
+ mMessage->type = static_cast<MailMessageType::Type>(
+ CAST_S32(mMessage->type) ^ CAST_S32(MailMessageType::Money));
+
+ mMessage->money = 0;
+
+ if (mMoneyLabel == nullptr)
+ return;
+
+ if (mGetMoneyButton)
+ mGetMoneyButton->setVisible(Visible_false);
+
+ mMoneyLabel->setCaption(strprintf("%s %d",
+ // TRANSLATORS: mail view window label
+ _("Money:"),
+ 0));
+ if (mailWindow)
+ mailWindow->refreshMailNames();
+}