From c1baf4b58b05f9bc10fe4d84b038de6583617e8b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Aug 2008 10:59:30 +0000 Subject: [PATCH] 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 --- src/unix/utilsunx.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 0d1cf55045..d4be56b50d 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -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; } // ---------------------------------------------------------------------------- -- 2.45.2