Skip to content
Permalink
Browse files

[processing] better behaviour for fields calculator custom dialog

  • Loading branch information
volaya committed Nov 21, 2014
1 parent 05dc06d commit df9372a85b2221ee3436cc7f037b309ca15b7660
Showing with 8 additions and 12 deletions.
  1. +8 −12 python/plugins/processing/algs/qgis/ui/FieldsCalculatorDialog.py
@@ -47,7 +47,7 @@
class FieldsCalculatorDialog(QDialog, Ui_FieldsCalculator):
def __init__(self, alg):
QDialog.__init__(self)
self.setupUi( self )
self.setupUi(self)

self.executed = False
self.alg = alg
@@ -196,26 +196,21 @@ def accept(self):
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
ProcessingLog.addToLog(ProcessingLog.LOG_ALGORITHM,
self.alg.getAsCommand())
ret = runalg(self.alg, self)
QApplication.restoreOverrideCursor()
if ret:

self.executed = runalg(self.alg, self)
if self.executed:
handleAlgorithmResults(self.alg,
self,
not keepOpen)
self.executed = True
QDialog.reject(self)
if not keepOpen:
QDialog.reject(self)
else:
QMessageBox.critical(self,
self.tr('Unable to execute algorithm'),
self.tr('Wrong or missing parameter '
'values'))
return
except GeoAlgorithmExecutionException, e:
finally:
QApplication.restoreOverrideCursor()
QMessageBox.critical(self, "Error",e.msg)
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)
self.executed = False
QDialog.reject(self)

def reject(self):
self.executed = False
@@ -228,4 +223,5 @@ def setText(self, text):
pass

def error(self, text):
QMessageBox.critical(self, "Error", text)
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, text)

0 comments on commit df9372a

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