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
This commit is contained in:
borysiasty 2009-03-23 13:18:27 +00:00
parent da13c4e9e4
commit 60611ef1ef
5 changed files with 17 additions and 5 deletions

View File

@ -34,7 +34,13 @@ class MapServerExport:
# 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 @@ class MapServerExport:
#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)

View File

@ -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"

View File

@ -572,7 +572,6 @@ class Plugins(QObject):
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

View File

@ -397,7 +397,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
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

View File

@ -32,8 +32,15 @@ class InstallerPlugin():
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 @@ class InstallerPlugin():
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 @@ class InstallerPlugin():
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)