Adds connectionsChanged signal to iface

This is meant to be used by plugins (DBManager is the
first candidate) to notify the application that
the GUI elements that handle connections needs to
be updated (i.e. the data source manager dialog
and the browsers)
This commit is contained in:
Alessandro Pasotti 2017-09-14 14:08:59 +02:00
parent d8940544f7
commit 91a98902a1
3 changed files with 20 additions and 0 deletions

View File

@ -1256,6 +1256,15 @@ Get timeout for timed messages: default of 5 seconds
\note
added in version 2.7
%End
void connectionsChanged();
%Docstring
Emitted when connections have changed, this signal is forwarded
to the GUI elements that needs to be updated (i.e. the source
select dialogs and the browser widgets)
.. versionadded:: 3.0
%End
};
/************************************************************************

View File

@ -934,6 +934,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
mInternalClipboard = new QgsClipboard; // create clipboard
connect( mInternalClipboard, &QgsClipboard::changed, this, &QgisApp::clipboardChanged );
mQgisInterface = new QgisAppInterface( this ); // create the interfce
// Forward signal
connect( mQgisInterface, &QgisInterface::connectionsChanged, this, &QgisApp::connectionsChanged );
#ifdef Q_OS_MAC
// action for Window menu (create before generating WindowTitleChange event))

View File

@ -796,6 +796,15 @@ class GUI_EXPORT QgisInterface : public QObject
* added in version 2.7
*/
void layerSavedAs( QgsMapLayer *l, const QString &path );
/**
* Emitted when connections have changed, this signal is forwarded
* to the GUI elements that needs to be updated (i.e. the source
* select dialogs and the browser widgets)
* \since QGIS 3.0
*/
void connectionsChanged();
};
Q_NOWARN_DEPRECATED_POP