Skip to content

Commit bd925cd

Browse files
committedJul 18, 2017
Rebase and partially revert 9bae832
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).
1 parent e83ef2e commit bd925cd

10 files changed

+20
-17
lines changed
 

‎python/gui/qgsabstractdatasourcewidget.sip

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ Emitted when a raster layer has been selected for addition
6767
void addVectorLayer( const QString &uri, const QString &layerName );
6868
%Docstring
6969
Emitted when a vector layer has been selected for addition
70+
%End
71+
72+
void progress( int, int );
73+
%Docstring
74+
Emitted when a progress dialog is shown by the provider dialog
75+
%End
76+
77+
void progressMessage( QString message );
78+
%Docstring
79+
Emitted when a progress dialog is shown by the provider dialog
7080
%End
7181

7282
protected:

‎python/gui/qgsowssourceselect.sip

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ Stores the selected datasource whenerver it is changed
112112
Add some default wms servers to the list
113113
%End
114114

115-
void on_mDialogButtonBox_helpRequested();
116-
117115
protected:
118116

119117
virtual QList<QgsOWSSourceSelect::SupportedFormat> providerFormats();

‎src/gui/qgsabstractdatasourcewidget.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ class GUI_EXPORT QgsAbstractDataSourceWidget : public QDialog
7676
//! Emitted when a vector layer has been selected for addition
7777
void addVectorLayer( const QString &uri, const QString &layerName );
7878

79+
//! Emitted when a progress dialog is shown by the provider dialog
80+
void progress( int, int );
81+
82+
//! Emitted when a progress dialog is shown by the provider dialog
83+
void progressMessage( QString message );
84+
7985
protected:
8086

8187
//! Constructor

‎src/gui/qgsdatasourcemanagerdialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
104104
//! Emitted when a connection has changed inside the provider dialogs
105105
//! This signal is normally forwarded to the application to notify other
106106
//! browsers that they need to refresh their connections list
107-
void connectionsChanged( );
107+
void connectionsChanged();
108108
//! One or more provider connections have changed and the
109109
//! dialogs should be refreshed
110-
void providerDialogsRefreshRequested( );
110+
void providerDialogsRefreshRequested();
111111

112112
private:
113113
// Return the dialog from the provider

‎src/gui/qgsowssourceselect.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ class GUI_EXPORT QgsOWSSourceSelect : public QgsAbstractDataSourceWidget, protec
110110
//! Add some default wms servers to the list
111111
void on_mAddDefaultButton_clicked();
112112

113-
void on_mDialogButtonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
114-
115113
protected:
116114

117115
/**

‎src/providers/arcgisrest/qgsamssourceselect.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ class QgsAmsSourceSelect: public QgsArcGisServiceSourceSelect
3030
public:
3131
QgsAmsSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
3232

33-
signals:
34-
void addRasterLayer( QString const &rasterLayerPath,
35-
QString const &baseName,
36-
QString const &providerKey );
37-
3833
protected:
3934
bool connectToService( const QgsOwsConnection &connection ) override;
4035
QString getLayerURI( const QgsOwsConnection &connection,

‎src/providers/db2/qgsdb2sourceselect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ void QgsDb2SourceSelect::addTables()
458458
else
459459
{
460460
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "DB2" ) );
461-
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
461+
if ( !mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
462462
{
463463
accept();
464464
}

‎src/providers/db2/qgsdb2sourceselect.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ class QgsDb2SourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsDb
110110

111111
signals:
112112
void addGeometryColumn( QgsDb2LayerProperty );
113-
void progress( int, int );
114-
void progressMessage( QString );
115113

116114
public slots:
117115
//! Determines the tables the user selected and closes the dialog

‎src/providers/mssql/qgsmssqlsourceselect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ void QgsMssqlSourceSelect::addTables()
453453
else
454454
{
455455
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "mssql" ) );
456-
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
456+
if ( !mHoldDialogOpen->isChecked() && QgsAbstractDataSourceWidget::widgetMode() == QgsProviderRegistry::WidgetMode::None )
457457
{
458458
accept();
459459
}

‎src/providers/mssql/qgsmssqlsourceselect.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ class QgsMssqlSourceSelect : public QgsAbstractDataSourceWidget, private Ui::Qgs
8080

8181
signals:
8282
void addGeometryColumn( const QgsMssqlLayerProperty & );
83-
void progress( int, int );
84-
void progressMessage( QString );
8583

8684
public slots:
8785

0 commit comments

Comments
 (0)
Please sign in to comment.