diff options
Diffstat (limited to 'src/gui/windows/mailviewwindow.cpp')
-rw-r--r-- | src/gui/windows/mailviewwindow.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp index df2fe1eec..bddd03f74 100644 --- a/src/gui/windows/mailviewwindow.cpp +++ b/src/gui/windows/mailviewwindow.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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; +} |