Skip to content

Commit

Permalink
[processing] vectorize and improve menu icons (fixes #14474)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Dec 31, 2016
1 parent d411b67 commit 00ee2ad
Show file tree
Hide file tree
Showing 31 changed files with 35 additions and 29 deletions.
10 changes: 5 additions & 5 deletions python/plugins/processing/ProcessingPlugin.py
Expand Up @@ -72,29 +72,29 @@ def initGui(self):
self.toolboxAction = self.toolbox.toggleViewAction()
self.toolboxAction.setObjectName('toolboxAction')
self.toolboxAction.setIcon(
QIcon(os.path.join(cmd_folder, 'images', 'alg.png')))
QIcon(os.path.join(cmd_folder, 'images', 'alg.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.png')),
QIcon(os.path.join(cmd_folder, 'images', 'model.svg')),
self.tr('Graphical &Modeler...'), self.iface.mainWindow())
self.modelerAction.setObjectName('modelerAction')
self.modelerAction.triggered.connect(self.openModeler)
self.iface.registerMainWindowAction(self.modelerAction, 'Ctrl+Alt+M')
self.menu.addAction(self.modelerAction)

self.historyAction = QAction(
QIcon(os.path.join(cmd_folder, 'images', 'history.gif')),
QIcon(os.path.join(cmd_folder, 'images', 'history.svg')),
self.tr('&History...'), self.iface.mainWindow())
self.historyAction.setObjectName('historyAction')
self.historyAction.triggered.connect(self.openHistory)
self.iface.registerMainWindowAction(self.historyAction, 'Ctrl+Alt+H')
self.menu.addAction(self.historyAction)

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

self.commanderAction = QAction(
QIcon(os.path.join(cmd_folder, 'images', 'commander.png')),
QIcon(os.path.join(cmd_folder, 'images', 'commander.svg')),
self.tr('&Commander'), self.iface.mainWindow())
self.commanderAction.setObjectName('commanderAction')
self.commanderAction.triggered.connect(self.openCommander)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/AlgorithmProvider.py
Expand Up @@ -101,7 +101,7 @@ def getDescription(self):
return self.tr('Generic algorithm provider')

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../images/alg.png')
return QIcon(os.path.dirname(__file__) + '/../images/alg.svg')

def getSupportedOutputRasterLayerExtensions(self):
return ['tif']
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -52,7 +52,7 @@
class GeoAlgorithm(object):

def __init__(self):
self._icon = QIcon(os.path.dirname(__file__) + '/../images/alg.png')
self._icon = QIcon(os.path.dirname(__file__) + '/../images/alg.svg')
# Parameters needed by the algorithm
self.parameters = list()

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/core/ProcessingConfig.py
Expand Up @@ -70,7 +70,7 @@ class ProcessingConfig(object):

@staticmethod
def initialize():
icon = QIcon(os.path.dirname(__file__) + '/../images/alg.png')
icon = QIcon(os.path.dirname(__file__) + '/../images/alg.svg')
ProcessingConfig.settingIcons['General'] = icon
ProcessingConfig.addSetting(Setting(
ProcessingConfig.tr('General'),
Expand Down Expand Up @@ -167,11 +167,11 @@ def setGroupIcon(group, icon):
@staticmethod
def getGroupIcon(group):
if group == ProcessingConfig.tr('General'):
return QIcon(os.path.dirname(__file__) + '/../images/alg.png')
return QIcon(os.path.dirname(__file__) + '/../images/alg.svg')
if group in ProcessingConfig.settingIcons:
return ProcessingConfig.settingIcons[group]
else:
return QIcon(os.path.dirname(__file__) + '/../images/alg.png')
return QIcon(os.path.dirname(__file__) + '/../images/alg.svg')

@staticmethod
def addSetting(setting):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/BatchPanel.py
Expand Up @@ -73,7 +73,7 @@ def __init__(self, parent, alg):
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.png')))
self.btnAdvanced.setIcon(QIcon(os.path.join(pluginPath, 'images', 'alg.svg')))

self.alg = alg
self.parent = parent
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/ConfigDialog.py
Expand Up @@ -160,7 +160,7 @@ def fillTreeUsingProviders(self):
Filter 'Providers' items
"""
providersItem = QStandardItem(self.tr('Providers'))
icon = QIcon(os.path.join(pluginPath, 'images', 'alg.png'))
icon = QIcon(os.path.join(pluginPath, 'images', 'alg.svg'))
providersItem.setIcon(icon)
providersItem.setEditable(False)
emptyItem = QStandardItem()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/CreateNewScriptAction.py
Expand Up @@ -49,7 +49,7 @@ def __init__(self, actionName, scriptType):

def getIcon(self):
if self.scriptType == self.SCRIPT_PYTHON:
return QIcon(os.path.join(pluginPath, 'images', 'script.png'))
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
elif self.scriptType == self.SCRIPT_R:
return QIcon(os.path.join(pluginPath, 'images', 'r.svg'))

Expand Down
8 changes: 4 additions & 4 deletions python/plugins/processing/gui/GetScriptsAndModels.py
Expand Up @@ -62,7 +62,7 @@ def __init__(self):
self.group, self.i18n_group = self.trAction('Tools')

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'script.png'))
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))

def execute(self):
dlg = GetScriptsAndModelsDialog(GetScriptsAndModelsDialog.SCRIPTS)
Expand Down Expand Up @@ -94,7 +94,7 @@ def __init__(self):
self.group, self.i18n_group = self.trAction('Tools')

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'model.png'))
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))

def execute(self):
dlg = GetScriptsAndModelsDialog(GetScriptsAndModelsDialog.MODELS)
Expand Down Expand Up @@ -137,11 +137,11 @@ def __init__(self, resourceType):
if self.resourceType == self.MODELS:
self.folder = ModelerUtils.modelsFolders()[0]
self.urlBase = 'https://raw.githubusercontent.com/qgis/QGIS-Processing/master/models/'
self.icon = QIcon(os.path.join(pluginPath, 'images', 'model.png'))
self.icon = QIcon(os.path.join(pluginPath, 'images', 'model.svg'))
elif self.resourceType == self.SCRIPTS:
self.folder = ScriptUtils.scriptsFolders()[0]
self.urlBase = 'https://raw.githubusercontent.com/qgis/QGIS-Processing/master/scripts/'
self.icon = QIcon(os.path.join(pluginPath, 'images', 'script.png'))
self.icon = QIcon(os.path.join(pluginPath, 'images', 'script.svg'))
else:
self.folder = RUtils.RScriptsFolders()[0]
self.urlBase = 'https://raw.githubusercontent.com/qgis/QGIS-Processing/master/rscripts/'
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/ToolboxAction.py
Expand Up @@ -37,7 +37,7 @@ def setData(self, toolbox):
self.toolbox = toolbox

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../images/alg.png')
return QIcon(os.path.dirname(__file__) + '/../images/alg.svg')

def tr(self, string, context=''):
if context == '':
Expand Down
Binary file removed python/plugins/processing/images/alg.png
Binary file not shown.
1 change: 1 addition & 0 deletions python/plugins/processing/images/alg.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed python/plugins/processing/images/commander.png
Binary file not shown.
1 change: 1 addition & 0 deletions python/plugins/processing/images/commander.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed python/plugins/processing/images/history.gif
Binary file not shown.
1 change: 1 addition & 0 deletions python/plugins/processing/images/history.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed python/plugins/processing/images/model.png
Binary file not shown.
1 change: 1 addition & 0 deletions python/plugins/processing/images/model.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed python/plugins/processing/images/results.png
Binary file not shown.
1 change: 1 addition & 0 deletions python/plugins/processing/images/results.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed python/plugins/processing/images/script.png
Binary file not shown.
1 change: 1 addition & 0 deletions python/plugins/processing/images/script.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions python/plugins/processing/metadata.txt
Expand Up @@ -9,8 +9,8 @@ qgisMinimumVersion=2.13
author=Victor Olaya
email=volayaf@gmail.com

icon=images/alg.png
icon=images/alg.svg

homepage=http://qgis.org
tracker=https://hub.qgis.org/projects/quantum-gis/issues
repository=https://github.com/qgis/QGIS
repository=https://github.com/qgis/QGIS
Expand Up @@ -46,7 +46,7 @@ def __init__(self):
self.group, self.i18n_group = self.trAction('Tools')

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'model.png'))
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))

def execute(self):
settings = QSettings()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/modeler/CreateNewModelAction.py
Expand Up @@ -41,7 +41,7 @@ def __init__(self):
self.group, self.i18n_group = self.trAction('Tools')

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'model.png'))
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))

def execute(self):
dlg = ModelerDialog()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/modeler/ModelerAlgorithm.py
Expand Up @@ -263,7 +263,7 @@ def __init__(self):
GeoAlgorithm.__init__(self)

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'model.png'))
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))

def defineCharacteristics(self):
classes = [ParameterRaster, ParameterVector, ParameterTable, ParameterTableField,
Expand Down
Expand Up @@ -67,7 +67,7 @@ def getName(self):
return 'model'

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'model.png'))
return QIcon(os.path.join(pluginPath, 'images', 'model.svg'))

def _loadAlgorithms(self):
folders = ModelerUtils.modelsFolders()
Expand Down
Expand Up @@ -54,7 +54,7 @@ def _loadAlgorithms(self):
self.algs.append(alg)

def getIcon(self):
return QIcon(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'images', 'alg.png'))
return QIcon(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'images', 'alg.svg'))

def getName(self):
return 'preconfigured'
Expand Down
Expand Up @@ -47,7 +47,7 @@ def __init__(self):
self.group, self.i18n_group = self.trAction('Tools')

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'script.png'))
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))

def execute(self):
settings = QSettings()
Expand Down
Expand Up @@ -77,7 +77,7 @@ def __init__(self):
self.group, self.i18n_group = self.trAction('Tools')

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'script.png'))
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))

def execute(self):
dlg = ScriptSelector()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/script/ScriptAlgorithm.py
Expand Up @@ -52,7 +52,7 @@ def __init__(self, descriptionFile, script=None):
"""

GeoAlgorithm.__init__(self)
self._icon = QIcon(os.path.join(pluginPath, 'images', 'script.png'))
self._icon = QIcon(os.path.join(pluginPath, 'images', 'script.svg'))

self.script = script
self.allowEdit = True
Expand Down
Expand Up @@ -67,7 +67,7 @@ def unload(self):
ProcessingConfig.addSetting(ScriptUtils.SCRIPTS_FOLDER)

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'script.png'))
return QIcon(os.path.join(pluginPath, 'images', 'script.svg'))

def getName(self):
return 'script'
Expand Down

0 comments on commit 00ee2ad

Please sign in to comment.