Skip to content

Commit

Permalink
[sextante]Improvements in error messages in barch processing interface
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Mar 23, 2013
1 parent ec07a0c commit d0e5ce7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion python/plugins/sextante/gui/AlgorithmExecutionDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def accept(self):
palette = ex.widget.palette()
palette.setColor(QPalette.Base, QColor(255, 255, 0))
ex.widget.setPalette(palette)
self.progressLabel.setText("<b>Missing parameter value</b>")
self.progressLabel.setText("<b>Missing parameter value: " + ex.parameter.description + "</b>")
return
except:
QMessageBox.critical(self, "Unable to execute algorithm", "Wrong or missing parameter values")
Expand Down
40 changes: 24 additions & 16 deletions python/plugins/sextante/gui/BatchProcessingDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def accept(self):
continue
widget = self.table.cellWidget(row, col)
if not self.setParameterValueFromWidget(param, widget, alg):
QMessageBox.critical(self, "Unable to execute batch process", "Wrong or missing parameter values")
self.progressLabel.setText("<b>Missing parameter value: " + param.description + " (row " + str(row + 1) + ")</b>")
#QMessageBox.critical(self, "Unable to execute batch process", "Wrong or missing parameter values")
self.algs = None
return
col+=1
Expand All @@ -167,7 +168,8 @@ def accept(self):
out.value = text
col+=1
else:
QMessageBox.critical(self, "Unable to execute batch process", "Wrong or missing parameter values")
self.progressLabel.setText("<b>Wrong or missing parameter value: " + out.description + " (row " + str(row + 1) + ")</b>")
#QMessageBox.critical(self, "Unable to execute batch process", "Wrong or missing parameter values")
self.algs = None
return
self.algs.append(alg)
Expand Down Expand Up @@ -205,30 +207,36 @@ def loadHTMLResults(self, alg, i):
def cancel(self):
self.algs = None
if self.algEx:
self.algEx.terminate()
self.close()
self.algEx.terminate()
self.table.setEnabled(True)
#self.close()

@pyqtSlot()
def finish(self, i):
if self.load[i]:
SextantePostprocessing.handleAlgorithmResults(self.algs[i], self, False)
i += 1
#self.progress.setValue(i)
if len(self.algs) == i:
self.finishAll()
self.algEx = None
else:
self.nextAlg(i)
if not self.stop:
if self.load[i]:
SextantePostprocessing.handleAlgorithmResults(self.algs[i], self, False)
i += 1
#self.progress.setValue(i)
if len(self.algs) == i:
self.finishAll()
self.algEx = None
else:
self.nextAlg(i)

@pyqtSlot()
@pyqtSlot(str)
def error(self, msg):
QApplication.restoreOverrideCursor()
QMessageBox.critical(self, "Error", msg)
SextanteLog.addToLog(SextanteLog.LOG_ERROR, msg)
self.close()
if self.algEx:
self.algEx.terminate()
self.table.setEnabled(True)
#self.close()


def nextAlg(self, i):
self.stop = False
self.setBaseText("Processing algorithm " + str(i) + "/" + str(len(self.algs)) + "...")
self.algEx = AlgorithmExecutor(self.algs[i]);
self.algEx.percentageChanged.connect(self.setPercentage)
Expand Down Expand Up @@ -265,7 +273,7 @@ def finishAll(self):
QApplication.restoreOverrideCursor()
self.table.setEnabled(True)
QMessageBox.information(self, "Batch processing", "Batch processing successfully completed!")
self.close()
#self.close()

def setParameterValueFromWidget(self, param, widget, alg = None):
if isinstance(param, (ParameterRaster, ParameterVector, ParameterTable, ParameterMultipleInput)):
Expand Down

0 comments on commit d0e5ce7

Please sign in to comment.