From e48f3e5b7e05e19af417a64a958e7dd62e17dec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 25 Nov 2009 21:51:29 +0000 Subject: [PATCH] Reverted part of r34253 and fixed the ticket for real plus another bug: * When the user presses Cancel or Kill in the Shutdown progress window, in no event will the "Application X aborted the shutdown process" be displayed. * When the shutdown process already entered the waiting for a possibly blocked app, and the app aborts the shutdown then, the "Application X aborted..." alert will be displayed (issue not mentioned in ticket). Fixes #3863 for real. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34261 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/registrar/ShutdownProcess.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/servers/registrar/ShutdownProcess.cpp b/src/servers/registrar/ShutdownProcess.cpp index 41e60cb71c..89d3e3c6ac 100644 --- a/src/servers/registrar/ShutdownProcess.cpp +++ b/src/servers/registrar/ShutdownProcess.cpp @@ -1366,6 +1366,11 @@ ShutdownProcess::_WaitForApp(team_id team, AppInfoList* list, bool systemApps) return false; if (event == ABORT_EVENT) { + if (eventTeam == -1) { + // The user canceled the shutdown process by pressing the + // Cancel button. + throw_error(B_SHUTDOWN_CANCELLED); + } if (systemApps) { // If the app requests aborting the shutdown, we don't need // to wait any longer. It has processed the request and @@ -1373,10 +1378,11 @@ ShutdownProcess::_WaitForApp(team_id team, AppInfoList* list, bool systemApps) if (eventTeam == team) return false; } else { + // The app returned false in QuitRequested(). PRINT(("ShutdownProcess::_WaitForApp(): shutdown cancelled " "by team %ld (-1 => user)\n", eventTeam)); - _DisplayAbortingApp(eventTeam); + _DisplayAbortingApp(team); throw_error(B_SHUTDOWN_CANCELLED); } } @@ -1708,6 +1714,8 @@ ShutdownProcess::_QuitBlockingApp(AppInfoList& list, team_id team, PRINT(("ShutdownProcess::_QuitBlockingApp(): shutdown " "cancelled by team %ld (-1 => user)\n", eventTeam)); + if (!debugged) + _DisplayAbortingApp(team); throw_error(B_SHUTDOWN_CANCELLED); }