[Qgis-developer] New Database Menu

Giuseppe Sucameli sucameli at faunalia.it
Sun Nov 14 09:20:13 EST 2010


Hi guys,
I've created the new Database menu as discussed at the HF.
This menu is available from QGis trunk r14638.

Here an example which explains how you can insert your plugin into this new
menu:

self.iface.addPluginToDatabaseMenu("&PostGIS", self.action)

and how remove it:

self.iface.removePluginDatabaseMenu("&PostGIS", self.action)

If you want that your python plugin works also with previous QGis version (<
1.7),
you should use the following codes instead.

(add to Database menu)

try:
    self.iface.addPluginToDatabaseMenu("&PostGIS", self.action)
except AttributeError:
    self.iface.addPluginToMenu("&PostGIS", self.action)

----
(remove from Database menu)

try:
    self.iface.removePluginDatabaseMenu("&PostGIS", self.action)
except AttributeError:
    self.iface.removePluginToMenu("&PostGIS", self.action)


I'm going to move the existent trunk Database plugins to the Database menu
and
my (Faunalia) DB plugins too.

Cheers.

-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20101114/21942c73/attachment-0001.html


More information about the Qgis-developer mailing list