qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.09k stars 2.93k forks source link

Allow opening datasource manager dialog via Python #46577

Open ricardogsilva opened 2 years ago

ricardogsilva commented 2 years ago

Feature description

QGIS currently allows Python plugins to register additional datasource providers by implementing subclasses of QgsSourceSelectProvider and QgsAbstractDataSourceWidget. These can then be hooked up via calling QgsSourceSelectProviderRegistry().addProvider.

This has the effect of letting plugins add new sections to the QGIS datasource manager dialog.

However, there does not seem to be a way to let plugins refer to the datasource manager dialog in order to, for example, create an action to open it on a specific section. This means that it is not possible to implement functionality analogous to the Add Vector Layer... - the concrete use case I have in mind is I'd like to have a Add GeoNode layer... action as part of the QGIS GeoNode plugin.

It would be great to be able to open the QGIS datasource manager dialog on arbitrary sections from Python. This would make for a more seamless experience for plugins

Additional context

No response

ricardogsilva commented 2 years ago

cc @Samweli - this is related to our kartoza/qgis_geonode#166

Samweli commented 2 years ago

cc @Samweli - this is related to our kartoza/qgis_geonode#166

noted @ricardogsilva