Skip to content
Permalink
Browse files

[addlayerbutton] New signals for new interfaces

  • Loading branch information
elpaso committed Jun 2, 2017
1 parent dcab8ca commit b31f05c72b8f98fbd9af8506e322a5e7851f3c60
Showing with 10 additions and 12 deletions.
  1. +8 −11 src/app/qgsdatasourcemanagerdialog.cpp
  2. +2 −1 src/app/qgsdatasourcemanagerdialog.h
@@ -46,16 +46,12 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas,
// Bind list index to the stacked dialogs
connect( ui->mList, SIGNAL( currentRowChanged( int ) ), this, SLOT( setCurrentPage( int ) ) );

/////////////////////////////////////////////////////////////////////////////
// BROWSER Add the browser widget to the first stacked widget page

mBrowserWidget = new QgsBrowserDockWidget( QStringLiteral( "Browser" ), this );
mBrowserWidget->setFeatures( QDockWidget::NoDockWidgetFeatures );
ui->mStackedWidget->addWidget( mBrowserWidget );

/////////////////////////////////////////////////////////////////////////////
// VECTOR Layers (completely different interface: it's not a provider)

QgsOpenVectorLayerDialog *ovl = new QgsOpenVectorLayerDialog( this, Qt::Widget, true );
ui->mStackedWidget->addWidget( ovl );
QListWidgetItem *ogrItem = new QListWidgetItem( tr( "Vector files" ), ui->mList );
@@ -65,7 +61,6 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas,
// Add data provider dialogs
QDialog *dlg;


#ifdef HAVE_POSTGRESQL
addDbProviderDialog( QStringLiteral( "postgres" ), tr( "PostgreSQL" ), QStringLiteral( "/mActionAddPostgisLayer.svg" ) );
#endif
@@ -83,13 +78,15 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas,
addRasterProviderDialog( QStringLiteral( "wcs" ), tr( "WCS" ), QStringLiteral( "/mActionAddWcsLayer.svg" ) );

dlg = providerDialog( QStringLiteral( "WFS" ), tr( "WFS" ), QStringLiteral( "/mActionAddWfsLayer.svg" ) );

if ( dlg )
{
// Forward (if only a common interface for the signals had been used in the providers ...)
connect( dlg, SIGNAL( addFsLayer( QString, QString ) ), this, SIGNAL( addFsLayer( QString, QString ) ) );
connect( this, &QgsDataSourceManagerDialog::addFsLayer,
this, [ = ]( const QString & vectorLayerPath, const QString & baseName )
{ this->vectorLayerAdded( vectorLayerPath, baseName, QStringLiteral( "WFS" ) ); } );
connect( dlg, SIGNAL( addWfsLayer( QString, QString ) ), this, SIGNAL( addWfsLayer( QString, QString ) ) );
connect( this, &QgsDataSourceManagerDialog::addWfsLayer, this, [ = ]( const QString & vectorLayerPath, const QString & baseName )
{
this->vectorLayerAdded( vectorLayerPath, baseName, QStringLiteral( "WFS" ) );
} );
}

QgsSourceSelectDialog *afss = dynamic_cast<QgsSourceSelectDialog *>( providerDialog( QStringLiteral( "arcgisfeatureserver" ),
@@ -99,8 +96,8 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas,
{
afss->setCurrentExtentAndCrs( mMapCanvas->extent(), mMapCanvas->mapSettings().destinationCrs() );
// Forward (if only a common interface for the signals had been used in the providers ...)
connect( afss, SIGNAL( addLayer( QString, QString ) ), this, SIGNAL( addFsLayer( QString, QString ) ) );
connect( this, &QgsDataSourceManagerDialog::addFsLayer,
connect( afss, SIGNAL( addLayer( QString, QString ) ), this, SIGNAL( addAfsLayer( QString, QString ) ) );
connect( this, &QgsDataSourceManagerDialog::addAfsLayer,
this, [ = ]( const QString & vectorLayerPath, const QString & baseName )
{ this->vectorLayerAdded( vectorLayerPath, baseName, QStringLiteral( "arcgisfeatureserver" ) ); } );
}
@@ -50,7 +50,8 @@ class QgsDataSourceManagerDialog : public QDialog
//! For signal forwarding to QgisApp
void addRasterLayer( QString const &uri, QString const &baseName, QString const &providerKey );
void addVectorLayer( const QString &vectorLayerPath, const QString &baseName, const QString &providerKey );
void addFsLayer( const QString &uri, const QString &typeName );
void addWfsLayer( const QString &uri, const QString &typeName );
void addAfsLayer( const QString &uri, const QString &typeName );
void addVectorLayers( const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType );
void showProgress( int progress, int totalSteps );
void showStatusMessage( const QString &message );

0 comments on commit b31f05c

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