- if ( wxSystem(command) == 0 ) {
- // ok, passed
- wxLogTrace(TRACE_MIME,
- wxT("Test '%s' for mime type '%s' succeeded."),
- command.c_str(), params.GetMimeType().c_str());
- break;
- }
- else {
- wxLogTrace(TRACE_MIME,
- wxT("Test '%s' for mime type '%s' failed."),
- command.c_str(), params.GetMimeType().c_str());
- }
+ // no test at all, ok
+ break;
+ }
+
+ if ( wxSystem(command) == 0 ) {
+ // ok, test passed
+ wxLogTrace(TRACE_MIME,
+ wxT("Test '%s' for mime type '%s' succeeded."),
+ command.c_str(), params.GetMimeType().c_str());
+ break;
+ }
+ else {
+ wxLogTrace(TRACE_MIME,
+ wxT("Test '%s' for mime type '%s' failed."),
+ command.c_str(), params.GetMimeType().c_str());
+ // support for flags:
+ // 1. create an xterm for 'needsterminal'
+ // 2. append "| $PAGER" for 'copiousoutput'
+ if ( copiousoutput ) {
+ const wxChar *p = wxGetenv(_T("PAGER"));
+ strOpenCmd << _T(" | ") << (p ? p : _T("more"));
+ }
+
+ if ( needsterminal ) {
+ strOpenCmd.Printf(_T("xterm -e sh -c '%s'"),
+ strOpenCmd.c_str());
+ }
+