Skip to content

Commit

Permalink
Apply patch provided by smizumo (#989). Also fixes ticket #1203.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@8989 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gjm committed Aug 5, 2008
1 parent f07b63b commit 1b378f6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/core/qgsrunprocess.cpp
Expand Up @@ -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)
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 1b378f6

Please sign in to comment.