Skip to content
Permalink
Browse files

on-the-fly icon theme change also for the python core plugins

git-svn-id: http://svn.osgeo.org/qgis/trunk@10408 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty
borysiasty committed Mar 23, 2009
1 parent da13c4e commit 60611ef1ef6759fee58900364e4261cd14f3534d
@@ -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;
@@ -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)
@@ -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"
@@ -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
@@ -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
@@ -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;
@@ -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()
@@ -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)

0 comments on commit 60611ef

Please sign in to comment.
You can’t perform that action at this time.