Skip to content

Commit

Permalink
on-the-fly icon theme change also for the python core plugins
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@10408 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Mar 23, 2009
1 parent da13c4e commit 60611ef
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
7 changes: 7 additions & 0 deletions python/plugins/mapserver_export/mapserverexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ def __init__(self, iface):
# Save reference to the QGIS interface
self.iface = iface

# ----------------------------------------- #
def setCurrentTheme(self, theThemeName):
# Set icons to the current theme
self.action.setIcon(self.getThemeIcon("mapserver_export.png"))

def getThemeIcon(self, theName):
# get the icon from the best available theme
myCurThemePath = QgsApplication.activeThemePath() + "/plugins/" + theName;
myDefThemePath = QgsApplication.defaultThemePath() + "/plugins/" + theName;
myQrcPath = ":/plugins/mapserver_export/" + theName;
Expand All @@ -54,6 +60,7 @@ def initGui(self):
#self.action.setWhatsThis("Configuration for Zoom To Point plugin")
# connect the action to the run method
QObject.connect(self.action, SIGNAL("activated()"), self.run)
QObject.connect(self.iface, SIGNAL("currentThemeChanged ( QString )"), self.setCurrentTheme)

# Add toolbar button and menu item
self.iface.addToolBarIcon(self.action)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/plugin_installer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def name():
return "Plugin Installer"

def version():
return "Version 0.9.11"
return "Version 0.9.12"

def description():
return "Downloads and installs QGIS python plugins"
Expand Down
1 change: 0 additions & 1 deletion python/plugins/plugin_installer/installer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ def updatePlugin(self, key, readOnly):
self.mPlugins[key]["name"] = plugin["name"] # local name has higher priority
self.mPlugins[key]["version_inst"] = plugin["version_inst"]
self.mPlugins[key]["desc_local"] = plugin["desc_local"]
self.mPlugins[key]["experimental"] = False
# set status
#
# installed available status
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/plugin_installer/installer_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def filterCheck(self,plugin):
return True
else:
for i in ["name","version_inst","version_avail","desc_repo","desc_local","author","status","repository"]:
item = QString(plugin[i]) #.toUpper()
item = QString(plugin[i])
if item != None:
if item.contains(self.lineFilter.text(), Qt.CaseInsensitive):
return True
Expand Down
10 changes: 8 additions & 2 deletions python/plugins/plugin_installer/installer_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ def __init__(self, iface):
self.mainWindow = self.iface.getMainWindow


# ----------------------------------------- #
def setCurrentTheme(self, theThemeName):
""" Set icons to the current theme """
self.action.setIcon(self.getThemeIcon("plugin_installer.png"))


# ----------------------------------------- #
def getThemeIcon(self, theName):
""" get the icon from the best available theme """
myCurThemePath = QgsApplication.activeThemePath() + "/plugins/" + theName;
myDefThemePath = QgsApplication.defaultThemePath() + "/plugins/" + theName;
myQrcPath = ":/plugins/installer/" + theName;
Expand All @@ -60,6 +67,7 @@ def initGui(self):
nextAction = self.mainWindow().menuBar().actions()[4].menu().actions()[1]
self.mainWindow().menuBar().actions()[4].menu().insertAction(nextAction,self.action)
QObject.connect(self.action, SIGNAL("activated()"), self.run)
QObject.connect(self.iface, SIGNAL("currentThemeChanged ( QString )"), self.setCurrentTheme)
self.statusLabel = None

repositories.load()
Expand All @@ -69,8 +77,6 @@ def initGui(self):
self.statusLabel = QLabel(QCoreApplication.translate("QgsPluginInstaller","Looking for new plugins..."), self.mainWindow().statusBar())
self.mainWindow().statusBar().insertPermanentWidget(0,self.statusLabel)
QObject.connect(self.statusLabel, SIGNAL("linkActivated (QString)"), self.preRun)


QObject.connect(repositories, SIGNAL("checkingDone()"), self.checkingDone)
for key in repositories.allEnabled():
repositories.requestFetching(key)
Expand Down

0 comments on commit 60611ef

Please sign in to comment.