[processing] Move some SVG icons out of plugin to themes
...and swap to using QgsApplication methods for retrieving cached icons, implement svgIconPath for providers with SVG icons
@ -550,6 +550,14 @@
|
||||
<file>themes/default/mTaskRunning.svg</file>
|
||||
<file>themes/default/mTaskTerminated.svg</file>
|
||||
<file>themes/default/mTaskCancel.svg</file>
|
||||
<file>themes/default/providerGdal.svg</file>
|
||||
<file>themes/default/providerGrass.svg</file>
|
||||
<file>themes/default/providerQgis.svg</file>
|
||||
<file>themes/default/providerR.svg</file>
|
||||
<file>themes/default/providerTaudem.svg</file>
|
||||
<file>themes/default/processingModel.svg</file>
|
||||
<file>themes/default/processingScript.svg</file>
|
||||
<file>themes/default/processingAlgorithm.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/images/tips">
|
||||
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
|
||||
|
Before Width: | Height: | Size: 861 B After Width: | Height: | Size: 861 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@ -13,11 +13,11 @@
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
id="svg3399"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
inkscape:version="0.92pre3 r"
|
||||
width="25.4mm"
|
||||
height="25.4mm"
|
||||
viewBox="0 0 89.999998 89.999999"
|
||||
sodipodi:docname="taudem.svg">
|
||||
sodipodi:docname="providerTaudem.svg">
|
||||
<metadata
|
||||
id="metadata3405">
|
||||
<rdf:RDF>
|
||||
@ -32,30 +32,6 @@
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3403">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5605">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5607" />
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5610" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5613">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5615" />
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5617" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5607"
|
||||
osb:paint="solid">
|
||||
@ -94,35 +70,6 @@
|
||||
y2="699.9278"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,-654.09448)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5589"
|
||||
id="linearGradient5593"
|
||||
x1="54.945377"
|
||||
y1="51.502598"
|
||||
x2="85.780338"
|
||||
y2="51.502598"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5613"
|
||||
id="linearGradient5619"
|
||||
x1="54.445377"
|
||||
y1="51.502598"
|
||||
x2="86.280338"
|
||||
y2="51.502598"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5605"
|
||||
id="radialGradient5612"
|
||||
cx="71.826358"
|
||||
cy="50.677773"
|
||||
fx="71.826358"
|
||||
fy="50.677773"
|
||||
r="15.378681"
|
||||
gradientTransform="matrix(1,0,0,0.317652,0,34.579877)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
@ -133,8 +80,8 @@
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="714"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1016"
|
||||
id="namedview3401"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
@ -143,12 +90,12 @@
|
||||
fit-margin-bottom="0"
|
||||
units="mm"
|
||||
inkscape:zoom="2.1213203"
|
||||
inkscape:cx="-78.093983"
|
||||
inkscape:cy="46.505347"
|
||||
inkscape:cx="37.400126"
|
||||
inkscape:cy="64.418719"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="25"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
inkscape:current-layer="layer3" />
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
@ -178,19 +125,5 @@
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer3"
|
||||
inkscape:label="dem">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.07694149px;line-height:125%;font-family:Sans;-inkscape-font-specification:'Sans Bold Italic';letter-spacing:0px;word-spacing:0px;opacity:0.766;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.966;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;"
|
||||
x="56.677109"
|
||||
y="55.079842"
|
||||
id="text4139"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(0.97457262,1.0260908)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4141"
|
||||
x="56.677109"
|
||||
y="55.079842"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.966;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-linejoin:round;stroke-linecap:round;">DEM</tspan></text>
|
||||
</g>
|
||||
inkscape:label="dem" />
|
||||
</svg>
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 4.3 KiB |
@ -72,13 +72,13 @@ class ProcessingPlugin(object):
|
||||
self.toolboxAction = self.toolbox.toggleViewAction()
|
||||
self.toolboxAction.setObjectName('toolboxAction')
|
||||
self.toolboxAction.setIcon(
|
||||
QIcon(os.path.join(cmd_folder, 'images', 'alg.svg')))
|
||||
QgsApplication.getThemeIcon("/processingAlgorithm.svg"))
|
||||
self.toolboxAction.setText(self.tr('&Toolbox'))
|
||||
self.iface.registerMainWindowAction(self.toolboxAction, 'Ctrl+Alt+T')
|
||||
self.menu.addAction(self.toolboxAction)
|
||||
|
||||
self.modelerAction = QAction(
|
||||
QIcon(os.path.join(cmd_folder, 'images', 'model.svg')),
|
||||
QgsApplication.getThemeIcon("/processingModel.svg"),
|
||||
self.tr('Graphical &Modeler...'), self.iface.mainWindow())
|
||||
self.modelerAction.setObjectName('modelerAction')
|
||||
self.modelerAction.triggered.connect(self.openModeler)
|
||||
|
@ -31,6 +31,8 @@ import re
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.PyQt.QtCore import QUrl
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.algs.gdal.GdalAlgorithmDialog import GdalAlgorithmDialog
|
||||
from processing.algs.gdal.GdalUtils import GdalUtils
|
||||
@ -48,7 +50,7 @@ class GdalAlgorithm(GeoAlgorithm):
|
||||
|
||||
def getIcon(self):
|
||||
if self._icon is None:
|
||||
self._icon = QIcon(os.path.join(pluginPath, 'images', 'gdal.svg'))
|
||||
self._icon = QgsApplication.getThemeIcon("/providerGdal.svg")
|
||||
return self._icon
|
||||
|
||||
def getCustomParametersDialog(self):
|
||||
|
@ -28,6 +28,7 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from .GdalUtils import GdalUtils
|
||||
@ -120,7 +121,10 @@ class GdalAlgorithmProvider(AlgorithmProvider):
|
||||
return 'gdal'
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdal.svg'))
|
||||
return QgsApplication.getThemeIcon("/providerGdal.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerGdal.svg")
|
||||
|
||||
def _loadAlgorithms(self):
|
||||
self.algs = self.preloadedAlgs
|
||||
|
@ -35,7 +35,8 @@ import importlib
|
||||
from qgis.PyQt.QtCore import QCoreApplication, QUrl
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsRasterLayer
|
||||
from qgis.core import (QgsRasterLayer,
|
||||
QgsApplication)
|
||||
from qgis.utils import iface
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
@ -102,7 +103,7 @@ class Grass7Algorithm(GeoAlgorithm):
|
||||
|
||||
def getIcon(self):
|
||||
if self._icon is None:
|
||||
self._icon = QIcon(os.path.join(pluginPath, 'images', 'grass.svg'))
|
||||
self._icon = QgsApplication.getThemeIcon("/providerGrass.svg")
|
||||
return self._icon
|
||||
|
||||
def help(self):
|
||||
|
@ -28,6 +28,7 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import QgsApplication
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
@ -105,7 +106,10 @@ class Grass7AlgorithmProvider(AlgorithmProvider):
|
||||
return 'grass7'
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'grass.svg'))
|
||||
return QgsApplication.getThemeIcon("/providerGrass.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerGrass.svg")
|
||||
|
||||
def getSupportedOutputVectorLayerExtensions(self):
|
||||
return ['shp']
|
||||
|
@ -43,7 +43,9 @@ except:
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import Qgis, QgsWkbTypes
|
||||
from qgis.core import (Qgis,
|
||||
QgsWkbTypes,
|
||||
QgsApplication)
|
||||
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
from processing.script.ScriptUtils import ScriptUtils
|
||||
@ -197,7 +199,7 @@ class QGISAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.svg'))
|
||||
self._icon = QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
self.alglist = [SumLines(), PointsInPolygon(),
|
||||
PointsInPolygonWeighted(), PointsInPolygonUnique(),
|
||||
@ -304,7 +306,10 @@ class QGISAlgorithmProvider(AlgorithmProvider):
|
||||
return 'QGIS'
|
||||
|
||||
def icon(self):
|
||||
return self._icon
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def _loadAlgorithms(self):
|
||||
self.algs = list(self.alglist) + self.externalAlgs
|
||||
|
@ -33,6 +33,8 @@ import json
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
@ -88,7 +90,7 @@ class RAlgorithm(GeoAlgorithm):
|
||||
|
||||
def getIcon(self):
|
||||
if self._icon is None:
|
||||
self._icon = QIcon(os.path.join(pluginPath, 'images', 'r.svg'))
|
||||
self._icon = QgsApplication.getThemeIcon("/providerR.svg")
|
||||
return self._icon
|
||||
|
||||
def defineCharacteristicsFromScript(self):
|
||||
|
@ -29,7 +29,7 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
@ -87,7 +87,10 @@ class RAlgorithmProvider(AlgorithmProvider):
|
||||
ProcessingConfig.removeSetting(RUtils.R_USE64)
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'r.svg'))
|
||||
return QgsApplication.getThemeIcon("/providerR.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerR.svg")
|
||||
|
||||
def name(self):
|
||||
return 'R scripts'
|
||||
|
@ -31,7 +31,7 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
import codecs
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
@ -68,7 +68,7 @@ class TauDEMAlgorithm(GeoAlgorithm):
|
||||
|
||||
def getIcon(self):
|
||||
if self._icon is None:
|
||||
self._icon = QIcon(os.path.join(pluginPath, 'images', 'taudem.svg'))
|
||||
self._icon = QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
return self._icon
|
||||
|
||||
def defineCharacteristicsFromFile(self):
|
||||
|
@ -30,6 +30,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
@ -64,7 +66,10 @@ class TauDEMAlgorithmProvider(AlgorithmProvider):
|
||||
return 'taudem'
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'taudem.svg'))
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerTaudem.svg")
|
||||
|
||||
def initializeSettings(self):
|
||||
AlgorithmProvider.initializeSettings(self)
|
||||
|
@ -32,6 +32,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
@ -68,7 +70,7 @@ class DinfDistDown(GeoAlgorithm):
|
||||
}
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('D-Infinity Distance Down')
|
||||
|
@ -32,6 +32,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
@ -69,7 +71,7 @@ class DinfDistUp(GeoAlgorithm):
|
||||
}
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('D-Infinity Distance Up')
|
||||
|
@ -32,6 +32,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
from processing.core.GeoAlgorithmExecutionException import \
|
||||
@ -61,7 +63,7 @@ class DinfTransLimAccum(GeoAlgorithm):
|
||||
OUT_CONCENTR_GRID = 'OUT_CONCENTR_GRID'
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('D-Infinity Transport Limited Accumulation')
|
||||
|
@ -32,6 +32,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
from processing.core.GeoAlgorithmExecutionException import \
|
||||
@ -61,7 +63,7 @@ class DinfTransLimAccum2(GeoAlgorithm):
|
||||
OUT_CONCENTR_GRID = 'OUT_CONCENTR_GRID'
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('D-Infinity Transport Limited Accumulation - 2')
|
||||
|
@ -32,6 +32,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
from processing.core.GeoAlgorithmExecutionException import \
|
||||
@ -63,7 +65,7 @@ class DropAnalysis(GeoAlgorithm):
|
||||
DROP_ANALYSIS_FILE = 'DROP_ANALYSIS_FILE'
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Stream Drop Analysis')
|
||||
|
@ -32,6 +32,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
from processing.core.GeoAlgorithmExecutionException import \
|
||||
@ -59,7 +61,7 @@ class GridNet(GeoAlgorithm):
|
||||
STRAHLER_GRID = 'STRAHLER_GRID'
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Grid Network')
|
||||
|
@ -32,6 +32,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
from processing.core.GeoAlgorithmExecutionException import \
|
||||
@ -54,7 +56,7 @@ class LengthArea(GeoAlgorithm):
|
||||
STREAM_SOURCE_GRID = 'STREAM_SOURCE_GRID'
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Length Area Stream Source')
|
||||
|
@ -29,7 +29,9 @@ __copyright__ = '(C) 2012, Alexander Bruy'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
from processing.core.GeoAlgorithmExecutionException import \
|
||||
@ -51,7 +53,7 @@ class PeukerDouglas(GeoAlgorithm):
|
||||
STREAM_SOURCE_GRID = 'STREAM_SOURCE_GRID'
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Peuker Douglas')
|
||||
|
@ -30,7 +30,7 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
@ -54,7 +54,7 @@ class SlopeArea(GeoAlgorithm):
|
||||
SLOPE_AREA_GRID = 'SLOPE_AREA_GRID'
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../../images/taudem.svg')
|
||||
return QgsApplication.getThemeIcon("/providerTaudem.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Slope Area Combination')
|
||||
|
@ -30,10 +30,9 @@ import traceback
|
||||
import subprocess
|
||||
import copy
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.PyQt.QtCore import QCoreApplication, QSettings
|
||||
|
||||
from qgis.core import QgsVectorLayer, QgsRasterLayer
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from builtins import str
|
||||
from builtins import object
|
||||
@ -52,7 +51,7 @@ from processing.algs.help import shortHelp
|
||||
class GeoAlgorithm(object):
|
||||
|
||||
def __init__(self):
|
||||
self._icon = QIcon(os.path.dirname(__file__) + '/../images/alg.svg')
|
||||
self._icon = QgsApplication.getThemeIcon("/processingAlgorithm.svg")
|
||||
# Parameters needed by the algorithm
|
||||
self.parameters = list()
|
||||
|
||||
|
@ -31,7 +31,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtCore import QCoreApplication, QSettings, QObject, pyqtSignal
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import NULL
|
||||
from qgis.core import (NULL,
|
||||
QgsApplication)
|
||||
from processing.tools.system import defaultOutputFolder
|
||||
import processing.tools.dataobjects
|
||||
|
||||
@ -72,7 +73,7 @@ class ProcessingConfig(object):
|
||||
|
||||
@staticmethod
|
||||
def initialize():
|
||||
icon = QIcon(os.path.dirname(__file__) + '/../images/alg.svg')
|
||||
icon = QgsApplication.getThemeIcon("/processingAlgorithm.svg")
|
||||
ProcessingConfig.settingIcons['General'] = icon
|
||||
ProcessingConfig.addSetting(Setting(
|
||||
ProcessingConfig.tr('General'),
|
||||
@ -182,11 +183,11 @@ class ProcessingConfig(object):
|
||||
@staticmethod
|
||||
def getGroupIcon(group):
|
||||
if group == ProcessingConfig.tr('General'):
|
||||
return QIcon(os.path.dirname(__file__) + '/../images/alg.svg')
|
||||
return QgsApplication.getThemeIcon("/processingAlgorithm.svg")
|
||||
if group in ProcessingConfig.settingIcons:
|
||||
return ProcessingConfig.settingIcons[group]
|
||||
else:
|
||||
return QIcon(os.path.dirname(__file__) + '/../images/alg.svg')
|
||||
return QgsApplication.getThemeIcon("/processingAlgorithm.svg")
|
||||
|
||||
@staticmethod
|
||||
def addSetting(setting):
|
||||
|
@ -73,7 +73,7 @@ class BatchPanel(BASE, WIDGET):
|
||||
self.btnRemove.setIcon(QgsApplication.getThemeIcon('/symbologyRemove.svg'))
|
||||
self.btnOpen.setIcon(QgsApplication.getThemeIcon('/mActionFileOpen.svg'))
|
||||
self.btnSave.setIcon(QgsApplication.getThemeIcon('/mActionFileSave.svg'))
|
||||
self.btnAdvanced.setIcon(QIcon(os.path.join(pluginPath, 'images', 'alg.svg')))
|
||||
self.btnAdvanced.setIcon(QgsApplication.getThemeIcon("/processingAlgorithm.svg"))
|
||||
|
||||
self.alg = alg
|
||||
self.parent = parent
|
||||
|
@ -51,7 +51,8 @@ from qgis.PyQt.QtGui import (QIcon,
|
||||
from qgis.gui import (QgsDoubleSpinBox,
|
||||
QgsSpinBox
|
||||
)
|
||||
from qgis.core import NULL
|
||||
from qgis.core import (NULL,
|
||||
QgsApplication)
|
||||
|
||||
from processing.core.ProcessingConfig import (ProcessingConfig,
|
||||
settingsWatcher,
|
||||
@ -159,7 +160,7 @@ class ConfigDialog(BASE, WIDGET):
|
||||
Filter 'Providers' items
|
||||
"""
|
||||
providersItem = QStandardItem(self.tr('Providers'))
|
||||
icon = QIcon(os.path.join(pluginPath, 'images', 'alg.svg'))
|
||||
icon = QgsApplication.getThemeIcon("/processingAlgorithm.svg")
|
||||
providersItem.setIcon(icon)
|
||||
providersItem.setEditable(False)
|
||||
emptyItem = QStandardItem()
|
||||
|
@ -29,6 +29,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.gui.ToolboxAction import ToolboxAction
|
||||
from processing.gui.ScriptEditorDialog import ScriptEditorDialog
|
||||
from processing.core.alglist import algList
|
||||
@ -49,9 +51,9 @@ class CreateNewScriptAction(ToolboxAction):
|
||||
|
||||
def getIcon(self):
|
||||
if self.scriptType == self.SCRIPT_PYTHON:
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
elif self.scriptType == self.SCRIPT_R:
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'r.svg'))
|
||||
return QgsApplication.getThemeIcon("/providerR.svg")
|
||||
|
||||
def execute(self):
|
||||
dlg = None
|
||||
|
@ -39,7 +39,9 @@ from qgis.PyQt.QtWidgets import QApplication, QTreeWidgetItem, QPushButton, QMes
|
||||
from qgis.PyQt.QtNetwork import QNetworkReply, QNetworkRequest
|
||||
|
||||
from qgis.utils import iface, show_message_log
|
||||
from qgis.core import QgsNetworkAccessManager, QgsMessageLog
|
||||
from qgis.core import (QgsNetworkAccessManager,
|
||||
QgsMessageLog,
|
||||
QgsApplication)
|
||||
from qgis.gui import QgsMessageBar
|
||||
|
||||
from processing.core.alglist import algList
|
||||
@ -63,7 +65,7 @@ class GetScriptsAction(ToolboxAction):
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
|
||||
def execute(self):
|
||||
repoUrl = ProcessingConfig.getSetting(ProcessingConfig.MODELS_SCRIPTS_REPO)
|
||||
@ -85,7 +87,7 @@ class GetRScriptsAction(ToolboxAction):
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'r.svg'))
|
||||
return QgsApplication.getThemeIcon("/providerR.svg")
|
||||
|
||||
def execute(self):
|
||||
repoUrl = ProcessingConfig.getSetting(ProcessingConfig.MODELS_SCRIPTS_REPO)
|
||||
@ -108,7 +110,7 @@ class GetModelsAction(ToolboxAction):
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingModel.svg")
|
||||
|
||||
def execute(self):
|
||||
repoUrl = ProcessingConfig.getSetting(ProcessingConfig.MODELS_SCRIPTS_REPO)
|
||||
@ -160,15 +162,15 @@ class GetScriptsAndModelsDialog(BASE, WIDGET):
|
||||
if self.resourceType == self.MODELS:
|
||||
self.folder = ModelerUtils.modelsFolders()[0]
|
||||
self.urlBase = '{}/models/'.format(repoUrl)
|
||||
self.icon = QIcon(os.path.join(pluginPath, 'images', 'model.svg'))
|
||||
self.icon = QgsApplication.getThemeIcon("/processingModel.svg")
|
||||
elif self.resourceType == self.SCRIPTS:
|
||||
self.folder = ScriptUtils.scriptsFolders()[0]
|
||||
self.urlBase = '{}/scripts/'.format(repoUrl)
|
||||
self.icon = QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
|
||||
self.icon = QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
else:
|
||||
self.folder = RUtils.RScriptsFolders()[0]
|
||||
self.urlBase = '{}/rscripts/'.format(repoUrl)
|
||||
self.icon = QIcon(os.path.join(pluginPath, 'images', 'r.svg'))
|
||||
self.icon = QgsApplication.getThemeIcon("/providerR.svg")
|
||||
|
||||
self.lastSelectedItem = None
|
||||
self.updateProvider = False
|
||||
|
@ -27,9 +27,11 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.PyQt.QtCore import QCoreApplication
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
|
||||
class ToolboxAction(object):
|
||||
|
||||
@ -37,7 +39,7 @@ class ToolboxAction(object):
|
||||
self.toolbox = toolbox
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.dirname(__file__) + '/../images/alg.svg')
|
||||
return QgsApplication.getThemeIcon("/processingAlgorithm.svg")
|
||||
|
||||
def tr(self, string, context=''):
|
||||
if context == '':
|
||||
|
@ -30,6 +30,9 @@ import shutil
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.PyQt.QtWidgets import QFileDialog, QMessageBox
|
||||
from qgis.PyQt.QtCore import QSettings, QFileInfo
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.gui.ToolboxAction import ToolboxAction
|
||||
from processing.modeler.ModelerAlgorithm import ModelerAlgorithm
|
||||
from processing.modeler.WrongModelException import WrongModelException
|
||||
@ -46,7 +49,7 @@ class AddModelFromFileAction(ToolboxAction):
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingModel.svg")
|
||||
|
||||
def execute(self):
|
||||
settings = QSettings()
|
||||
|
@ -27,6 +27,9 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.gui.ToolboxAction import ToolboxAction
|
||||
from processing.modeler.ModelerDialog import ModelerDialog
|
||||
from processing.core.alglist import algList
|
||||
@ -41,7 +44,7 @@ class CreateNewModelAction(ToolboxAction):
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingModel.svg")
|
||||
|
||||
def execute(self):
|
||||
dlg = ModelerDialog()
|
||||
|
@ -38,7 +38,7 @@ from qgis.PyQt.QtCore import QCoreApplication, QPointF
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from operator import attrgetter
|
||||
|
||||
from qgis.core import QgsRasterLayer, QgsVectorLayer
|
||||
from qgis.core import QgsApplication
|
||||
from qgis.gui import QgsMessageBar
|
||||
from qgis.utils import iface
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
@ -263,7 +263,7 @@ class ModelerAlgorithm(GeoAlgorithm):
|
||||
GeoAlgorithm.__init__(self)
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingModel.svg")
|
||||
|
||||
def defineCharacteristics(self):
|
||||
classes = [ParameterRaster, ParameterVector, ParameterTable, ParameterTableField,
|
||||
|
@ -29,6 +29,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
@ -67,7 +69,10 @@ class ModelerAlgorithmProvider(AlgorithmProvider):
|
||||
return 'model'
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingModel.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("processingModel.svg")
|
||||
|
||||
def _loadAlgorithms(self):
|
||||
folders = ModelerUtils.modelsFolders()
|
||||
|
@ -28,9 +28,10 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
|
||||
from qgis.PyQt.QtWidgets import QFileDialog, QMessageBox
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.PyQt.QtCore import QSettings, QFileInfo
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.script.ScriptAlgorithm import ScriptAlgorithm
|
||||
from processing.gui.ToolboxAction import ToolboxAction
|
||||
from processing.script.WrongScriptException import WrongScriptException
|
||||
@ -47,7 +48,7 @@ class AddScriptFromFileAction(ToolboxAction):
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
|
||||
def execute(self):
|
||||
settings = QSettings()
|
||||
|
@ -27,7 +27,8 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.gui.ToolboxAction import ToolboxAction
|
||||
from processing.script.ScriptSelector import ScriptSelector
|
||||
from processing.tools.system import mkdir
|
||||
@ -77,7 +78,7 @@ class CreateScriptCollectionPluginAction(ToolboxAction):
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
|
||||
def execute(self):
|
||||
dlg = ScriptSelector()
|
||||
|
@ -29,8 +29,11 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
import re
|
||||
import json
|
||||
from qgis.core import QgsExpressionContextUtils, QgsExpressionContext, QgsProject
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import (QgsExpressionContextUtils,
|
||||
QgsExpressionContext,
|
||||
QgsProject,
|
||||
QgsApplication)
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.gui.Help2Html import getHtmlFromHelpFile
|
||||
from processing.core.parameters import getParameterFromString
|
||||
@ -52,7 +55,7 @@ class ScriptAlgorithm(GeoAlgorithm):
|
||||
"""
|
||||
|
||||
GeoAlgorithm.__init__(self)
|
||||
self._icon = QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
|
||||
self._icon = QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
|
||||
self.script = script
|
||||
self.allowEdit = True
|
||||
|
@ -29,6 +29,8 @@ import os
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsApplication
|
||||
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
from processing.gui.EditScriptAction import EditScriptAction
|
||||
@ -67,7 +69,10 @@ class ScriptAlgorithmProvider(AlgorithmProvider):
|
||||
ProcessingConfig.addSetting(ScriptUtils.SCRIPTS_FOLDER)
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
|
||||
return QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("processingScript.svg")
|
||||
|
||||
def id(self):
|
||||
return 'script'
|
||||
|