Skip to content
Permalink
Browse files

Correct non-sensical code in error behaviour.

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@345 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com
cpolymeris@gmail.com committed Aug 10, 2012
1 parent 73eb3f1 commit 2aa1c70bd5a2ea9c377f7007ce2da851b2d24603
Showing with 19 additions and 23 deletions.
  1. +19 −23 src/sextante/gui/AlgorithmExecutionDialog.py
@@ -239,12 +239,7 @@ def accept(self):
if not keepOpen:
self.close()
else:
self.progressLabel.setText("")
self.progress.setMaximum(100)
self.progress.setValue(0)
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)
self.resetGUI()
self.tabWidget.setCurrentIndex(1) # log tab
except AlgorithmExecutionDialog.InvalidParameterValue as ex:
try:
@@ -262,32 +257,26 @@ def finish(self):
keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)
SextantePostprocessing.handleAlgorithmResults(self.alg, not keepOpen)
self.executed = True
self.setInfo("Algorithm %s finished correctly" % self.alg.name)
self.setInfo("Algorithm %s finished" % self.alg.name)
QApplication.restoreOverrideCursor()
if not keepOpen:
self.close()
else:
self.progressLabel.setText("")
self.progress.setMaximum(100)
self.progress.setValue(0)
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)
self.resetGUI()

@pyqtSlot(str)
def error(self, msg):
self.algEx.finished.disconnect()
QApplication.restoreOverrideCursor()
keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)
self.setInfo(msg, True)
if not SextanteConfig.USE_THREADS and not keepOpen:
self.algEx.finished.disconnect()
if not keepOpen:
QMessageBox.critical(self, "Error", msg)
self.close()
else:
self.progressLabel.setText("Error: " + msg)
self.progress.setValue(0)
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.resetGUI()
self.setInfo(msg, True)
self.tabWidget.setCurrentIndex(1) # log tab

@pyqtSlot(int)
def iterate(self, i):
@@ -299,12 +288,19 @@ def cancel(self):
try:
self.algEx.finished.disconnect()
self.algEx.terminate()
QApplication.restoreOverrideCursor()
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)
except:
pass
self.resetGUI()

def resetGUI(self):
QApplication.restoreOverrideCursor()
self.progressLabel.setText("")
self.progress.setValue(0)
self.progress.setMaximum(100)
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)


@pyqtSlot(str)
@pyqtSlot(str, bool)

0 comments on commit 2aa1c70

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