Skip to content
Permalink
Browse files

Merge pull request #5124 from boundlessgeo/providers_gui_config

Providers gui config
  • Loading branch information
elpaso committed Sep 5, 2017
2 parents 1d0de60 + 59aaa27 commit 5f5be25357a62e77da2fe4909be499e6f122bee6
Showing with 1,198 additions and 115 deletions.
  1. +2 −0 python/gui/gui_auto.sip
  2. +10 −0 python/gui/qgsabstractdatasourcewidget.sip
  3. +6 −0 python/gui/qgsgui.sip
  4. +85 −0 python/gui/qgssourceselectprovider.sip
  5. +78 −0 python/gui/qgssourceselectproviderregistry.sip
  6. +4 −0 src/gui/CMakeLists.txt
  7. +9 −0 src/gui/qgsabstractdatasourcewidget.h
  8. +51 −100 src/gui/qgsdatasourcemanagerdialog.cpp
  9. +2 −5 src/gui/qgsdatasourcemanagerdialog.h
  10. +8 −0 src/gui/qgsgui.cpp
  11. +7 −0 src/gui/qgsgui.h
  12. +20 −0 src/gui/qgssourceselectprovider.cpp
  13. +75 −0 src/gui/qgssourceselectprovider.h
  14. +115 −0 src/gui/qgssourceselectproviderregistry.cpp
  15. +80 −0 src/gui/qgssourceselectproviderregistry.h
  16. +35 −0 src/providers/arcgisrest/qgsafsprovider.cpp
  17. +34 −0 src/providers/arcgisrest/qgsamsprovider.cpp
  18. +1 −1 src/providers/arcgisrest/qgsamssourceselect.h
  19. +32 −0 src/providers/db2/qgsdb2provider.cpp
  20. +32 −0 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  21. +36 −0 src/providers/gdal/qgsgdalprovider.cpp
  22. +32 −0 src/providers/mssql/qgsmssqlprovider.cpp
  23. +1 −0 src/providers/ogr/qgsogrdataitems.h
  24. +36 −0 src/providers/ogr/qgsogrprovider.cpp
  25. +34 −1 src/providers/oracle/qgsoracleprovider.cpp
  26. +31 −0 src/providers/postgres/qgspostgresprovider.cpp
  27. +33 −0 src/providers/spatialite/qgsspatialiteprovider.cpp
  28. +36 −0 src/providers/virtual/qgsvirtuallayerprovider.cpp
  29. +0 −3 src/providers/virtual/qgsvirtuallayersourceselect.h
  30. +34 −0 src/providers/wcs/qgswcsprovider.cpp
  31. +34 −0 src/providers/wfs/qgswfsprovider.cpp
  32. +10 −5 src/providers/wms/CMakeLists.txt
  33. +38 −0 src/providers/wms/qgswmsprovider.cpp
  34. +1 −0 tests/src/python/CMakeLists.txt
  35. +156 −0 tests/src/python/test_qgssourceselectprovider.py
@@ -21,6 +21,8 @@
%Include qgsvertexmarker.sip
%Include qgsfiledownloader.sip
%Include qgsabstractdatasourcewidget.sip
%Include qgssourceselectprovider.sip
%Include qgssourceselectproviderregistry.sip
%Include attributetable/qgsfeaturemodel.sip
%Include auth/qgsauthauthoritieseditor.sip
%Include auth/qgsauthcertificateinfo.sip
@@ -90,6 +90,16 @@ Emitted when a vector layer has been selected for addition
\param dataSourceType string (can be "file" or "database")
%End

void replaceVectorLayer( const QString &oldId, const QString &source, const QString &name, const QString &provider );
%Docstring
Emitted when a layer needs to be replaced
\param oldId old layer ID
\param source URI of the layer
\param name of the layer
\param provider key
%End


void progress( int, int );
%Docstring
Emitted when a progress dialog is shown by the provider dialog
@@ -38,6 +38,12 @@ class QgsGui
:rtype: QgsEditorWidgetRegistry
%End

static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry();
%Docstring
Returns the global source select provider registry, used for managing all known source select widget factories.
:rtype: QgsSourceSelectProviderRegistry
%End

static QgsShortcutsManager *shortcutsManager();
%Docstring
Returns the global shortcuts manager, used for managing a QAction and QShortcut sequences.
@@ -0,0 +1,85 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgssourceselectprovider.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsSourceSelectProvider
{
%Docstring
This is the interface for those who want to add entries to the QgsDataSourceManagerDialog

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgssourceselectprovider.h"
%End
public:
virtual ~QgsSourceSelectProvider();

virtual QString providerKey() const = 0;
%Docstring
Data Provider key
:rtype: str
%End

virtual QString name() const;
%Docstring
Source select provider name, this is useful to retrieve
a particular source select in case the provider has more
than one, it should be unique among all providers.

The default implementation returns the providerKey()
:rtype: str
%End

virtual QString text() const = 0;
%Docstring
Text for the menu item entry, it will be visible to the user so make sure it's translatable
:rtype: str
%End

virtual QString toolTip() const;
%Docstring
Text for the tooltip menu item entry, it will be visible to the user so make sure it's translatable

The default implementation returns an empty string.
:rtype: str
%End

virtual QIcon icon() const = 0;
%Docstring
Creates a new instance of an QIcon for the menu item entry
:rtype: QIcon
%End

virtual int ordering( ) const;
%Docstring
Ordering: the source select provider registry will be able to sort
the source selects (ascending) using this integer value
:rtype: int
%End

virtual QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = 0, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const = 0 /Factory/;
%Docstring
Create a new instance of QgsAbstractDataSourceWidget (or null).
Caller takes responsibility of deleting created.
:rtype: QgsAbstractDataSourceWidget
%End

};


/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgssourceselectprovider.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -0,0 +1,78 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgssourceselectproviderregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsSourceSelectProviderRegistry
{
%Docstring
This class keeps a list of source select providers that may add items to the QgsDataSourceManagerDialog
When created, it automatically adds providers from data provider plugins (e.g. PostGIS, WMS, ...)

QgsSourceSelectProviderRegistry is not usually directly created, but rather accessed through
QgsGui.sourceSelectProviderRegistry().

.. note::

This class access to QgsProviderRegistry instance to initialize, but QgsProviderRegistry is
typically initialized after QgsGui is constructed, for this reason a delayed initialization has been
implemented in the class.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgssourceselectproviderregistry.h"
%End
public:
QgsSourceSelectProviderRegistry();

~QgsSourceSelectProviderRegistry();


QList< QgsSourceSelectProvider *> providers();
%Docstring
Get list of available providers
:rtype: list of QgsSourceSelectProvider
%End

void addProvider( QgsSourceSelectProvider *provider /Transfer/ );
%Docstring
Add a ``provider`` implementation. Takes ownership of the object.
%End

bool removeProvider( QgsSourceSelectProvider *provider /Transfer/ );
%Docstring
:return: true if the provider was actually removed and deleted
:rtype: bool
%End

QgsSourceSelectProvider *providerByName( const QString &name );
%Docstring
Return a provider by ``name`` or None if not found
:rtype: QgsSourceSelectProvider
%End

QList<QgsSourceSelectProvider *> providersByKey( const QString &providerKey );
%Docstring
Return a (possibly empty) list of providers by data ``providerkey``
:rtype: list of QgsSourceSelectProvider
%End


private:
QgsSourceSelectProviderRegistry( const QgsSourceSelectProviderRegistry &rh );
};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgssourceselectproviderregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -349,6 +349,8 @@ SET(QGIS_GUI_SRCS
qgsfiledownloader.cpp
qgsdatasourcemanagerdialog.cpp
qgsabstractdatasourcewidget.cpp
qgssourceselectprovider.cpp
qgssourceselectproviderregistry.cpp
)

SET(QGIS_GUI_MOC_HDRS
@@ -711,6 +713,8 @@ SET(QGIS_GUI_HDRS
qgsfiledownloader.h
qgsdatasourcemanagerdialog.h
qgsabstractdatasourcewidget.h
qgssourceselectprovider.h
qgssourceselectproviderregistry.h

ogr/qgsogrhelperfunctions.h
ogr/qgsnewogrconnection.h
@@ -93,6 +93,15 @@ class GUI_EXPORT QgsAbstractDataSourceWidget : public QDialog
*/
void addVectorLayers( const QStringList &layerList, const QString &encoding, const QString &dataSourceType );

/** Emitted when a layer needs to be replaced
* \param oldId old layer ID
* \param source URI of the layer
* \param name of the layer
* \param provider key
*/
void replaceVectorLayer( const QString &oldId, const QString &source, const QString &name, const QString &provider );


//! Emitted when a progress dialog is shown by the provider dialog
void progress( int, int );

0 comments on commit 5f5be25

Please sign in to comment.
You can’t perform that action at this time.