* When activating the "Shutdown" menu (instead of one of its items), we now
get the old shutdown dialog back, but with the additional option to reboot instead. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30731 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -488,11 +488,15 @@ TBarApp::MessageReceived(BMessage *message)
|
||||
break;
|
||||
|
||||
case CMD_REBOOT_SYSTEM:
|
||||
case CMD_SHUTDOWN_SYSTEM: {
|
||||
case CMD_SHUTDOWN_SYSTEM:
|
||||
{
|
||||
bool reboot = (message->what == CMD_REBOOT_SYSTEM);
|
||||
bool confirm;
|
||||
message->FindBool("confirm", &confirm);
|
||||
|
||||
BRoster roster;
|
||||
BRoster::Private rosterPrivate(roster);
|
||||
status_t error = rosterPrivate.ShutDown(reboot, false, false);
|
||||
status_t error = rosterPrivate.ShutDown(reboot, confirm, false);
|
||||
if (error != B_OK)
|
||||
fprintf(stderr, "Shutdown failed: %s\n", strerror(error));
|
||||
|
||||
|
||||
@@ -386,10 +386,13 @@ TBeMenu::AddStandardBeMenuItems()
|
||||
|
||||
#ifdef __HAIKU__
|
||||
shutdownMenu->SetTargetForItems(be_app);
|
||||
BMessage* message = new BMessage(CMD_SHUTDOWN_SYSTEM);
|
||||
message->AddBool("confirm", true);
|
||||
AddItem(new BMenuItem(shutdownMenu, message));
|
||||
#else
|
||||
shutdownMenu->SetTargetForItems(BMessenger(ROSTER_SIG));
|
||||
#endif
|
||||
AddItem(shutdownMenu);
|
||||
#endif
|
||||
|
||||
fAddState = kAddingRecents;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user