X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69328170cc55c9b36ae0aac40b24ba51ed4f871e..f1bb54f84e1a21811eb93bf5e2629830339c1a2c:/samples/exec/exec.cpp diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index add59464c9..34a8ff5c62 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -53,6 +53,7 @@ #include "wx/numdlg.h" #include "wx/textdlg.h" #include "wx/ffile.h" +#include "wx/stopwatch.h" #include "wx/process.h" @@ -762,13 +763,15 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) if ( sync ) { - wxLogStatus( _T("'%s' is running please wait..."), cmd.c_str() ); + wxLogStatus("\"%s\" is running please wait...", cmd); + + wxStopWatch sw; wxArrayString output, errors; int code = wxExecute(cmd, output, errors); - wxLogStatus(_T("Command '%s' terminated with exit code %d."), - cmd.c_str(), code); + wxLogStatus("Command \"%s\" terminated after %ldms; exit code %d.", + cmd, sw.Time(), code); if ( code != -1 ) { @@ -882,7 +885,7 @@ void MyFrame::OnFileExec(wxCommandEvent& WXUNUSED(event)) s_filename = filename; - wxString ext = filename.AfterFirst(_T('.')); + wxString ext = filename.AfterLast(_T('.')); wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext); if ( !ft ) {