Skip to content

Commit

Permalink
[processing] added 'run as batch' button in algorithm dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Sep 24, 2015
1 parent 4d4ce94 commit 1340f4d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
11 changes: 11 additions & 0 deletions python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ def __init__(self, alg):

self.mainWidget = GdalParametersPanel(self, alg)
self.setMainWidget()

cornerWidget = QWidget()
layout = QVBoxLayout();
layout.setContentsMargins(0,0,0,5);
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }");
runAsBatchButton = QPushButton("Run as batch process...")
runAsBatchButton.clicked.connect(self.runAsBatch)
layout.addWidget(runAsBatchButton)
cornerWidget.setLayout(layout)
self.tabWidget.setCornerWidget(cornerWidget)

self.mainWidget.parametersHaveChanged()


Expand Down
19 changes: 18 additions & 1 deletion python/plugins/processing/gui/AlgorithmDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
__revision__ = '$Format:%H$'

from PyQt4.QtCore import Qt
from PyQt4.QtGui import QMessageBox, QApplication, QCursor, QColor, QPalette
from PyQt4.QtGui import QMessageBox, QApplication, QCursor, QColor, QPalette, QPushButton, QWidget,\
QVBoxLayout

from processing.core.ProcessingLog import ProcessingLog
from processing.core.ProcessingConfig import ProcessingConfig

from processing.gui.BatchAlgorithmDialog import BatchAlgorithmDialog
from processing.gui.ParametersPanel import ParametersPanel
from processing.gui.AlgorithmDialogBase import AlgorithmDialogBase
from processing.gui.AlgorithmExecutor import runalg, runalgIterating
Expand Down Expand Up @@ -69,6 +71,21 @@ def __init__(self, alg):
self.mainWidget = ParametersPanel(self, alg)
self.setMainWidget()

cornerWidget = QWidget()
layout = QVBoxLayout();
layout.setContentsMargins(0,0,0,5);
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }");
runAsBatchButton = QPushButton("Run as batch process...")
runAsBatchButton.clicked.connect(self.runAsBatch)
layout.addWidget(runAsBatchButton)
cornerWidget.setLayout(layout)
self.tabWidget.setCornerWidget(cornerWidget)

def runAsBatch(self):
dlg = BatchAlgorithmDialog(self.alg)
dlg.show()
dlg.exec_()

def setParamValues(self):
params = self.alg.parameters
outputs = self.alg.outputs
Expand Down

0 comments on commit 1340f4d

Please sign in to comment.