diff options
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/mailviewwindow.cpp | 25 | ||||
-rw-r--r-- | src/gui/windows/mailviewwindow.h | 2 |
2 files changed, 27 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(); +} diff --git a/src/gui/windows/mailviewwindow.h b/src/gui/windows/mailviewwindow.h index 13ad25676..c3f691629 100644 --- a/src/gui/windows/mailviewwindow.h +++ b/src/gui/windows/mailviewwindow.h @@ -53,6 +53,8 @@ class MailViewWindow final : public Window, void removeItems(const int64_t mailId); + void removeMoney(const int64_t mailId); + private: void updateAttachButton(); |