Rebase and partially revert 9bae83275368

All signals are now in the base class, even if only
a subset of available providers actually emits them.

This way we can handle all source select dialogs
the same way, regardless if they are vector, DB
or raster (or others).
This commit is contained in:
Alessandro Pasotti 2017-07-18 12:15:57 +02:00
parent e83ef2e8b5
commit bd925cd648
10 changed files with 20 additions and 17 deletions

View File

@ -67,6 +67,16 @@ Emitted when a raster layer has been selected for addition
void addVectorLayer( const QString &uri, const QString &layerName );
%Docstring
Emitted when a vector layer has been selected for addition
%End
void progress( int, int );
%Docstring
Emitted when a progress dialog is shown by the provider dialog
%End
void progressMessage( QString message );
%Docstring
Emitted when a progress dialog is shown by the provider dialog
%End
protected:

View File

@ -112,8 +112,6 @@ Stores the selected datasource whenerver it is changed
Add some default wms servers to the list
%End
void on_mDialogButtonBox_helpRequested();
protected:
virtual QList<QgsOWSSourceSelect::SupportedFormat> providerFormats();

View File

@ -76,6 +76,12 @@ class GUI_EXPORT QgsAbstractDataSourceWidget : public QDialog
//! Emitted when a vector layer has been selected for addition
void addVectorLayer( const QString &uri, const QString &layerName );
//! Emitted when a progress dialog is shown by the provider dialog
void progress( int, int );
//! Emitted when a progress dialog is shown by the provider dialog
void progressMessage( QString message );
protected:
//! Constructor

View File

@ -104,10 +104,10 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
//! Emitted when a connection has changed inside the provider dialogs
//! This signal is normally forwarded to the application to notify other
//! browsers that they need to refresh their connections list
void connectionsChanged( );
void connectionsChanged();
//! One or more provider connections have changed and the
//! dialogs should be refreshed
void providerDialogsRefreshRequested( );
void providerDialogsRefreshRequested();
private:
// Return the dialog from the provider

View File

@ -110,8 +110,6 @@ class GUI_EXPORT QgsOWSSourceSelect : public QgsAbstractDataSourceWidget, protec
//! Add some default wms servers to the list
void on_mAddDefaultButton_clicked();
void on_mDialogButtonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
protected:
/**

View File

@ -30,11 +30,6 @@ class QgsAmsSourceSelect: public QgsArcGisServiceSourceSelect
public:
QgsAmsSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
signals:
void addRasterLayer( QString const &rasterLayerPath,
QString const &baseName,
QString const &providerKey );
protected:
bool connectToService( const QgsOwsConnection &connection ) override;
QString getLayerURI( const QgsOwsConnection &connection,

View File

@ -458,7 +458,7 @@ void QgsDb2SourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "DB2" ) );
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
if ( !mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}

View File

@ -110,8 +110,6 @@ class QgsDb2SourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsDb
signals:
void addGeometryColumn( QgsDb2LayerProperty );
void progress( int, int );
void progressMessage( QString );
public slots:
//! Determines the tables the user selected and closes the dialog

View File

@ -453,7 +453,7 @@ void QgsMssqlSourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "mssql" ) );
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
if ( !mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
{
accept();
}

View File

@ -80,8 +80,6 @@ class QgsMssqlSourceSelect : public QgsAbstractDataSourceWidget, private Ui::Qgs
signals:
void addGeometryColumn( const QgsMssqlLayerProperty & );
void progress( int, int );
void progressMessage( QString );
public slots: