Skip to content

Commit

Permalink
[processing] fixed batch processing interface
Browse files Browse the repository at this point in the history
Conflicts:
	python/plugins/processing/gui/BatchAlgorithmDialog.py
  • Loading branch information
volaya committed Oct 5, 2016
1 parent ccdf372 commit 56225c4
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions python/plugins/processing/gui/BatchAlgorithmDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
__revision__ = '$Format:%H$'

from qgis.PyQt.QtWidgets import QApplication, QMessageBox
from qgis.PyQt.QtGui import QCursor
from qgis.PyQt.QtGui import QCursor, QSizePolicy
from qgis.PyQt.QtCore import Qt

from qgis.gui import QgsMessageBar

from processing.gui.BatchPanel import BatchPanel
from processing.gui.AlgorithmDialogBase import AlgorithmDialogBase
from processing.gui.AlgorithmExecutor import runalg
Expand Down Expand Up @@ -60,6 +62,10 @@ def __init__(self, alg):

self.textShortHelp.setVisible(False)

self.bar = QgsMessageBar()
self.bar.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
self.layout().insertWidget(0, self.bar)

def accept(self):
self.algs = []
self.load = []
Expand All @@ -71,10 +77,11 @@ def accept(self):
for param in alg.parameters:
if param.hidden:
continue
widget = self.mainWidget.tblParameters.cellWidget(row, col)
if not self.mainWidget.setParamValue(param, widget, alg):
self.lblProgress.setText(
self.tr('<b>Missing parameter value: %s (row %d)</b>') % (param.description, row + 1))
wrapper = self.mainWidget.wrappers[row][col]
if not self.mainWidget.setParamValue(param, wrapper, alg):
self.bar.pushMessage("", self.tr('Wrong or missing parameter value: %s (row %d)')
% (param.description, row + 1),
level=QgsMessageBar.WARNING, duration=5)
self.algs = None
return
col += 1
Expand All @@ -88,8 +95,9 @@ def accept(self):
out.value = text
col += 1
else:
self.lblProgress.setText(
self.tr('<b>Wrong or missing parameter value: %s (row %d)</b>') % (out.description, row + 1))
self.bar.pushMessage("", self.tr('Wrong or missing output value: %s (row %d)')
% (out.description, row + 1),
level=QgsMessageBar.WARNING, duration=5)
self.algs = None
return

Expand Down

0 comments on commit 56225c4

Please sign in to comment.