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
This commit is contained in:
@@ -140,8 +140,6 @@ static const uint32 kByForumlaItem = 'Fbyq';
|
|||||||
BList TMailWindow::sWindowList;
|
BList TMailWindow::sWindowList;
|
||||||
BLocker TMailWindow::sWindowListLock;
|
BLocker TMailWindow::sWindowListLock;
|
||||||
|
|
||||||
static bool sKeepStatusOnQuit;
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
@@ -172,12 +170,13 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
fReadButton(NULL),
|
fReadButton(NULL),
|
||||||
fNextButton(NULL)
|
fNextButton(NULL)
|
||||||
{
|
{
|
||||||
|
fKeepStatusOnQuit = false;
|
||||||
|
|
||||||
if (messenger != NULL)
|
if (messenger != NULL)
|
||||||
fTrackerMessenger = *messenger;
|
fTrackerMessenger = *messenger;
|
||||||
|
|
||||||
char str[256];
|
char str[256];
|
||||||
char status[272];
|
char status[272];
|
||||||
uint32 message;
|
|
||||||
float height;
|
float height;
|
||||||
BMenu* menu;
|
BMenu* menu;
|
||||||
BMenu* subMenu;
|
BMenu* subMenu;
|
||||||
@@ -246,22 +245,20 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
|
|
||||||
if (!strcmp(str, "New")) {
|
if (!strcmp(str, "New")) {
|
||||||
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Leave as 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
|
#if 0
|
||||||
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Set to Read"),
|
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Set to Read"),
|
||||||
new BMessage(M_CLOSE_READ), 'W'));
|
new BMessage(M_CLOSE_READ), 'W'));
|
||||||
#endif
|
#endif
|
||||||
message = M_CLOSE_READ;
|
|
||||||
} else {
|
} else {
|
||||||
if (strlen(str))
|
if (strlen(str))
|
||||||
sprintf(status, B_TRANSLATE("Leave as '%s'"), str);
|
sprintf(status, B_TRANSLATE("Leave as '%s'"), str);
|
||||||
else
|
else
|
||||||
sprintf(status, B_TRANSLATE("Leave same"));
|
sprintf(status, B_TRANSLATE("Leave same"));
|
||||||
subMenu->AddItem(item = new BMenuItem(status,
|
subMenu->AddItem(item = new BMenuItem(status,
|
||||||
new BMessage(M_CLOSE_SAME), 'W'));
|
new BMessage(B_QUIT_REQUESTED), 'W'));
|
||||||
message = M_CLOSE_SAME;
|
|
||||||
AddShortcut('W', B_COMMAND_KEY | B_SHIFT_KEY,
|
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"),
|
subMenu->AddItem(new BMenuItem(B_TRANSLATE("Move to trash"),
|
||||||
@@ -1215,17 +1212,9 @@ TMailWindow::MessageReceived(BMessage *msg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kMsgQuitAndKeepAllStatus:
|
case kMsgQuitAndKeepAllStatus:
|
||||||
sKeepStatusOnQuit = true;
|
fKeepStatusOnQuit = true;
|
||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
break;
|
break;
|
||||||
case M_CLOSE_SAME:
|
|
||||||
{
|
|
||||||
BMessage message(B_QUIT_REQUESTED);
|
|
||||||
message.AddString("status", "");
|
|
||||||
message.AddString("same", "");
|
|
||||||
PostMessage(&message);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case M_CLOSE_CUSTOM:
|
case M_CLOSE_CUSTOM:
|
||||||
if (msg->HasString("status")) {
|
if (msg->HasString("status")) {
|
||||||
const char *str;
|
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
|
// ...Otherwise just set the message read
|
||||||
if (fAutoMarkRead == true)
|
if (fAutoMarkRead == true)
|
||||||
SetCurrentMessageRead(B_READ);
|
SetCurrentMessageRead(B_READ);
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ class TMailWindow : public BWindow {
|
|||||||
bool fAutoMarkRead : 1;
|
bool fAutoMarkRead : 1;
|
||||||
BmapButton* fReadButton;
|
BmapButton* fReadButton;
|
||||||
BmapButton* fNextButton;
|
BmapButton* fNextButton;
|
||||||
|
|
||||||
|
bool fKeepStatusOnQuit;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _MAIL_WINDOW_H
|
#endif // _MAIL_WINDOW_H
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ enum MENUS {
|
|||||||
M_DELETE_NEXT,
|
M_DELETE_NEXT,
|
||||||
M_CLOSE_READ,
|
M_CLOSE_READ,
|
||||||
M_CLOSE_SAVED,
|
M_CLOSE_SAVED,
|
||||||
M_CLOSE_SAME,
|
|
||||||
M_CLOSE_CUSTOM,
|
M_CLOSE_CUSTOM,
|
||||||
M_STATUS,
|
M_STATUS,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user