summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
de9815c)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31081
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- classes in the manual are now cross-referenced (Zbigniew Zagórski)
- Norwegian (Bokmål) translation added (Hans F. Nordhaug)
- wxDynamicLibrary::HasSymbol() added
- classes in the manual are now cross-referenced (Zbigniew Zagórski)
- Norwegian (Bokmål) translation added (Hans F. Nordhaug)
- wxDynamicLibrary::HasSymbol() added
+- added wxEXEC_NODISABLE flag to be used with wxExecute(wxEXEC_SYNC)
- added wxTextInputStream::operator>>(wchar_t) for compilers which support this
- added wxURI, a class for dealing with Uniform Resource Identifiers
- changed wxURL to inherit from wxURI and provide assignment and comparison
- added wxTextInputStream::operator>>(wchar_t) for compilers which support this
- added wxURI, a class for dealing with Uniform Resource Identifiers
- changed wxURL to inherit from wxURI and provide assignment and comparison
the process (which terminates by the moment the function returns) and will be
$-1$ if the process couldn't be started and typically 0 if the process
terminated successfully. Also, while waiting for the process to
the process (which terminates by the moment the function returns) and will be
$-1$ if the process couldn't be started and typically 0 if the process
terminated successfully. Also, while waiting for the process to
-terminate, wxExecute will call \helpref{wxYield}{wxyield}. The caller
-should ensure that this can cause no recursion, in the simplest case by
-calling \helpref{wxEnableTopLevelWindows(false)}{wxenabletoplevelwindows}.
+terminate, wxExecute will call \helpref{wxYield}{wxyield}. Because of this, by
+default this function disables all application windows to avoid unexpected
+reentrancies which could result from the users interaction with the program
+while the child process is running. If you are sure that it is safe to not
+disable the program windows, you may pass \texttt{wxEXEC\_NODISABLE} flag to
+prevent this automatic disabling from happening.
For asynchronous execution, however, the return value is the process id and
zero value indicates that the command could not be executed. As an added
For asynchronous execution, however, the return value is the process id and
zero value indicates that the command could not be executed. As an added
// under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
// kills all children as well as pid
// under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
// kills all children as well as pid
- wxEXEC_MAKE_GROUP_LEADER = 4
+ wxEXEC_MAKE_GROUP_LEADER = 4,
+
+ // by default synchronous execution disables all program windows to avoid
+ // that the user interacts with the program while the child process is
+ // running, you can use this flag to prevent this from happening
+ wxEXEC_NODISABLE = 8
};
// Execute another program.
};
// Execute another program.
- wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
- wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") );
+ wxAppTraits *traits = NULL;
+ void *cookie wxDUMMY_INITIALIZE(NULL);
+ if ( !(flags & wxEXEC_NODISABLE) )
+ {
+ if ( wxTheApp )
+ traits = wxTheApp->GetTraits();
+ wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") );
- // disable all app windows while waiting for the child process to finish
- void *cookie = traits->BeforeChildWaitLoop();
+ // disable all app windows while waiting for the child process to finish
+ cookie = traits->BeforeChildWaitLoop();
+ }
// wait until the child process terminates
while ( data->state )
// wait until the child process terminates
while ( data->state )
- traits->AfterChildWaitLoop(cookie);
+ if ( traits )
+ traits->AfterChildWaitLoop(cookie);
DWORD dwExitCode = data->dwExitCode;
delete data;
DWORD dwExitCode = data->dwExitCode;
delete data;
{
wxEndProcessData *endProcData = new wxEndProcessData;
{
wxEndProcessData *endProcData = new wxEndProcessData;
+ const int flags = execData.flags;
+
// wxAddProcessCallback is now (with DARWIN) allowed to call the
// callback function directly if the process terminates before
// the callback can be added to the run loop. Set up the endProcData.
// wxAddProcessCallback is now (with DARWIN) allowed to call the
// callback function directly if the process terminates before
// the callback can be added to the run loop. Set up the endProcData.
- if ( execData.flags & wxEXEC_SYNC )
+ if ( flags & wxEXEC_SYNC )
{
// we may have process for capturing the program output, but it's
// not used in wxEndProcessData in the case of sync execution
{
// we may have process for capturing the program output, but it's
// not used in wxEndProcessData in the case of sync execution
execData.pipeEndProcDetect.Close();
#endif // defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__))
execData.pipeEndProcDetect.Close();
#endif // defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__))
- if ( execData.flags & wxEXEC_SYNC )
+ if ( flags & wxEXEC_SYNC )
+ wxWindowDisabler *wd = flags & wxEXEC_NODISABLE ? NULL
+ : new wxWindowDisabler;
// endProcData->pid will be set to 0 from GTK_EndProcessDetector when the
// process terminates
// endProcData->pid will be set to 0 from GTK_EndProcessDetector when the
// process terminates
int exitcode = endProcData->exitcode;
int exitcode = endProcData->exitcode;
delete endProcData;
return exitcode;
delete endProcData;
return exitcode;