Skip to content

Commit

Permalink
[processing][needs-docs] allow to switch from batch dialog to single UI
Browse files Browse the repository at this point in the history
(fix #16893)
  • Loading branch information
alexbruy authored and nyalldawson committed May 23, 2019
1 parent ddea00e commit e8a74f4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion python/plugins/processing/gui/BatchAlgorithmDialog.py
Expand Up @@ -24,7 +24,7 @@
from pprint import pformat
import time

from qgis.PyQt.QtWidgets import QMessageBox
from qgis.PyQt.QtWidgets import QMessageBox, QPushButton, QDialogButtonBox
from qgis.PyQt.QtCore import Qt, QCoreApplication

from qgis.core import (QgsProcessingParameterDefinition,
Expand Down Expand Up @@ -66,6 +66,18 @@ def __init__(self, alg, parent=None):
self.setMainWidget(BatchPanel(self, self.algorithm()))
self.hideShortHelp()

self.btnRunSingle = QPushButton(self.tr("Run as Single Process…"))
self.btnRunSingle.clicked.connect(self.runAsSingle)
self.buttonBox().addButton(self.btnRunSingle, QDialogButtonBox.ResetRole) # reset role to ensure left alignment

def runAsSingle(self):
self.close()

from processing.gui.AlgorithmDialog import AlgorithmDialog
dlg = AlgorithmDialog(self.algorithm().create(), parent=iface.mainWindow())
dlg.show()
dlg.exec_()

def runAlgorithm(self):
alg_parameters = []

Expand Down

0 comments on commit e8a74f4

Please sign in to comment.