summaryrefslogtreecommitdiff
path: root/src/gui/windows/mailviewwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/mailviewwindow.cpp')
-rw-r--r--src/gui/windows/mailviewwindow.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp
index e534ce4b4..bddd03f74 100644
--- a/src/gui/windows/mailviewwindow.cpp
+++ b/src/gui/windows/mailviewwindow.cpp
@@ -50,7 +50,7 @@ MailViewWindow *mailViewWindow = nullptr;
MailViewWindow::MailViewWindow(MailMessage *const message,
const int itemsCount) :
// TRANSLATORS: mail view window name
- Window(_("View mail"), Modal_false, nullptr, "mailview.xml"),
+ Window(_("View Mail"), Modal_false, nullptr, "mailview.xml"),
ActionListener(),
mMessage(message),
mGetAttachButton(new Button(this,
@@ -153,6 +153,8 @@ MailViewWindow::~MailViewWindow()
{
if (mUseMail2)
{
+ if (mDeleted)
+ delete mMessage;
mMessage = nullptr;
}
else
@@ -282,3 +284,16 @@ void MailViewWindow::removeMoney(const int64_t mailId)
if (mailWindow != nullptr)
mailWindow->refreshMailNames();
}
+
+bool MailViewWindow::notifyDeleteAndTransferOwnership(const int64_t mailId)
+{
+ if (mailId != mMessage->id)
+ return false;
+ setCaption("View Mail (DELETED)");
+ mDeleted = true;
+ // this mail's ID no longer exists, so it no longer has a defined
+ // predecessor or successor.
+ mPrevButton->setEnabled(false);
+ mNextButton->setEnabled(false);
+ return true;
+}