Skip to content

Commit 1340f4d

Browse files
committed
[processing] added 'run as batch' button in algorithm dialog
1 parent 4d4ce94 commit 1340f4d

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

‎python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ def __init__(self, alg):
1414

1515
self.mainWidget = GdalParametersPanel(self, alg)
1616
self.setMainWidget()
17+
18+
cornerWidget = QWidget()
19+
layout = QVBoxLayout();
20+
layout.setContentsMargins(0,0,0,5);
21+
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }");
22+
runAsBatchButton = QPushButton("Run as batch process...")
23+
runAsBatchButton.clicked.connect(self.runAsBatch)
24+
layout.addWidget(runAsBatchButton)
25+
cornerWidget.setLayout(layout)
26+
self.tabWidget.setCornerWidget(cornerWidget)
27+
1728
self.mainWidget.parametersHaveChanged()
1829

1930

‎python/plugins/processing/gui/AlgorithmDialog.py‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
__revision__ = '$Format:%H$'
2727

2828
from PyQt4.QtCore import Qt
29-
from PyQt4.QtGui import QMessageBox, QApplication, QCursor, QColor, QPalette
29+
from PyQt4.QtGui import QMessageBox, QApplication, QCursor, QColor, QPalette, QPushButton, QWidget,\
30+
QVBoxLayout
3031

3132
from processing.core.ProcessingLog import ProcessingLog
3233
from processing.core.ProcessingConfig import ProcessingConfig
3334

35+
from processing.gui.BatchAlgorithmDialog import BatchAlgorithmDialog
3436
from processing.gui.ParametersPanel import ParametersPanel
3537
from processing.gui.AlgorithmDialogBase import AlgorithmDialogBase
3638
from processing.gui.AlgorithmExecutor import runalg, runalgIterating
@@ -69,6 +71,21 @@ def __init__(self, alg):
6971
self.mainWidget = ParametersPanel(self, alg)
7072
self.setMainWidget()
7173

74+
cornerWidget = QWidget()
75+
layout = QVBoxLayout();
76+
layout.setContentsMargins(0,0,0,5);
77+
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }");
78+
runAsBatchButton = QPushButton("Run as batch process...")
79+
runAsBatchButton.clicked.connect(self.runAsBatch)
80+
layout.addWidget(runAsBatchButton)
81+
cornerWidget.setLayout(layout)
82+
self.tabWidget.setCornerWidget(cornerWidget)
83+
84+
def runAsBatch(self):
85+
dlg = BatchAlgorithmDialog(self.alg)
86+
dlg.show()
87+
dlg.exec_()
88+
7289
def setParamValues(self):
7390
params = self.alg.parameters
7491
outputs = self.alg.outputs

0 commit comments

Comments
 (0)