}
// 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');
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;
}
// ----------------------------------------------------------------------------
_T("wxExecute() can be called only from the main thread") );
#endif // wxUSE_THREADS
-#if defined(__DARWIN__)
+#if defined(__WXCOCOA__) || ( defined(__WXOSX_MAC__) && wxOSX_USE_COCOA_OR_CARBON )
// wxMacLaunch() only executes app bundles and only does it asynchronously.
// It returns false if the target is not an app bundle, thus falling
// through to the regular code for non app bundles.
DECLARE_NO_COPY_CLASS(wxEndHandler)
};
-#if wxUSE_STREAMS
+#if HAS_PIPE_INPUT_STREAM
// class for monitoring our ends of child stdout/err, should be constructed
// with the FD and stream from wxExecuteData and will do nothing if they're
DECLARE_NO_COPY_CLASS(wxRedirectedIOHandler)
};
-#endif // wxUSE_STREAMS
+#endif // HAS_PIPE_INPUT_STREAM
// helper function which calls waitpid() and analyzes the result
int DoWaitForChild(int pid, int flags = 0)
}
//else: synchronous execution case
-#if wxUSE_STREAMS
+#if HAS_PIPE_INPUT_STREAM
wxProcess * const process = execData.process;
if ( process && process->IsRedirected() )
{
}
}
//else: no IO redirection, just block waiting for the child to exit
-#endif // wxUSE_STREAMS
+#endif // HAS_PIPE_INPUT_STREAM
return DoWaitForChild(execData.pid);
}