* Since the "restart"/"shutdown" alert has the inconvenient consequence that the

shutdown process is entered (ie. you cannot start new applications anymore),
  I changed its window feel to normal to make it possible to let it appear on
  all workspaces.
* We should think about if simply letting it enter that phase later isn't the
  better solution, though. Opinions welcome.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27830 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-10-01 16:45:59 +00:00
parent fb2f3ef96c
commit 1b910a79a2
+11 -11
View File
@@ -123,7 +123,7 @@ public:
: MessageEvent(0, target, MSG_PHASE_TIMED_OUT) : MessageEvent(0, target, MSG_PHASE_TIMED_OUT)
{ {
SetAutoDelete(false); SetAutoDelete(false);
fMessage.AddInt32("phase", INVALID_PHASE); fMessage.AddInt32("phase", INVALID_PHASE);
fMessage.AddInt32("team", -1); fMessage.AddInt32("team", -1);
} }
@@ -540,14 +540,14 @@ private:
stripeRect.right = kStripeWidth; stripeRect.right = kStripeWidth;
SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT)); SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT));
FillRect(stripeRect); FillRect(stripeRect);
if (fAppInfo && fAppInfo->largeIcon) { if (fAppInfo && fAppInfo->largeIcon) {
if (fAppInfo->largeIcon->ColorSpace() == B_RGBA32) { if (fAppInfo->largeIcon->ColorSpace() == B_RGBA32) {
SetDrawingMode(B_OP_ALPHA); SetDrawingMode(B_OP_ALPHA);
SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
} else } else
SetDrawingMode(B_OP_OVER); SetDrawingMode(B_OP_OVER);
DrawBitmapAsync(fAppInfo->largeIcon, DrawBitmapAsync(fAppInfo->largeIcon,
BPoint(kStripeWidth - kIconSize / 2, kIconVSpacing)); BPoint(kStripeWidth - kIconSize / 2, kIconVSpacing));
} }
@@ -944,7 +944,7 @@ ShutdownProcess::_InitShutdownWindow()
} }
} }
// add the applications // add the applications
if (fWindow) { if (fWindow) {
BAutolock _(fWorkerLock); BAutolock _(fWorkerLock);
_AddShutdownWindowApps(fUserApps); _AddShutdownWindowApps(fUserApps);
@@ -1248,10 +1248,8 @@ ShutdownProcess::_WorkerDoShutdown()
// that is, if an asynchronous BRoster::Shutdown() was requested, we // that is, if an asynchronous BRoster::Shutdown() was requested, we
// notify the caller at this point. // notify the caller at this point.
bool synchronous; bool synchronous;
if (fRequest->FindBool("synchronous", &synchronous) == B_OK if (fRequest->FindBool("synchronous", &synchronous) == B_OK && !synchronous)
&& !synchronous) {
_SendReply(B_OK); _SendReply(B_OK);
}
// ask the user to confirm the shutdown, if desired // ask the user to confirm the shutdown, if desired
bool askUser; bool askUser;
@@ -1264,6 +1262,8 @@ ShutdownProcess::_WorkerDoShutdown()
BAlert *alert = new BAlert(title, text, "Cancel", buttonText, NULL, BAlert *alert = new BAlert(title, text, "Cancel", buttonText, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
alert->SetFeel(B_NORMAL_WINDOW_FEEL);
alert->SetWorkspaces(B_ALL_WORKSPACES);
int32 result = alert->Go(); int32 result = alert->Go();
if (result != 1) if (result != 1)
@@ -1404,7 +1404,7 @@ ShutdownProcess::_QuitApps(AppInfoList &list, bool systemApps)
status_t error = _GetNextEvent(event, team, phase, false); status_t error = _GetNextEvent(event, team, phase, false);
if (error != B_OK) if (error != B_OK)
throw_error(error); throw_error(error);
if (event == ABORT_EVENT) { if (event == ABORT_EVENT) {
PRINT(("ShutdownProcess::_QuitApps(): shutdown cancelled by " PRINT(("ShutdownProcess::_QuitApps(): shutdown cancelled by "
"team %ld (-1 => user)\n", team)); "team %ld (-1 => user)\n", team));
@@ -1412,7 +1412,7 @@ ShutdownProcess::_QuitApps(AppInfoList &list, bool systemApps)
_DisplayAbortingApp(team); _DisplayAbortingApp(team);
throw_error(B_SHUTDOWN_CANCELLED); throw_error(B_SHUTDOWN_CANCELLED);
} }
} while (event != NO_EVENT); } while (event != NO_EVENT);
} }
@@ -1556,7 +1556,7 @@ ShutdownProcess::_WaitForBackgroundApps()
// ignore: it's too late to abort the shutdown // ignore: it's too late to abort the shutdown
} }
if (event == TIMEOUT_EVENT) if (event == TIMEOUT_EVENT)
return; return;
} }
} }
@@ -1794,7 +1794,7 @@ ShutdownProcess::_DisplayAbortingApp(team_id team)
if (event == TIMEOUT_EVENT) if (event == TIMEOUT_EVENT)
break; break;
// stop waiting when the user hit the cancel button // stop waiting when the user hit the cancel button
if (event == ABORT_EVENT && phase == ABORTED_PHASE && eventTeam < 0) if (event == ABORT_EVENT && phase == ABORTED_PHASE && eventTeam < 0)
break; break;