From 0a0ce30e651fd17c5c199f796f18f6fb0ec1ce13 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Sun, 27 Feb 2011 19:57:31 +0000 Subject: [PATCH] Quitting the mail window should result in a normal attribute update so remove the custom status string from the quit message. Cleanup. Fix #7290. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40730 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/mail/MailWindow.cpp | 25 +++++++------------------ src/apps/mail/MailWindow.h | 2 ++ src/apps/mail/Messages.h | 1 - 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/apps/mail/MailWindow.cpp b/src/apps/mail/MailWindow.cpp index 892176eefd..8116196c38 100644 --- a/src/apps/mail/MailWindow.cpp +++ b/src/apps/mail/MailWindow.cpp @@ -140,8 +140,6 @@ static const uint32 kByForumlaItem = 'Fbyq'; BList TMailWindow::sWindowList; BLocker TMailWindow::sWindowListLock; -static bool sKeepStatusOnQuit; - // #pragma mark - @@ -172,12 +170,13 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app, fReadButton(NULL), fNextButton(NULL) { + fKeepStatusOnQuit = false; + if (messenger != NULL) fTrackerMessenger = *messenger; char str[256]; char status[272]; - uint32 message; float height; BMenu* menu; BMenu* subMenu; @@ -246,22 +245,20 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app, if (!strcmp(str, "New")) { subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Leave as New"), - new BMessage(M_CLOSE_SAME), 'W', B_SHIFT_KEY)); + new BMessage(B_QUIT_REQUESTED), 'W', B_SHIFT_KEY)); #if 0 subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Set to Read"), new BMessage(M_CLOSE_READ), 'W')); #endif - message = M_CLOSE_READ; } else { if (strlen(str)) sprintf(status, B_TRANSLATE("Leave as '%s'"), str); else sprintf(status, B_TRANSLATE("Leave same")); subMenu->AddItem(item = new BMenuItem(status, - new BMessage(M_CLOSE_SAME), 'W')); - message = M_CLOSE_SAME; + new BMessage(B_QUIT_REQUESTED), 'W')); AddShortcut('W', B_COMMAND_KEY | B_SHIFT_KEY, - new BMessage(M_CLOSE_SAME)); + new BMessage(B_QUIT_REQUESTED)); } subMenu->AddItem(new BMenuItem(B_TRANSLATE("Move to trash"), @@ -1215,17 +1212,9 @@ TMailWindow::MessageReceived(BMessage *msg) break; } case kMsgQuitAndKeepAllStatus: - sKeepStatusOnQuit = true; + fKeepStatusOnQuit = true; be_app->PostMessage(B_QUIT_REQUESTED); break; - case M_CLOSE_SAME: - { - BMessage message(B_QUIT_REQUESTED); - message.AddString("status", ""); - message.AddString("same", ""); - PostMessage(&message); - break; - } case M_CLOSE_CUSTOM: if (msg->HasString("status")) { const char *str; @@ -1731,7 +1720,7 @@ TMailWindow::QuitRequested() } } } - } else if (fRef != NULL && !sKeepStatusOnQuit) { + } else if (fRef != NULL && !fKeepStatusOnQuit) { // ...Otherwise just set the message read if (fAutoMarkRead == true) SetCurrentMessageRead(B_READ); diff --git a/src/apps/mail/MailWindow.h b/src/apps/mail/MailWindow.h index 30c81b071d..bb0e1ab00c 100644 --- a/src/apps/mail/MailWindow.h +++ b/src/apps/mail/MailWindow.h @@ -203,6 +203,8 @@ class TMailWindow : public BWindow { bool fAutoMarkRead : 1; BmapButton* fReadButton; BmapButton* fNextButton; + + bool fKeepStatusOnQuit; }; #endif // _MAIL_WINDOW_H diff --git a/src/apps/mail/Messages.h b/src/apps/mail/Messages.h index 746ff0c4b4..1f304f03a4 100644 --- a/src/apps/mail/Messages.h +++ b/src/apps/mail/Messages.h @@ -84,7 +84,6 @@ enum MENUS { M_DELETE_NEXT, M_CLOSE_READ, M_CLOSE_SAVED, - M_CLOSE_SAME, M_CLOSE_CUSTOM, M_STATUS,