Skip to content

Commit

Permalink
Add missing currentThemeChanged signal to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 9, 2017
1 parent 8cf5860 commit b0c88f1
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ class QgisInterface : QObject

signals:
void currentLayerChanged( QgsMapLayer *layer );
void currentThemeChanged( const QString &theme );
void composerOpened( QgsComposerInterface *composer );
void composerWillBeClosed( QgsComposerInterface *composer );
void composerClosed( QgsComposerInterface *composer );
Expand Down
3 changes: 0 additions & 3 deletions src/app/qgisappinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,6 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
//! Get timeout for timed messages: default of 5 seconds
virtual int messageTimeout() override;

signals:
void currentThemeChanged( const QString & );

private slots:

void cacheloadForm( const QString &uifile );
Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgisinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ class GUI_EXPORT QgisInterface : public QObject
*/
void currentLayerChanged( QgsMapLayer *layer );

/** Signal emitted when the current \a theme is changed so plugins
* can change their tool button icons.
* \since QGIS 3.0
*/
void currentThemeChanged( const QString &theme );

/**
* This signal is emitted when a new composer window has been opened.
* \since QGIS 3.0
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/coordinate_capture/coordinatecapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void CoordinateCapture::initGui()
mCrs.createFromSrsId( GEOCRS_ID ); // initialize the CRS object

connect( mQGisIface->mapCanvas(), &QgsMapCanvas::destinationCrsChanged, this, &CoordinateCapture::setSourceCrs );
connect( mQGisIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
connect( mQGisIface, &QgisInterface::currentThemeChanged, this, &CoordinateCapture::setCurrentTheme );

setSourceCrs(); //set up the source CRS
mTransform.setDestinationCrs( mCrs ); // set the CRS in the transform
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsgeorefplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void QgsGeorefPlugin::initGui()

setCurrentTheme( QLatin1String( "" ) );
// this is called when the icon theme is changed
connect( mQGisIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
connect( mQGisIface, &QgisInterface::currentThemeChanged, this, &QgsGeorefPlugin::setCurrentTheme );

// Add to the toolbar & menu
mQGisIface->addRasterToolBarIcon( mActionRunGeoref );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsgeorefplugingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface *qgisInterface, QWidget *p

mCanvas->clearExtentHistory(); // reset zoomnext/zoomlast

connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( updateIconTheme( QString ) ) );
connect( mIface, &QgisInterface::currentThemeChanged, this, &QgsGeorefPluginGui::updateIconTheme );

if ( s.value( QStringLiteral( "/Plugin-GeoReferencer/Config/ShowDocked" ) ).toBool() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/gps_importer/qgsgpsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void QgsGPSPlugin::initGui()
mQGisInterface->addVectorToolBarIcon( mQActionPointer );

// this is called when the icon theme is changed
connect( mQGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
connect( mQGisInterface, &QgisInterface::currentThemeChanged, this, &QgsGPSPlugin::setCurrentTheme );
}

//method defined in interface
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void QgsGrassPlugin::initGui()
// Set icons to current theme
setCurrentTheme( QLatin1String( "" ) );
// Connect theme change signal
connect( qGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
connect( qGisInterface, &QgisInterface::currentThemeChanged, this, &QgsGrassPlugin::setCurrentTheme );

connect( mCanvas, SIGNAL( destinationCrsChanged() ), this, SLOT( setTransform() ) );

Expand Down Expand Up @@ -815,7 +815,7 @@ void QgsGrassPlugin::unload()
QWidget *qgis = qGisInterface->mainWindow();
disconnect( qgis, SIGNAL( projectRead() ), this, SLOT( projectRead() ) );
disconnect( qgis, SIGNAL( newProject() ), this, SLOT( newProject() ) );
disconnect( qGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
disconnect( qGisInterface, &QgisInterface::currentThemeChanged, this, &QgsGrassPlugin::setCurrentTheme );
disconnect( mCanvas, SIGNAL( destinationCrsChanged() ), this, SLOT( setTransform() ) );
disconnect( mCanvas, SIGNAL( renderComplete( QPainter * ) ), this, SLOT( postRender( QPainter * ) ) );

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/spatialquery/qgsspatialqueryplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void QgsSpatialQueryPlugin::initGui()

setCurrentTheme( QLatin1String( "" ) );
// this is called when the icon theme is changed
connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
connect( mIface, &QgisInterface::currentThemeChanged, this, &QgsSpatialQueryPlugin::setCurrentTheme );

// Add the icon to the toolbar and to the plugin menu
mIface->addVectorToolBarIcon( mSpatialQueryAction );
Expand Down

0 comments on commit b0c88f1

Please sign in to comment.