From d48fe2445b079a129d6094ea77730d831a0e0323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 12 May 2009 21:17:25 +0000 Subject: [PATCH] * Added the option to the shutdown confirmation dialog to perform the "other" shutdown, ie. either reboot or shutdown. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30730 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/registrar/ShutdownProcess.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/servers/registrar/ShutdownProcess.cpp b/src/servers/registrar/ShutdownProcess.cpp index 0758b77a4d..6b102df1f9 100644 --- a/src/servers/registrar/ShutdownProcess.cpp +++ b/src/servers/registrar/ShutdownProcess.cpp @@ -1255,19 +1255,23 @@ ShutdownProcess::_WorkerDoShutdown() // ask the user to confirm the shutdown, if desired bool askUser; if (fHasGUI && fRequest->FindBool("confirm", &askUser) == B_OK && askUser) { - const char *title = (fReboot ? "Restart?" : "Shut Down?"); - const char *text = (fReboot + const char* title = fReboot ? "Restart?" : "Shut Down?"; + const char* text = fReboot ? "Do you really want to restart the system?" - : "Do you really want to shut down the system?"); - const char *buttonText = (fReboot ? "Restart" : "Shut Down"); - BAlert *alert = new BAlert(title, text, "Cancel", buttonText, NULL, + : "Do you really want to shut down the system?"; + const char* defaultText = fReboot ? "Restart" : "Shut Down"; + const char* otherText = fReboot ? "Shut Down" : "Restart"; + BAlert* alert = new BAlert(title, text, "Cancel", otherText, defaultText, B_WIDTH_AS_USUAL, B_WARNING_ALERT); alert->SetShortcut(0, B_ESCAPE); alert->SetFeel(B_NORMAL_WINDOW_FEEL); alert->SetWorkspaces(B_ALL_WORKSPACES); int32 result = alert->Go(); - if (result != 1) + if (result == 1) { + // Toggle shutdown method + fReboot = !fReboot; + } else if (result < 1) throw_error(B_SHUTDOWN_CANCELLED); }