]> git.saurik.com Git - wxWidgets.git/commitdiff
update for wxSHUTDOWN_LOGOFF/FORCE, should have been part of r54949
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Aug 2008 10:59:30 +0000 (10:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Aug 2008 10:59:30 +0000 (10:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/utilsunx.cpp

index 0d1cf550459c3a254ada704618ff96efda7185ba..d4be56b50dcdc60d5ca374782a1011b25c0ec14e 100644 (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;
 }
 
 // ----------------------------------------------------------------------------