[QGIS Commit] r10408 - in trunk/qgis/python/plugins: mapserver_export plugin_installer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Mar 23 09:18:27 EDT 2009


Author: borysiasty
Date: 2009-03-23 09:18:27 -0400 (Mon, 23 Mar 2009)
New Revision: 10408

Modified:
   trunk/qgis/python/plugins/mapserver_export/mapserverexport.py
   trunk/qgis/python/plugins/plugin_installer/__init__.py
   trunk/qgis/python/plugins/plugin_installer/installer_data.py
   trunk/qgis/python/plugins/plugin_installer/installer_gui.py
   trunk/qgis/python/plugins/plugin_installer/installer_plugin.py
Log:
on-the-fly icon theme change also for the python core plugins

Modified: trunk/qgis/python/plugins/mapserver_export/mapserverexport.py
===================================================================
--- trunk/qgis/python/plugins/mapserver_export/mapserverexport.py	2009-03-23 01:50:52 UTC (rev 10407)
+++ trunk/qgis/python/plugins/mapserver_export/mapserverexport.py	2009-03-23 13:18:27 UTC (rev 10408)
@@ -34,7 +34,13 @@
     # 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 @@
     #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)

Modified: trunk/qgis/python/plugins/plugin_installer/__init__.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/__init__.py	2009-03-23 01:50:52 UTC (rev 10407)
+++ trunk/qgis/python/plugins/plugin_installer/__init__.py	2009-03-23 13:18:27 UTC (rev 10408)
@@ -14,7 +14,7 @@
   return "Plugin Installer"
 
 def version():
-  return "Version 0.9.11"
+  return "Version 0.9.12"
 
 def description():
   return "Downloads and installs QGIS python plugins"

Modified: trunk/qgis/python/plugins/plugin_installer/installer_data.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_data.py	2009-03-23 01:50:52 UTC (rev 10407)
+++ trunk/qgis/python/plugins/plugin_installer/installer_data.py	2009-03-23 13:18:27 UTC (rev 10408)
@@ -572,7 +572,6 @@
         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

Modified: trunk/qgis/python/plugins/plugin_installer/installer_gui.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_gui.py	2009-03-23 01:50:52 UTC (rev 10407)
+++ trunk/qgis/python/plugins/plugin_installer/installer_gui.py	2009-03-23 13:18:27 UTC (rev 10408)
@@ -397,7 +397,7 @@
       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

Modified: trunk/qgis/python/plugins/plugin_installer/installer_plugin.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_plugin.py	2009-03-23 01:50:52 UTC (rev 10407)
+++ trunk/qgis/python/plugins/plugin_installer/installer_plugin.py	2009-03-23 13:18:27 UTC (rev 10408)
@@ -33,7 +33,14 @@
 
 
   # ----------------------------------------- #
+  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 @@
       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 @@
       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)



More information about the QGIS-commit mailing list