Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
icon themes support for the mapserver_export plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk@10381 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Mar 21, 2009
1 parent d4faea4 commit 93ec920
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion python/plugins/mapserver_export/CMakeLists.txt
@@ -1,7 +1,7 @@
#TODO: Need to configure cmake to run pyrcc4 and pyuic4 as required when the resource
# file or the ui change
SET(INSTALLER_FILES
icon.png
mapserver_export.png
__init__.py
mapserverexportdialog.py
mapserverexport.py
Expand Down
5 changes: 3 additions & 2 deletions python/plugins/mapserver_export/__init__.py
Expand Up @@ -26,9 +26,10 @@ def description():
def version():
return "Version 0.1"
def qgisMinimumVersion():
return "1.0"
return "1.0"
def authorName():
return "Gary E. Sherman"
def classFactory(iface):
# load MapServerExport class from file mapserverexport.py
from mapserverexport import MapServerExport
return MapServerExport(iface)

File renamed without changes
15 changes: 14 additions & 1 deletion python/plugins/mapserver_export/mapserverexport.py
Expand Up @@ -34,9 +34,22 @@ def __init__(self, iface):
# Save reference to the QGIS interface
self.iface = iface

def getThemeIcon(self, theName):
myCurThemePath = QgsApplication.activeThemePath() + "/plugins/" + theName;
myDefThemePath = QgsApplication.defaultThemePath() + "/plugins/" + theName;
myQrcPath = ":/plugins/mapserver_export/" + theName;
if QFile.exists(myCurThemePath):
return QIcon(myCurThemePath)
elif QFile.exists(myDefThemePath):
return QIcon(myDefThemePath)
elif QFile.exists(myQrcPath):
return QIcon(myQrcPath)
else:
return QIcon()

def initGui(self):
# Create action that will start plugin configuration
self.action = QAction(QIcon(":/plugins/mapserver_export/icon.png"), \
self.action = QAction(self.getThemeIcon("mapserver_export.png"), \
"MapServer Export", self.iface.mainWindow())
#self.action.setWhatsThis("Configuration for Zoom To Point plugin")
# connect the action to the run method
Expand Down
13 changes: 7 additions & 6 deletions python/plugins/mapserver_export/resources.py
Expand Up @@ -2,8 +2,8 @@

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

Expand Down Expand Up @@ -260,10 +260,11 @@
\x06\x40\x0f\xf4\
\x00\x6d\
\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\x08\
\x0a\x61\x5a\xa7\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x14\
\x0f\xfb\xd7\x47\
\x00\x6d\
\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\
\x00\x70\x00\x6e\x00\x67\
"

qt_resource_struct = "\
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/mapserver_export/resources.qrc
@@ -1,6 +1,6 @@
<RCC>
<qresource prefix="/plugins/mapserver_export" >
<file>icon.png</file>
<file>mapserver_export.png</file>
</qresource>
</RCC>

0 comments on commit 93ec920

Please sign in to comment.