Hi David It is possible to add/remove entries in the WMS connection list from plugins by using QSettings. Have a look at qgsserversourceselect.cpp/h and qgsnewhttpconnection.cpp/h to see how it is done.
However, it is not possible to pop up the WMS dialog from plugin, because QgsServerSourceSelect / QgsNewHttpConnection are in the app module and not exposed to plugins. So the sound solution would be to move qgsserversourceselect.cpp/h and qgsnewhttpconnection.cpp/h from the app to the gui module. The quick and dirty solution would be that you copy those two classes to your plugin (but that only works for C++ plugins, e.g. is done for WFS with qgsnewhttpconnection). Are there any objections if we move QgsServerSourceSelect / QgsNewHttpConnection to gui? QgsNewHttpConnection is also used by WFS (and my OGC SOS plugin in progress), so I have no doubts about this class. QgsServerSourceSelect might still be usefull for third party apps. And of course we are interested to hear about progresses with the CSW plugin :-) Regards, Marco -----Ursprüngliche Nachricht----- Von: [email protected] im Auftrag von Sampson, David Gesendet: Mi 03.06.2009 15:22 An: [email protected] Betreff: [Qgis-user] Calling WMS 'Plugin' from a CSW plugin... Hey Folks, I am working on a plugin that wants to take the result and pass it to other plugins. One plugin is the WMS tool... OK it may no longer be a plugin but that is how I am considering it. I am playing with the OGC CSW spec to make a CSW client for inside QGIS... What I want to do is this. From a python plugin I want to 1. Create a new WMS server connection by passing a name and url combo to the WMS tool 2. have the dialog pop up with the new server connection populated and layers displayed. That way all the user needs to do is choose the layers they wish to add and then click ADD. This is in the hopes the CSW client can exploit other service specific tools/plugins. Any thoughts? P.S I assume this is a user question and not a developer question as this is dealing with scripts and not QGIS core. Cheers _______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user
