]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/exec/exec.cpp
By default, align renderers as column header under GTK+, too.
[wxWidgets.git] / samples / exec / exec.cpp
index 64d1aae2b546b41cbfdb9037e82fb26813b14e3c..c8718837263b1e4af03d95bda3cd33272006d162 100644 (file)
@@ -53,6 +53,7 @@
 #include "wx/numdlg.h"
 #include "wx/textdlg.h"
 #include "wx/ffile.h"
+#include "wx/stopwatch.h"
 
 #include "wx/process.h"
 
@@ -727,6 +728,15 @@ void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event))
 {
+    if ( !m_cmdLast )
+    {
+#ifdef __WXMSW__
+        m_cmdLast = "type Makefile.in";
+#else
+        m_cmdLast = "cat -n Makefile";
+#endif
+    }
+
     wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
                                      DIALOG_TITLE,
                                      m_cmdLast);
@@ -753,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 )
         {