@@ -154,7 +154,8 @@ def accept(self):
154154 continue
155155 widget = self .table .cellWidget (row , col )
156156 if not self .setParameterValueFromWidget (param , widget , alg ):
157- QMessageBox .critical (self , "Unable to execute batch process" , "Wrong or missing parameter values" )
157+ self .progressLabel .setText ("<b>Missing parameter value: " + param .description + " (row " + str (row + 1 ) + ")</b>" )
158+ #QMessageBox.critical(self, "Unable to execute batch process", "Wrong or missing parameter values")
158159 self .algs = None
159160 return
160161 col += 1
@@ -167,7 +168,8 @@ def accept(self):
167168 out .value = text
168169 col += 1
169170 else :
170- QMessageBox .critical (self , "Unable to execute batch process" , "Wrong or missing parameter values" )
171+ self .progressLabel .setText ("<b>Wrong or missing parameter value: " + out .description + " (row " + str (row + 1 ) + ")</b>" )
172+ #QMessageBox.critical(self, "Unable to execute batch process", "Wrong or missing parameter values")
171173 self .algs = None
172174 return
173175 self .algs .append (alg )
@@ -205,30 +207,36 @@ def loadHTMLResults(self, alg, i):
205207 def cancel (self ):
206208 self .algs = None
207209 if self .algEx :
208- self .algEx .terminate ()
209- self .close ()
210+ self .algEx .terminate ()
211+ self .table .setEnabled (True )
212+ #self.close()
210213
211214 @pyqtSlot ()
212215 def finish (self , i ):
213- if self .load [i ]:
214- SextantePostprocessing .handleAlgorithmResults (self .algs [i ], self , False )
215- i += 1
216- #self.progress.setValue(i)
217- if len (self .algs ) == i :
218- self .finishAll ()
219- self .algEx = None
220- else :
221- self .nextAlg (i )
216+ if not self .stop :
217+ if self .load [i ]:
218+ SextantePostprocessing .handleAlgorithmResults (self .algs [i ], self , False )
219+ i += 1
220+ #self.progress.setValue(i)
221+ if len (self .algs ) == i :
222+ self .finishAll ()
223+ self .algEx = None
224+ else :
225+ self .nextAlg (i )
222226
223- @pyqtSlot ()
227+ @pyqtSlot (str )
224228 def error (self , msg ):
225229 QApplication .restoreOverrideCursor ()
226230 QMessageBox .critical (self , "Error" , msg )
227231 SextanteLog .addToLog (SextanteLog .LOG_ERROR , msg )
228- self .close ()
232+ if self .algEx :
233+ self .algEx .terminate ()
234+ self .table .setEnabled (True )
235+ #self.close()
229236
230237
231238 def nextAlg (self , i ):
239+ self .stop = False
232240 self .setBaseText ("Processing algorithm " + str (i ) + "/" + str (len (self .algs )) + "..." )
233241 self .algEx = AlgorithmExecutor (self .algs [i ]);
234242 self .algEx .percentageChanged .connect (self .setPercentage )
@@ -265,7 +273,7 @@ def finishAll(self):
265273 QApplication .restoreOverrideCursor ()
266274 self .table .setEnabled (True )
267275 QMessageBox .information (self , "Batch processing" , "Batch processing successfully completed!" )
268- self .close ()
276+ # self.close()
269277
270278 def setParameterValueFromWidget (self , param , widget , alg = None ):
271279 if isinstance (param , (ParameterRaster , ParameterVector , ParameterTable , ParameterMultipleInput )):
0 commit comments