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
This commit is contained in:
Stephan Aßmus 2009-11-25 21:51:29 +00:00
parent eb3cef886e
commit e48f3e5b7e

View File

@ -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);
}