Skip to content
Permalink
Browse files

Move 'Run as batch' button to bottom of algorithm dialog

Inserting it into the tab widget doesn't work well cross
platform/between hidpi/lowdpi displays. So instead add
it as a normal button in the button box.

Also fix capitalization of button text

Fixes #16767
  • Loading branch information
nyalldawson committed Jul 25, 2017
1 parent 06374a6 commit a95cbe9d2f8b39ab4edb24918d95a767d71cf191
@@ -33,7 +33,8 @@
QLineEdit,
QComboBox,
QCheckBox,
QSizePolicy)
QSizePolicy,
QDialogButtonBox)

from qgis.gui import QgsMessageBar

@@ -57,15 +58,9 @@ def __init__(self, alg):

self.setMainWidget(GdalParametersPanel(self, alg))

cornerWidget = QWidget()
layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 5)
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }")
runAsBatchButton = QPushButton(self.tr("Run as batch process..."))
runAsBatchButton.clicked.connect(self.runAsBatch)
layout.addWidget(runAsBatchButton)
cornerWidget.setLayout(layout)
self.tabWidget.setCornerWidget(cornerWidget)
self.runAsBatchButton = QPushButton(self.tr("Run as Batch Process…"))
self.runAsBatchButton.clicked.connect(self.runAsBatch)
self.buttonBox.addButton(self.runAsBatchButton, QDialogButtonBox.ResetRole) # reset role to ensure left alignment

self.mainWidget.parametersHaveChanged()

@@ -30,7 +30,7 @@
import time

from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtWidgets import QMessageBox, QApplication, QPushButton, QWidget, QVBoxLayout, QSizePolicy
from qgis.PyQt.QtWidgets import QMessageBox, QApplication, QPushButton, QWidget, QVBoxLayout, QSizePolicy, QDialogButtonBox
from qgis.PyQt.QtGui import QCursor, QColor, QPalette

from qgis.core import (QgsProject,
@@ -83,14 +83,9 @@ def __init__(self, alg):
self.bar.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
self.layout().insertWidget(0, self.bar)

self.cornerWidget = QWidget()
layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 5)
self.runAsBatchButton = QPushButton(self.tr("Run as batch process..."))
self.runAsBatchButton = QPushButton(self.tr("Run as Batch Process…"))
self.runAsBatchButton.clicked.connect(self.runAsBatch)
layout.addWidget(self.runAsBatchButton)
self.cornerWidget.setLayout(layout)
self.tabWidget.setCornerWidget(self.cornerWidget)
self.buttonBox.addButton(self.runAsBatchButton, QDialogButtonBox.ResetRole) # reset role to ensure left alignment

def getParametersPanel(self, alg, parent):
return ParametersPanel(parent, alg)

0 comments on commit a95cbe9

Please sign in to comment.
You can’t perform that action at this time.