Skip to content

Commit

Permalink
SAGA commandline to algorithm execution dialog log
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@331 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com committed Aug 2, 2012
1 parent ae44e7b commit f2c9b03
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sextante/gui/AlgorithmExecutionDialog.py
Expand Up @@ -199,6 +199,7 @@ def accept(self):
self.algEx.percentageChanged.connect(self.setPercentage)
self.algEx.textChanged.connect(self.setText)
self.algEx.iterated.connect(self.iterate)
self.algEx.infoSet.connect(self.log)
self.algEx.start()
self.log("Algorithm %s started" % self.alg.name)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(True)
Expand Down Expand Up @@ -274,9 +275,8 @@ def cancel(self):
except:
pass

@pyqtSlot(str, bool)
@pyqtSlot(str)
def log(self, msg, error = False):
print "!", msg
if error:
SextanteLog.addToLog(SextanteLog.LOG_ERROR, msg)
self.logText.append('<b>' + msg + '</b>')
Expand Down
3 changes: 3 additions & 0 deletions src/sextante/gui/AlgorithmExecutor.py
Expand Up @@ -10,6 +10,7 @@ class AlgorithmExecutor(QThread):
textChanged = pyqtSignal(QString)
error = pyqtSignal(str)
iterated = pyqtSignal(int)
infoSet = pyqtSignal(str)
#started & finished inherited from QThread

def __init__(self, alg, iterParam = None, parent = None):
Expand All @@ -24,6 +25,8 @@ def setText(self, text):
self.algorithmExecutor.textChanged.emit(text)
def setPercentage(self, p):
self.algorithmExecutor.percentageChanged.emit(p)
def setInfo(self, info):
self.algorithmExecutor.infoSet.emit(info)
self.progress = Progress(self)
if self.parameterToIterate:
self.run = self.runalgIterating
Expand Down
1 change: 1 addition & 0 deletions src/sextante/saga/SagaAlgorithm.py
Expand Up @@ -278,6 +278,7 @@ def processAlgorithm(self, progress):
loglines = []
loglines.append("SAGA execution commands")
for line in commands:
progress.setInfo(line)
loglines.append(line)
if SextanteConfig.getSetting(SagaUtils.SAGA_LOG_COMMANDS):
SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines)
Expand Down

0 comments on commit f2c9b03

Please sign in to comment.