Skip to content
Permalink
Browse files
Add missing currentThemeChanged signal to interface
  • Loading branch information
nyalldawson committed Apr 9, 2017
1 parent 8cf5860 commit b0c88f1b80af85bd779d9665489ea6d5c8c96513
@@ -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 );
@@ -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 );
@@ -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
@@ -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
@@ -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 );
@@ -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() )
{
@@ -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
@@ -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() ) );

@@ -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 * ) ) );

@@ -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 );

0 comments on commit b0c88f1

Please sign in to comment.