Skip to content
Permalink
Browse files

[processing] drop resources.qrc and load images dynamically. Also remove

unused images
  • Loading branch information
alexbruy committed May 18, 2015
1 parent fd7568a commit 30dbd8fd5b52588fb2b7e5ca7cbdf645541e6a23
Showing with 177 additions and 1,482 deletions.
  1. +1 −3 python/plugins/processing/CMakeLists.txt
  2. +11 −7 python/plugins/processing/ProcessingPlugin.py
  3. +7 −3 python/plugins/processing/algs/gdal/GdalAlgorithm.py
  4. +4 −1 python/plugins/processing/algs/gdal/GdalOgrAlgorithmProvider.py
  5. +4 −1 python/plugins/processing/algs/grass/GrassAlgorithm.py
  6. +4 −1 python/plugins/processing/algs/grass/GrassAlgorithmProvider.py
  7. +4 −1 python/plugins/processing/algs/grass/nviz.py
  8. +4 −1 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  9. +5 −1 python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py
  10. +4 −1 python/plugins/processing/algs/grass7/nviz7.py
  11. +5 −2 python/plugins/processing/algs/otb/OTBAlgorithm.py
  12. +6 −2 python/plugins/processing/algs/otb/OTBAlgorithmProvider.py
  13. +4 −2 python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
  14. +9 −4 python/plugins/processing/algs/r/RAlgorithmProvider.py
  15. +5 −2 python/plugins/processing/algs/saga/SagaAlgorithm212.py
  16. +5 −1 python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
  17. +4 −1 python/plugins/processing/algs/saga/SplitRGBBands.py
  18. +5 −1 python/plugins/processing/gui/BatchPanel.py
  19. +5 −3 python/plugins/processing/gui/ConfigDialog.py
  20. +8 −2 python/plugins/processing/gui/CreateNewScriptAction.py
  21. +13 −8 python/plugins/processing/gui/GetScriptsAndModels.py
  22. +3 −1 python/plugins/processing/gui/InputLayerSelectorPanel.py
  23. +3 −2 python/plugins/processing/gui/ParametersPanel.py
  24. +5 −3 python/plugins/processing/gui/ScriptEditorDialog.py
  25. +1 −1 python/plugins/processing/images/CMakeLists.txt
  26. BIN python/plugins/processing/images/database.png
  27. BIN python/plugins/processing/images/geoserver.png
  28. BIN python/plugins/processing/images/minus.gif
  29. BIN python/plugins/processing/images/plus.gif
  30. BIN python/plugins/processing/images/postgis.png
  31. BIN python/plugins/processing/images/saga.png
  32. BIN python/plugins/processing/images/saga100x100.jpg
  33. +4 −1 python/plugins/processing/modeler/AddModelFromFileAction.py
  34. +5 −2 python/plugins/processing/modeler/CreateNewModelAction.py
  35. +5 −2 python/plugins/processing/modeler/ModelerAlgorithm.py
  36. +3 −1 python/plugins/processing/modeler/ModelerAlgorithmProvider.py
  37. +5 −4 python/plugins/processing/modeler/ModelerDialog.py
  38. +8 −8 python/plugins/processing/modeler/ModelerGraphicItem.py
  39. +3 −1 python/plugins/processing/modeler/ModelerOnlyAlgorithmProvider.py
  40. +0 −25 python/plugins/processing/resources.qrc
  41. +0 −1,380 python/plugins/processing/resources_rc.py
  42. +6 −1 python/plugins/processing/script/AddScriptFromFileAction.py
  43. +4 −1 python/plugins/processing/script/ScriptAlgorithm.py
  44. +5 −1 python/plugins/processing/script/ScriptAlgorithmProvider.py
@@ -15,7 +15,5 @@ PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES})
FILE(GLOB OTHER_FILES metadata.txt)
FILE(GLOB PY_FILES *.py)

PYQT4_ADD_RESOURCES(PYRC_FILES resources.qrc)

PLUGIN_INSTALL(processing . ${PY_FILES} ${OTHER_FILES} ${PYRC_FILES})
PLUGIN_INSTALL(processing . ${PY_FILES} ${OTHER_FILES})
PLUGIN_INSTALL(processing ui ${PYUI_FILES} ui/__init__.py)
@@ -42,7 +42,6 @@
from processing.modeler.ModelerDialog import ModelerDialog
from processing.tools.system import tempFolder

import processing.resources_rc

cmd_folder = os.path.split(inspect.getfile(inspect.currentframe()))[0]
if cmd_folder not in sys.path:
@@ -68,29 +67,34 @@ def initGui(self):

self.toolboxAction = self.toolbox.toggleViewAction()
self.toolboxAction.setObjectName('toolboxAction')
self.toolboxAction.setIcon(QIcon(':/processing/images/alg.png'))
self.toolboxAction.setIcon(
QIcon(os.path.join(cmd_folder, 'images', 'alg.png')))
self.toolboxAction.setText(self.tr('&Toolbox'))
self.menu.addAction(self.toolboxAction)

self.modelerAction = QAction(QIcon(':/processing/images/model.png'),
self.modelerAction = QAction(
QIcon(os.path.join(cmd_folder, 'images', 'model.png')),
self.tr('Graphical &Modeler...'), self.iface.mainWindow())
self.modelerAction.setObjectName('modelerAction')
self.modelerAction.triggered.connect(self.openModeler)
self.menu.addAction(self.modelerAction)

self.historyAction = QAction(QIcon(':/processing/images/history.gif'),
self.historyAction = QAction(
QIcon(os.path.join(cmd_folder, 'images', 'history.gif')),
self.tr('&History and Log...'), self.iface.mainWindow())
self.historyAction.setObjectName('historyAction')
self.historyAction.triggered.connect(self.openHistory)
self.menu.addAction(self.historyAction)

self.configAction = QAction(QIcon(':/processing/images/config.png'),
self.configAction = QAction(
QIcon(os.path.join(cmd_folder, 'images', 'config.png')),
self.tr('&Options...'), self.iface.mainWindow())
self.configAction.setObjectName('configAction')
self.configAction.triggered.connect(self.openConfig)
self.menu.addAction(self.configAction)

self.resultsAction = QAction(QIcon(':/processing/images/results.png'),
self.resultsAction = QAction(
QIcon(os.path.join(cmd_folder, 'images', 'results.png')),
self.tr('&Results Viewer...'), self.iface.mainWindow())
self.resultsAction.setObjectName('resultsAction')
self.resultsAction.triggered.connect(self.openResults)
@@ -101,7 +105,7 @@ def initGui(self):
self.iface.firstRightStandardMenu().menuAction(), self.menu)

self.commanderAction = QAction(
QIcon(':/processing/images/commander.png'),
QIcon(os.path.join(cmd_folder, 'images', 'commander.png')),
self.tr('&Commander'), self.iface.mainWindow())
self.commanderAction.setObjectName('commanderAction')
self.commanderAction.triggered.connect(self.openCommander)
@@ -27,28 +27,32 @@
__revision__ = '$Format:%H$'

import os
from PyQt4 import QtGui
from PyQt4.QtGui import QIcon
from processing.script.ScriptAlgorithm import ScriptAlgorithm
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.algs.gdal.GdalAlgorithmDialog import GdalAlgorithmDialog
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class GdalAlgorithm(GeoAlgorithm):

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + '/../../images/gdal.png')
return QIcon(os.path.join(pluginPath, 'images', 'gdal.png'))

def getCustomParametersDialog(self):
return GdalAlgorithmDialog(self)

def processAlgorithm(self, progress):
GdalUtils.runGdal(self.getConsoleCommands(), progress)


class GdalScriptAlgorithm(ScriptAlgorithm):

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + '/../../images/gdal.png')
return QIcon(os.path.join(pluginPath, 'images', 'gdal.png'))

def getCustomParametersDialog(self):
return GdalAlgorithmDialog(self)
@@ -84,6 +84,9 @@
from ogrinfo import OgrInfo
from ogrsql import OgrSql

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class GdalOgrAlgorithmProvider(AlgorithmProvider):
"""This provider incorporates GDAL-based algorithms into the
@@ -117,7 +120,7 @@ def getName(self):
return 'gdalogr'

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../../images/gdal.png')
return QIcon(os.path.join(pluginPath, 'images', 'gdal.png'))

def _loadAlgorithms(self):
self.algs = self.preloadedAlgs
@@ -48,6 +48,9 @@

from processing.tools import dataobjects, system

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class GrassAlgorithm(GeoAlgorithm):

@@ -76,7 +79,7 @@ def getCopy(self):
return newone

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../../images/grass.png')
return QIcon(os.path.join(pluginPath, 'images', 'grass.png'))

def help(self):
return False, 'http://grass.osgeo.org/grass64/manuals/' + self.grassName + '.html'
@@ -36,6 +36,9 @@
from nviz import nviz
from processing.tools.system import isMac, isWindows

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class GrassAlgorithmProvider(AlgorithmProvider):

@@ -94,7 +97,7 @@ def getName(self):
return 'grass'

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../../images/grass.png')
return QIcon(os.path.join(pluginPath, 'images', 'grass.png'))

def getSupportedOutputVectorLayerExtensions(self):
return ['shp']
@@ -40,6 +40,9 @@
from processing.tools.system import getNumExportedLayers
from processing.tools import dataobjects

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class nviz(GeoAlgorithm):

@@ -50,7 +53,7 @@ class nviz(GeoAlgorithm):
GRASS_REGION_CELLSIZE_PARAMETER = 'GRASS_REGION_CELLSIZE_PARAMETER'

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../images/grass.png')
return QIcon(os.path.join(pluginPath, 'images', 'grass.png'))

def defineCharacteristics(self):
self.name = 'nviz'
@@ -47,6 +47,9 @@

from processing.tools import dataobjects, system

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class Grass7Algorithm(GeoAlgorithm):

@@ -75,7 +78,7 @@ def getCopy(self):
return newone

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../../images/grass.png')
return QIcon(os.path.join(pluginPath, 'images', 'grass.png'))

def help(self):
return False, 'http://grass.osgeo.org/grass70/manuals/' + self.grassName \
@@ -35,6 +35,10 @@
from processing.tools.system import isWindows, isMac
from nviz7 import nviz7

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class Grass7AlgorithmProvider(AlgorithmProvider):

def __init__(self):
@@ -99,7 +103,7 @@ def getName(self):
return 'grass70'

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../../images/grass.png')
return QIcon(os.path.join(pluginPath, 'images', 'grass.png'))

def getSupportedOutputVectorLayerExtensions(self):
return ['shp']
@@ -40,6 +40,9 @@
from processing.tools.system import getNumExportedLayers
from processing.tools import dataobjects

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class nviz7(GeoAlgorithm):

@@ -50,7 +53,7 @@ class nviz7(GeoAlgorithm):
GRASS_REGION_CELLSIZE_PARAMETER = 'GRASS_REGION_CELLSIZE_PARAMETER'

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + '/../images/grass.png')
return QtGui.QIcon(os.path.join(pluginPath, 'images', 'grass.png'))

def defineCharacteristics(self):
self.name = 'nviz7'
@@ -47,7 +47,10 @@
from processing.tools.system import getTempFilename
import xml.etree.ElementTree as ET
import traceback
#import inspect

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class OTBAlgorithm(GeoAlgorithm):

@@ -71,7 +74,7 @@ def getCopy(self):
return newone

def getIcon(self):
return QIcon(os.path.dirname(__file__) + "/../../images/otb.png")
return QIcon(os.path.join(pluginPath, 'images', 'otb.png'))

def help(self):
folder = os.path.join( OTBUtils.otbDescriptionPath(), 'doc' )
@@ -29,13 +29,17 @@
__revision__ = '$Format:%H$'

import os
import PyQt4.QtGui
from PyQt4.QtGui import QIcon
from processing.core.AlgorithmProvider import AlgorithmProvider
from processing.core.ProcessingConfig import ProcessingConfig, Setting
from OTBUtils import OTBUtils
from OTBAlgorithm import OTBAlgorithm
from processing.core.ProcessingLog import ProcessingLog

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class OTBAlgorithmProvider(AlgorithmProvider):

def __init__(self):
@@ -51,7 +55,7 @@ def getName(self):
return "otb"

def getIcon(self):
return PyQt4.QtGui.QIcon(os.path.dirname(__file__) + "/../../images/otb.png")
return QIcon(os.path.join(pluginPath, 'images', 'otb.png'))

def _loadAlgorithms(self):
self.algs = self.preloadedAlgs
@@ -129,12 +129,14 @@
from SplitLinesWithLines import SplitLinesWithLines
from processing.algs.qgis.FieldsMapper import FieldsMapper

import processing.resources_rc
pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class QGISAlgorithmProvider(AlgorithmProvider):

_icon = QIcon(':/processing/images/qgis.png')
_icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.png'))
print '***** ICON', pluginPath

def __init__(self):
AlgorithmProvider.__init__(self)
@@ -28,17 +28,22 @@
import os

from PyQt4.QtGui import QIcon

from processing.core.ProcessingConfig import ProcessingConfig, Setting
from processing.core.ProcessingLog import ProcessingLog
from processing.core.AlgorithmProvider import AlgorithmProvider
from processing.gui.EditScriptAction import EditScriptAction
from processing.gui.DeleteScriptAction import DeleteScriptAction
from processing.gui.CreateNewScriptAction import CreateNewScriptAction
from RUtils import RUtils
from RAlgorithm import RAlgorithm
from processing.script.WrongScriptException import WrongScriptException

from processing.tools.system import isWindows
#import processing.resources_rc

from RUtils import RUtils
from RAlgorithm import RAlgorithm

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class RAlgorithmProvider(AlgorithmProvider):
@@ -77,7 +82,7 @@ def unload(self):
ProcessingConfig.removeSetting(RUtils.R_USE64)

def getIcon(self):
return QIcon(':/processing/images/r.png')
return QIcon(os.path.join(pluginPath, 'images', 'r.png'))

def getDescription(self):
return 'R scripts'
@@ -41,6 +41,9 @@
from processing.tools import dataobjects
from processing.tools.system import getTempFilename, isWindows, getTempFilenameInTempFolder

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))

sessionExportedLayers = {}


@@ -61,7 +64,7 @@ def getCopy(self):
return newone

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../../images/saga.png')
return QIcon(os.path.join(pluginPath, 'images', 'saga.png'))

def defineCharacteristicsFromFile(self):
lines = open(self.descriptionFile)
@@ -357,6 +360,6 @@ def help(self):
name + '.rst'))
if html is None:
return True, None
imgpath = os.path.join(os.path.dirname(__file__),os.pardir, os.pardir, 'images', 'saga100x100.jpg')
imgpath = os.path.join(pluginPath, 'images', 'saga.png')
html = ('<img src="%s"/>' % imgpath) + html
return True, html
@@ -37,6 +37,10 @@
import SagaUtils
from processing.tools.system import isWindows, isMac

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class SagaAlgorithmProvider(AlgorithmProvider):

supportedVersions = {"2.1.2": ("2.1.2", SagaAlgorithm212),
@@ -121,4 +125,4 @@ def getSupportedOutputTableLayerExtensions(self):
return ['dbf']

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../../images/saga.png')
return QIcon(os.path.join(pluginPath, 'images', 'saga.png'))
@@ -33,6 +33,9 @@
from processing.tools.system import getTempFilename, isWindows
import SagaUtils

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class SplitRGBBands(GeoAlgorithm):

@@ -42,7 +45,7 @@ class SplitRGBBands(GeoAlgorithm):
B = 'B'

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + '/../../images/saga.png')
return QtGui.QIcon(os.path.join(pluginPath, 'images', 'saga.png'))

def defineCharacteristics(self):
self.name = 'Split RGB bands'

0 comments on commit 30dbd8f

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