mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[processing] Initialize icons before first usage
This commit is contained in:
parent
7325f5fbc6
commit
b956886e81
@ -141,10 +141,10 @@ pluginPath = os.path.normpath(os.path.join(
|
||||
|
||||
class QGISAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
_icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.png'))
|
||||
|
||||
def __init__(self):
|
||||
AlgorithmProvider.__init__(self)
|
||||
self._icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.png'))
|
||||
|
||||
self.alglist = [SumLines(), PointsInPolygon(),
|
||||
PointsInPolygonWeighted(), PointsInPolygonUnique(),
|
||||
BasicStatisticsStrings(), BasicStatisticsNumbers(),
|
||||
|
@ -48,9 +48,8 @@ from processing.algs.help import shortHelp
|
||||
|
||||
class GeoAlgorithm:
|
||||
|
||||
_icon = QIcon(os.path.dirname(__file__) + '/../images/alg.png')
|
||||
|
||||
def __init__(self):
|
||||
self._icon = QIcon(os.path.dirname(__file__) + '/../images/alg.png')
|
||||
# Parameters needed by the algorithm
|
||||
self.parameters = list()
|
||||
|
||||
@ -219,7 +218,8 @@ class GeoAlgorithm:
|
||||
|
||||
def _checkParameterValuesBeforeExecuting(self):
|
||||
for param in self.parameters:
|
||||
if isinstance(param, (ParameterRaster, ParameterVector, ParameterMultipleInput)):
|
||||
if isinstance(param, (ParameterRaster, ParameterVector,
|
||||
ParameterMultipleInput)):
|
||||
if param.value:
|
||||
if isinstance(param, ParameterMultipleInput):
|
||||
inputlayers = param.value.split(';')
|
||||
|
@ -85,10 +85,10 @@ class PostgisTableSelector(BASE, WIDGET):
|
||||
|
||||
class ConnectionItem(QtGui.QTreeWidgetItem):
|
||||
|
||||
connIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/postgis.png')
|
||||
schemaIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/namespace.png')
|
||||
|
||||
def __init__(self, connection):
|
||||
self.connIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/postgis.png')
|
||||
self.schemaIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/namespace.png')
|
||||
|
||||
QtGui.QTreeWidgetItem.__init__(self)
|
||||
self.setChildIndicatorPolicy(QtGui.QTreeWidgetItem.ShowIndicator)
|
||||
self.connection = connection
|
||||
|
@ -383,10 +383,10 @@ class FoldButtonGraphicItem(FlatButtonGraphicItem):
|
||||
WIDTH = 11
|
||||
HEIGHT = 11
|
||||
|
||||
icons = {True: QIcon(os.path.join(pluginPath, 'images', 'plus.png')),
|
||||
False: QIcon(os.path.join(pluginPath, 'images', 'minus.png'))}
|
||||
|
||||
def __init__(self, position, action, folded):
|
||||
self.icons = {True: QIcon(os.path.join(pluginPath, 'images', 'plus.png')),
|
||||
False: QIcon(os.path.join(pluginPath, 'images', 'minus.png'))}
|
||||
|
||||
self.folded = folded
|
||||
icon = self.icons[self.folded]
|
||||
super(FoldButtonGraphicItem, self).__init__(icon, position, action)
|
||||
|
@ -58,8 +58,6 @@ pluginPath = os.path.split(os.path.dirname(__file__))[0]
|
||||
|
||||
class ScriptAlgorithm(GeoAlgorithm):
|
||||
|
||||
_icon = QtGui.QIcon(os.path.join(pluginPath, 'images', 'script.png'))
|
||||
|
||||
def __init__(self, descriptionFile, script=None):
|
||||
"""The script parameter can be used to directly pass the code
|
||||
of the script without a file.
|
||||
@ -69,6 +67,8 @@ class ScriptAlgorithm(GeoAlgorithm):
|
||||
"""
|
||||
|
||||
GeoAlgorithm.__init__(self)
|
||||
self._icon = QtGui.QIcon(os.path.join(pluginPath, 'images', 'script.png'))
|
||||
|
||||
self.script = script
|
||||
self.allowEdit = True
|
||||
self.noCRSWarning = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user