summaryrefslogtreecommitdiff
path: root/src/gui
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
parent86735e142e86391e46b0eafbcb7ef01e25fc969a (diff)
downloadplus-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.gz
plus-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.bz2
plus-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.xz
plus-7a94bb34d78f88c93e280da04dd8542b26686ed1.zip
Add support for getting attached money from mail message.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/mailviewwindow.cpp25
-rw-r--r--src/gui/windows/mailviewwindow.h2
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();