Skip to content

Commit 93ec920

Browse files
author
borysiasty
committed
icon themes support for the mapserver_export plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk@10381 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d4faea4 commit 93ec920

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

python/plugins/mapserver_export/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#TODO: Need to configure cmake to run pyrcc4 and pyuic4 as required when the resource
22
# file or the ui change
33
SET(INSTALLER_FILES
4-
icon.png
4+
mapserver_export.png
55
__init__.py
66
mapserverexportdialog.py
77
mapserverexport.py

python/plugins/mapserver_export/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ def description():
2626
def version():
2727
return "Version 0.1"
2828
def qgisMinimumVersion():
29-
return "1.0"
29+
return "1.0"
30+
def authorName():
31+
return "Gary E. Sherman"
3032
def classFactory(iface):
3133
# load MapServerExport class from file mapserverexport.py
3234
from mapserverexport import MapServerExport
3335
return MapServerExport(iface)
34-

python/plugins/mapserver_export/mapserverexport.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,22 @@ def __init__(self, iface):
3434
# Save reference to the QGIS interface
3535
self.iface = iface
3636

37+
def getThemeIcon(self, theName):
38+
myCurThemePath = QgsApplication.activeThemePath() + "/plugins/" + theName;
39+
myDefThemePath = QgsApplication.defaultThemePath() + "/plugins/" + theName;
40+
myQrcPath = ":/plugins/mapserver_export/" + theName;
41+
if QFile.exists(myCurThemePath):
42+
return QIcon(myCurThemePath)
43+
elif QFile.exists(myDefThemePath):
44+
return QIcon(myDefThemePath)
45+
elif QFile.exists(myQrcPath):
46+
return QIcon(myQrcPath)
47+
else:
48+
return QIcon()
49+
3750
def initGui(self):
3851
# Create action that will start plugin configuration
39-
self.action = QAction(QIcon(":/plugins/mapserver_export/icon.png"), \
52+
self.action = QAction(self.getThemeIcon("mapserver_export.png"), \
4053
"MapServer Export", self.iface.mainWindow())
4154
#self.action.setWhatsThis("Configuration for Zoom To Point plugin")
4255
# connect the action to the run method

python/plugins/mapserver_export/resources.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Resource object code
44
#
5-
# Created: Mon Jan 7 20:40:39 2008
6-
# by: The Resource Compiler for PyQt (Qt v4.3.2)
5+
# Created: pon. sty 12 13:36:27 2009
6+
# by: The Resource Compiler for PyQt (Qt v4.3.4)
77
#
88
# WARNING! All changes made in this file will be lost!
99

@@ -260,10 +260,11 @@
260260
\x06\x40\x0f\xf4\
261261
\x00\x6d\
262262
\x00\x61\x00\x70\x00\x73\x00\x65\x00\x72\x00\x76\x00\x65\x00\x72\x00\x5f\x00\x65\x00\x78\x00\x70\x00\x6f\x00\x72\x00\x74\
263-
\x00\x08\
264-
\x0a\x61\x5a\xa7\
265-
\x00\x69\
266-
\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
263+
\x00\x14\
264+
\x0f\xfb\xd7\x47\
265+
\x00\x6d\
266+
\x00\x61\x00\x70\x00\x73\x00\x65\x00\x72\x00\x76\x00\x65\x00\x72\x00\x5f\x00\x65\x00\x78\x00\x70\x00\x6f\x00\x72\x00\x74\x00\x2e\
267+
\x00\x70\x00\x6e\x00\x67\
267268
"
268269

269270
qt_resource_struct = "\
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<RCC>
22
<qresource prefix="/plugins/mapserver_export" >
3-
<file>icon.png</file>
3+
<file>mapserver_export.png</file>
44
</qresource>
55
</RCC>
66

0 commit comments

Comments
 (0)