Skip to content

Commit b0c88f1

Browse files
committed
Add missing currentThemeChanged signal to interface
1 parent 8cf5860 commit b0c88f1

File tree

9 files changed

+14
-10
lines changed

9 files changed

+14
-10
lines changed

python/gui/qgisinterface.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ class QgisInterface : QObject
511511

512512
signals:
513513
void currentLayerChanged( QgsMapLayer *layer );
514+
void currentThemeChanged( const QString &theme );
514515
void composerOpened( QgsComposerInterface *composer );
515516
void composerWillBeClosed( QgsComposerInterface *composer );
516517
void composerClosed( QgsComposerInterface *composer );

src/app/qgisappinterface.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,6 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
494494
//! Get timeout for timed messages: default of 5 seconds
495495
virtual int messageTimeout() override;
496496

497-
signals:
498-
void currentThemeChanged( const QString & );
499-
500497
private slots:
501498

502499
void cacheloadForm( const QString &uifile );

src/gui/qgisinterface.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,12 @@ class GUI_EXPORT QgisInterface : public QObject
658658
*/
659659
void currentLayerChanged( QgsMapLayer *layer );
660660

661+
/** Signal emitted when the current \a theme is changed so plugins
662+
* can change their tool button icons.
663+
* \since QGIS 3.0
664+
*/
665+
void currentThemeChanged( const QString &theme );
666+
661667
/**
662668
* This signal is emitted when a new composer window has been opened.
663669
* \since QGIS 3.0

src/plugins/coordinate_capture/coordinatecapture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void CoordinateCapture::initGui()
9393
mCrs.createFromSrsId( GEOCRS_ID ); // initialize the CRS object
9494

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

9898
setSourceCrs(); //set up the source CRS
9999
mTransform.setDestinationCrs( mCrs ); // set the CRS in the transform

src/plugins/georeferencer/qgsgeorefplugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void QgsGeorefPlugin::initGui()
106106

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

111111
// Add to the toolbar & menu
112112
mQGisIface->addRasterToolBarIcon( mActionRunGeoref );

src/plugins/georeferencer/qgsgeorefplugingui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface *qgisInterface, QWidget *p
117117

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

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

122122
if ( s.value( QStringLiteral( "/Plugin-GeoReferencer/Config/ShowDocked" ) ).toBool() )
123123
{

src/plugins/gps_importer/qgsgpsplugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void QgsGPSPlugin::initGui()
108108
mQGisInterface->addVectorToolBarIcon( mQActionPointer );
109109

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

114114
//method defined in interface

src/plugins/grass/qgsgrassplugin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ void QgsGrassPlugin::initGui()
265265
// Set icons to current theme
266266
setCurrentTheme( QLatin1String( "" ) );
267267
// Connect theme change signal
268-
connect( qGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
268+
connect( qGisInterface, &QgisInterface::currentThemeChanged, this, &QgsGrassPlugin::setCurrentTheme );
269269

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

@@ -815,7 +815,7 @@ void QgsGrassPlugin::unload()
815815
QWidget *qgis = qGisInterface->mainWindow();
816816
disconnect( qgis, SIGNAL( projectRead() ), this, SLOT( projectRead() ) );
817817
disconnect( qgis, SIGNAL( newProject() ), this, SLOT( newProject() ) );
818-
disconnect( qGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
818+
disconnect( qGisInterface, &QgisInterface::currentThemeChanged, this, &QgsGrassPlugin::setCurrentTheme );
819819
disconnect( mCanvas, SIGNAL( destinationCrsChanged() ), this, SLOT( setTransform() ) );
820820
disconnect( mCanvas, SIGNAL( renderComplete( QPainter * ) ), this, SLOT( postRender( QPainter * ) ) );
821821

src/plugins/spatialquery/qgsspatialqueryplugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void QgsSpatialQueryPlugin::initGui()
8080

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

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

0 commit comments

Comments
 (0)