Skip to content
Permalink
Browse files

Apply patch provided by smizumo (#989). Also fixes ticket #1203.

git-svn-id: http://svn.osgeo.org/qgis/trunk@8989 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gjm
gjm committed Aug 5, 2008
1 parent f07b63b commit 1b378f639d37846b927b81061b1dece0fd8783a0
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/core/qgsrunprocess.cpp
@@ -24,6 +24,7 @@
#include "qgslogger.h"
#include "qgsmessageoutput.h"
#include <QProcess>
#include <QMessageBox>

QgsRunProcess::QgsRunProcess(const QString& action, bool capture)
: mProcess(NULL), mOutput(NULL)
@@ -45,13 +46,10 @@ QgsRunProcess::QgsRunProcess(const QString& action, bool capture)
// the output from the process, hence this connect() call is
// inside the capture if() statement.
connect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processExit(int,QProcess::ExitStatus)));
}

// start the process!
mProcess->start(action);
// start the process!
mProcess->start(action);

if (capture)
{
// Use QgsMessageOutput for displaying output to user
// It will delete itself when the dialog box is closed.
mOutput = QgsMessageOutput::createMessageOutput();
@@ -69,6 +67,12 @@ QgsRunProcess::QgsRunProcess(const QString& action, bool capture)
}
else
{
if ( ! mProcess->startDetached(action) ) // let the program run by itself
{
QMessageBox::critical(0, tr("Action"),
tr("Unable to run command") + "\n" + action
, QMessageBox::Ok, Qt::NoButton);
}
// We're not capturing the output from the process, so we don't
// need to exist anymore.
die();

0 comments on commit 1b378f6

Please sign in to comment.
You can’t perform that action at this time.