[Qgis-developer] set plugin enabled by default

Stefan Kiefer st_kiefer at web.de
Mon Mar 1 11:59:11 EST 2010


Hi Borys,
great, this is exactly what I needed, at least for the workaround. When
I find the time I will see that I get a glimpse on the sources, to
improve what I have to do. But menawhile this will do.

> kinda virus...

yeah, that was my thought when I got the idea of the workaround ;) . But
at least it works.
thanks again

best regards

Stefan

Am Montag, den 01.03.2010, 17:30 +0100 schrieb Borys Jurgiel:

> Dnia poniedziałek, 1 marca 2010 o 15:00:55 Stefan Kiefer napisał(a):
> > Hi Borys,
> > thanks for your answer.
> > that might be a way I also had in mind. Otherwise in Windows
> > environments the config is written to the registry. I would like to
> > avoid interferring with the registry. Whereas that would be manageable
> > with an installer, in Linux environments one needs to manipulate the
> > config file as you mentioned. Manipulating this file with an installer
> > would not be as easy. Otherwise, either the config file as well as the
> > registry entries exist only when Qgis was run first. So I have to
> > consider this as well.
> > Also with Linux there could be an - unlikly - issue that somone has
> > changed the QT-config path settings, Whereas this is not to expect.
> > 
> > Anyway, I believe I need a more sophisticated way, like setting a flag
> > while Qgis loads all the plugins. Or a workaround, like activating my
> > plugin with one of the default plugins. Manipulating the default plugins
> > might be the ultimo ratio, because I would neither to change this
> > plugins (in favor of avoiding instabilities) nor risk to overwrite
> > possible changes or updates on the users machine!
> > 
> > Otherwise, does anyone know whether  there is a flag or a property or
> > any way to enable/disable plugins programmatical, let's say from another
> > plugin?
> 
> From another plugin you can start your plugin for the current session:
> 
> qgis.utils.loadPlugin('your_module_name')
> qgis.utils.startPlugin('your_module_name')
> 
> and also enable it to be automatically loaded from the next time:
> 
> settings=QSettings()
> settings.setValue('PythonPlugins/your_module_name', QVariant(True))
> 
> Yo can let your installer insert such instructions to the PluginInstaller 
> (thought it's kinda virus... :) but remember it installs in the system 
> location and only its updates go to the user directory, where mask the system 
> one.
> 
> Many users won't have it installed in the user directory, and your installer 
> would create a fake PluginInstaller what masks the true one. So your installer 
> should determine if there is PluginInstaller in the user directory and if 
> isn't, it can create the fake one, but has to tell to your plugin to remove it 
> at the first run. So it's gonna be a little weird ;-)
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100301/32ad3fe7/attachment.html


More information about the Qgis-developer mailing list