[Qgis-developer] Plugins approval

Borys Jurgiel lists at borysjurgiel.pl
Mon Jan 6 11:22:28 PST 2014


We were discussing it already, without any success, and I can't imagine how it 
could be done with the 2.x API.

Currently each plugin just calls one of the QgisInterface methods: 
addPluginToVectorMenu, addPluginToRasterMenu etc. An obvious idea is to create 
an universal method "addPluginToTheRightMenu", but unfortunately it's not so 
simple. QgisInterface doesn't know "who" calls the method, so it can't access 
its metadata. The only way would be to explicitly pass the plugin module name:

moduleName = os.path.split(os.path.dirname(__file__))[1]
iface.addPluginToTheRightMenu( "A menu label", action, moduleName )

I guess it's too nasty to even discuss it ;)

So the only real solution I see would be to create an abstract plugin class 
and forece authors to inherite their plugins from this class. I'm not 
convinced if it's worth of the effort at all, but anyway it would be 
definitely a major change that has to wait for API 3.x

But maybe somebody has a simpler idea?


Dnia niedziela, 5 stycznia 2014 20:40:35 Richard Duivenvoorde pisze:
> Currently the 'menu'-functionality is half way there, I think.
> While one defines a 'menu' in the metadata.txt, the actual placing has
> to be done by the coder self in python.
> Not sure what the reason was (alexander?)... (was it that the
> pluginmanager had to know it, or that the plugins were loaded before the
> gui or....).
> But I think it would be nice to have this fixed first. Then a user can
> even 'move' a plugin by changing the metadata.txt.
> Regards,
> Richard Duivenvoorde
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

More information about the Qgis-developer mailing list