diff options
Diffstat (limited to 'src/gui/windows/mailviewwindow.cpp')
-rw-r--r-- | src/gui/windows/mailviewwindow.cpp | 25 |
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(); +} |