Skip to content

Commit

Permalink
Reorganize icons theme for pyqgis console
Browse files Browse the repository at this point in the history
- add icon to Python Console entry in Plugins menu
  • Loading branch information
slarosa committed Jan 3, 2013
1 parent 1039423 commit d6a33f5
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 49 deletions.
36 changes: 18 additions & 18 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -490,24 +490,24 @@
<file>themes/default/text.png</file>
<file>themes/default/histogram.png</file>
<file>themes/default/pie-chart.png</file>
<file>console/iconClassConsole.png</file>
<file>console/iconSaveConsole.png</file>
<file>console/iconHelpConsole.png</file>
<file>console/iconSettingsConsole.png</file>
<file>console/iconOpenConsole.png</file>
<file>console/iconClearConsole.png</file>
<file>console/imgHelpDialog.png</file>
<file>console/iconSextanteConsole.png</file>
<file>console/iconScriptConsole.png</file>
<file>console/iconIfaceConsole.png</file>
<file>console/iconQtCoreConsole.png</file>
<file>console/iconQtGuiConsole.png</file>
<file>console/iconRunConsole.png</file>
<file>console/iconAboutConsole.png</file>
<file>console/iconCodepadConsole.png</file>
<file>console/imgHelpConsole.png</file>
<file>console/imgHelpMenu.png</file>
<file>console/iconHideToolConsole.png</file>
<file>themes/default/console/iconClassConsole.png</file>
<file>themes/default/console/iconSaveConsole.png</file>
<file>themes/default/console/iconHelpConsole.png</file>
<file>themes/default/console/iconSettingsConsole.png</file>
<file>themes/default/console/iconOpenConsole.png</file>
<file>themes/default/console/iconClearConsole.png</file>
<file>themes/default/console/imgHelpDialog.png</file>
<file>themes/default/console/iconSextanteConsole.png</file>
<file>themes/default/console/iconScriptConsole.png</file>
<file>themes/default/console/iconIfaceConsole.png</file>
<file>themes/default/console/iconQtCoreConsole.png</file>
<file>themes/default/console/iconQtGuiConsole.png</file>
<file>themes/default/console/iconRunConsole.png</file>
<file>themes/default/console/iconAboutConsole.png</file>
<file>themes/default/console/iconCodepadConsole.png</file>
<file>themes/default/console/imgHelpConsole.png</file>
<file>themes/default/console/imgHelpMenu.png</file>
<file>themes/default/console/iconHideToolConsole.png</file>
<file>flags/sr_Cyrl.png</file>
<file>flags/sr_Latn.png</file>
<file>flags/sw.png</file>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
25 changes: 13 additions & 12 deletions python/console/console.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from console_output import EditorOutput
from console_help import HelpDialog
from console_settings import optionsDialog
from qgis.core import QgsApplication

import sys
import os
Expand Down Expand Up @@ -121,7 +122,7 @@ def __init__(self, parent=None):
self.clearButton = QAction(parent)
self.clearButton.setCheckable(False)
self.clearButton.setEnabled(True)
self.clearButton.setIcon(QIcon(":/images/console/iconClearConsole.png"))
self.clearButton.setIcon(QgsApplication.getThemeIcon("console/iconClearConsole.png"))
self.clearButton.setMenuRole(QAction.PreferencesRole)
self.clearButton.setIconVisibleInMenu(True)
self.clearButton.setToolTip(clearBt)
Expand All @@ -131,7 +132,7 @@ def __init__(self, parent=None):
self.optionsButton = QAction(parent)
self.optionsButton.setCheckable(False)
self.optionsButton.setEnabled(True)
self.optionsButton.setIcon(QIcon(":/images/console/iconSettingsConsole.png"))
self.optionsButton.setIcon(QgsApplication.getThemeIcon("console/iconSettingsConsole.png"))
self.optionsButton.setMenuRole(QAction.PreferencesRole)
self.optionsButton.setIconVisibleInMenu(True)
self.optionsButton.setToolTip(optionsBt)
Expand All @@ -141,7 +142,7 @@ def __init__(self, parent=None):
self.actionClass = QAction(parent)
self.actionClass.setCheckable(False)
self.actionClass.setEnabled(True)
self.actionClass.setIcon(QIcon(":/images/console/iconClassConsole.png"))
self.actionClass.setIcon(QgsApplication.getThemeIcon("console/iconClassConsole.png"))
self.actionClass.setMenuRole(QAction.PreferencesRole)
self.actionClass.setIconVisibleInMenu(True)
self.actionClass.setToolTip(actionClassBt)
Expand All @@ -151,7 +152,7 @@ def __init__(self, parent=None):
self.actionScript = QAction(parent)
self.actionScript.setCheckable(False)
self.actionScript.setEnabled(True)
self.actionScript.setIcon(QIcon(":/images/console/iconScriptConsole.png"))
self.actionScript.setIcon(QgsApplication.getThemeIcon("console/iconScriptConsole.png"))
self.actionScript.setMenuRole(QAction.PreferencesRole)
self.actionScript.setIconVisibleInMenu(True)
self.actionScript.setToolTip(actionScriptBt)
Expand All @@ -161,7 +162,7 @@ def __init__(self, parent=None):
self.loadSextanteButton = QAction(parent)
self.loadSextanteButton.setCheckable(False)
self.loadSextanteButton.setEnabled(True)
self.loadSextanteButton.setIcon(QIcon(":/images/console/iconSextanteConsole.png"))
self.loadSextanteButton.setIcon(QgsApplication.getThemeIcon("console/iconSextanteConsole.png"))
self.loadSextanteButton.setMenuRole(QAction.PreferencesRole)
self.loadSextanteButton.setIconVisibleInMenu(True)
self.loadSextanteButton.setToolTip(loadSextanteBt)
Expand All @@ -171,7 +172,7 @@ def __init__(self, parent=None):
self.loadIfaceButton = QAction(parent)
self.loadIfaceButton.setCheckable(False)
self.loadIfaceButton.setEnabled(True)
self.loadIfaceButton.setIcon(QIcon(":/images/console/iconIfaceConsole.png"))
self.loadIfaceButton.setIcon(QgsApplication.getThemeIcon("console/iconIfaceConsole.png"))
self.loadIfaceButton.setMenuRole(QAction.PreferencesRole)
self.loadIfaceButton.setIconVisibleInMenu(True)
self.loadIfaceButton.setToolTip(loadIfaceBt)
Expand All @@ -181,7 +182,7 @@ def __init__(self, parent=None):
self.loadQtCoreButton = QAction(parent)
self.loadQtCoreButton.setCheckable(False)
self.loadQtCoreButton.setEnabled(True)
self.loadQtCoreButton.setIcon(QIcon(":/images/console/iconQtCoreConsole.png"))
self.loadQtCoreButton.setIcon(QgsApplication.getThemeIcon("console/iconQtCoreConsole.png"))
self.loadQtCoreButton.setMenuRole(QAction.PreferencesRole)
self.loadQtCoreButton.setIconVisibleInMenu(True)
self.loadQtCoreButton.setToolTip(loadQtCoreBt)
Expand All @@ -191,7 +192,7 @@ def __init__(self, parent=None):
self.loadQtGuiButton = QAction(parent)
self.loadQtGuiButton.setCheckable(False)
self.loadQtGuiButton.setEnabled(True)
self.loadQtGuiButton.setIcon(QIcon(":/images/console/iconQtGuiConsole.png"))
self.loadQtGuiButton.setIcon(QgsApplication.getThemeIcon("console/iconQtGuiConsole.png"))
self.loadQtGuiButton.setMenuRole(QAction.PreferencesRole)
self.loadQtGuiButton.setIconVisibleInMenu(True)
self.loadQtGuiButton.setToolTip(loadQtGuiBt)
Expand All @@ -201,7 +202,7 @@ def __init__(self, parent=None):
self.openFileButton = QAction(parent)
self.openFileButton.setCheckable(False)
self.openFileButton.setEnabled(True)
self.openFileButton.setIcon(QIcon(":/images/console/iconOpenConsole.png"))
self.openFileButton.setIcon(QgsApplication.getThemeIcon("console/iconOpenConsole.png"))
self.openFileButton.setMenuRole(QAction.PreferencesRole)
self.openFileButton.setIconVisibleInMenu(True)
self.openFileButton.setToolTip(openFileBt)
Expand All @@ -211,7 +212,7 @@ def __init__(self, parent=None):
self.saveFileButton = QAction(parent)
self.saveFileButton.setCheckable(False)
self.saveFileButton.setEnabled(True)
self.saveFileButton.setIcon(QIcon(":/images/console/iconSaveConsole.png"))
self.saveFileButton.setIcon(QgsApplication.getThemeIcon("console/iconSaveConsole.png"))
self.saveFileButton.setMenuRole(QAction.PreferencesRole)
self.saveFileButton.setIconVisibleInMenu(True)
self.saveFileButton.setToolTip(saveFileBt)
Expand All @@ -221,7 +222,7 @@ def __init__(self, parent=None):
self.runButton = QAction(parent)
self.runButton.setCheckable(False)
self.runButton.setEnabled(True)
self.runButton.setIcon(QIcon(":/images/console/iconRunConsole.png"))
self.runButton.setIcon(QgsApplication.getThemeIcon("console/iconRunConsole.png"))
self.runButton.setMenuRole(QAction.PreferencesRole)
self.runButton.setIconVisibleInMenu(True)
self.runButton.setToolTip(runBt)
Expand All @@ -231,7 +232,7 @@ def __init__(self, parent=None):
self.helpButton = QAction(parent)
self.helpButton.setCheckable(False)
self.helpButton.setEnabled(True)
self.helpButton.setIcon(QIcon(":/images/console/iconHelpConsole.png"))
self.helpButton.setIcon(QgsApplication.getThemeIcon("console/iconHelpConsole.png"))
self.helpButton.setMenuRole(QAction.PreferencesRole)
self.helpButton.setIconVisibleInMenu(True)
self.helpButton.setToolTip(helpBt)
Expand Down
30 changes: 15 additions & 15 deletions python/console/console_help/help.htm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<table id="header">
<tr>
<td>
<img src="qrc:/images/console/imgHelpDialog.png" />
<img src="qrc:/images/themes/default/console/imgHelpDialog.png" />
</td>
<td>
<span id="headerTitle" class="_title">Python Console for QGIS</span>
Expand All @@ -58,7 +58,7 @@
</td>
</tr>
<tr>
<td><img src="qrc:/images/console/imgHelpConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/imgHelpConsole.png" /></td>
</tr>
<tr>
<td>
Expand All @@ -69,7 +69,7 @@
You can drag and drop or copy text into input area (no matter if selected text contains >>> or ...).
Use 'Share on codepad' from contextual menu for sharing snippets code.
The context menu looks like the image below.</span><br><br>
<img src="qrc:/images/console/imgHelpMenu.png"><br>
<img src="qrc:/images/themes/default/console/imgHelpMenu.png"><br>
<span id="headerSubjectB">Input area pane is the interactive python shell for input commands.</span>
</p>
</td>
Expand Down Expand Up @@ -127,49 +127,49 @@
<p><span id="toolbarTitle">The following is a description of the tools in the toolbar:</span></p>
<table width="100%" border="0" id="headerTool">
<tr>
<td><img src="qrc:/images/console/iconClearConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconClearConsole.png" /></td>
<td colspan="2"><span id="toolbarClear">Tool to clear python console</span></td>
</tr>
<tr>
<td><img src="qrc:/images/console/iconClassConsole.png" /></td>
<td><img src="qrc:/images/console/iconIfaceConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconClassConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconIfaceConsole.png" /></td>
<td><span id="toolbarIfaceClass">Tool to import QgisInterface class</span></td>
</tr>
<tr>
<td></td>
<td><img src="qrc:/images/console/iconSextanteConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconSextanteConsole.png" /></td>
<td><span id="toolbarSextClass">Tool to import Sextante class</span></td>
</tr>
<tr>
<td></td>
<td><img src="qrc:/images/console/iconQtCoreConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconQtCoreConsole.png" /></td>
<td><span id="toolbarQtCoreClass">Tool to import PyQt4.QtCore class</span></td>
</tr>
<tr>
<td></td>
<td><img src="qrc:/images/console/iconQtGuiConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconQtGuiConsole.png" /></td>
<td><span id="toolbarQtGuiClass">Tool to import PyQt4.QtGui class</span></td>
</tr>
<tr>
<td><img src="qrc:/images/console/iconScriptConsole.png" /></td>
<td><img src="qrc:/images/console/iconOpenConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconScriptConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconOpenConsole.png" /></td>
<td><span id="toolbarScriptOpen">Tool to open a python script and load in console</span></td>
</tr>
<tr>
<td></td>
<td><img src="qrc:/images/console/iconSaveConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconSaveConsole.png" /></td>
<td><span id="toolbarScriptSave">Tool to save a python script</span></td>
</tr>
<tr>
<td><img src="qrc:/images/console/iconSettingsConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconSettingsConsole.png" /></td>
<td colspan="2"><span id="toolbarSettings">Settings</span></td>
</tr>
<tr>
<td><img src="qrc:/images/console/iconHelpConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconHelpConsole.png" /></td>
<td colspan="2"><span id="toolbarHelp">Help</span></td>
</tr>
<tr>
<td><img src="qrc:/images/console/iconRunConsole.png" /></td>
<td><img src="qrc:/images/themes/default/console/iconRunConsole.png" /></td>
<td colspan="2"><span id="toolbarRun">Run command (like Enter key pressed)</span></td>
</tr>
</table>
Expand Down
9 changes: 5 additions & 4 deletions python/console/console_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from PyQt4.Qsci import (QsciScintilla,
QsciScintillaBase,
QsciLexerPython)
from qgis.core import QgsApplication
import sys

class writeOut:
Expand Down Expand Up @@ -162,10 +163,10 @@ def clearConsole(self):

def contextMenuEvent(self, e):
menu = QMenu(self)
iconRun = QIcon(":/images/console/iconRunConsole.png")
iconPastebin = QIcon(":/images/console/iconCodepadConsole.png")
iconClear = QIcon(":/images/console/iconClearConsole.png")
iconHideTool = QIcon(":/images/console/iconHideToolConsole.png")
iconRun = QgsApplication.getThemeIcon("console/iconRunConsole.png")
iconPastebin = QgsApplication.getThemeIcon("console/iconCodepadConsole.png")
iconClear = QgsApplication.getThemeIcon("console/iconClearConsole.png")
iconHideTool = QgsApplication.getThemeIcon("console/iconHideToolConsole.png")
hideToolBar = menu.addAction(iconHideTool,
"Hide/Show Toolbar",
self.hideToolBar)
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,7 @@ void QgisApp::setTheme( QString theThemeName )
mActionToggleFullScreen->setIcon( QgsApplication::getThemeIcon( "/mActionToggleFullScreen.png" ) );
mActionProjectProperties->setIcon( QgsApplication::getThemeIcon( "/mActionProjectProperties.png" ) );
mActionManagePlugins->setIcon( QgsApplication::getThemeIcon( "/mActionShowPluginManager.png" ) );
mActionShowPythonDialog->setIcon( QgsApplication::getThemeIcon( "console/iconRunConsole.png" ) );
mActionCheckQgisVersion->setIcon( QgsApplication::getThemeIcon( "/mActionCheckQgisVersion.png" ) );
mActionOptions->setIcon( QgsApplication::getThemeIcon( "/mActionOptions.png" ) );
mActionConfigureShortcuts->setIcon( QgsApplication::getThemeIcon( "/mActionOptions.png" ) );
Expand Down

0 comments on commit d6a33f5

Please sign in to comment.