update for wxSHUTDOWN_LOGOFF/FORCE, should have been part of r54949

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-08-03 10:59:30 +00:00
parent 118a41d993
commit c1baf4b58b

View File

@ -266,10 +266,12 @@ int wxKill(long pid, wxSignal sig, wxKillError *rc, int flags)
}
// Shutdown or reboot the PC
bool wxShutdown(wxShutdownFlags wFlags)
bool wxShutdown(int flags)
{
flags &= ~wxSHUTDOWN_FORCE;
wxChar level;
switch ( wFlags )
switch ( flags )
{
case wxSHUTDOWN_POWEROFF:
level = _T('0');
@ -279,12 +281,16 @@ bool wxShutdown(wxShutdownFlags wFlags)
level = _T('6');
break;
case wxSHUTDOWN_LOGOFF:
// TODO: use dcop to log off?
return false;
default:
wxFAIL_MSG( _T("unknown wxShutdown() flag") );
return false;
}
return system(wxString::Format(_T("init %c"), level).mb_str()) == 0;
return system(wxString::Format("init %c", level).mb_str()) == 0;
}
// ----------------------------------------------------------------------------