Skip to content
Permalink
Browse files

Enable plugins to dynamically change their theme if it is changed in …

…app props. Its up to each plugin to individually support this

git-svn-id: http://svn.osgeo.org/qgis/trunk@10393 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Mar 21, 2009
1 parent 1e7c7e8 commit 014692f28f9ea78cca655a2e5c5a82fbc92f21b7
@@ -1485,6 +1485,7 @@ void QgisApp::setTheme( QString theThemeName )
{
mComposer->setupTheme();
}
emit currentThemeChanged( theThemeName );
}

void QgisApp::setupConnections()
@@ -599,6 +599,12 @@ class QgisApp : public QMainWindow
//! emitted when a new bookmark is added
void bookmarkAdded();

/** Signal emitted when the current theme is changed so plugins
* can change there tool button icons.
* @note This was added in QGIS 1.1
*/
void currentThemeChanged ( QString );

private:
/** This method will open a dialog so the user can select the sublayers
* to load
@@ -36,6 +36,8 @@ QgisAppInterface::QgisAppInterface( QgisApp * _qgis )
// connect signals
connect( qgis->legend(), SIGNAL( currentLayerChanged( QgsMapLayer * ) ),
this, SIGNAL( currentLayerChanged( QgsMapLayer * ) ) );
connect( qgis, SIGNAL( currentThemeChanged( QString ) ),
this, SIGNAL( currentThemeChanged( QString ) ) );

}

@@ -234,6 +234,9 @@ class QgisAppInterface : public QgisInterface
virtual QAction *actionHelpSeparator2();
virtual QAction *actionAbout();

signals:
void currentThemeChanged( QString );

private:

/// QgisInterface aren't copied
@@ -83,6 +83,7 @@ void CoordinateCapture::initGui()
mCrs.createFromSrsId( GEOCRS_ID ); // initialize the CRS object

connect( mQGisIface->mapCanvas()->mapRenderer(), SIGNAL( destinationSrsChanged() ), this, SLOT( setSourceCrs() ) );
connect( mQGisIface, SIGNAL( currentThemeChanged ( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );

setSourceCrs(); //set up the source CRS
mTransform.setDestCRS( mCrs ); // set the CRS in the transform
@@ -251,6 +252,11 @@ void CoordinateCapture::unload()
delete mQActionPointer;
}

void CoordinateCapture::setCurrentTheme ( QString theThemeName )
{
qDebug (" Current theme changed \n\n\n\n\n" );
mQActionPointer->setIcon( QIcon());
}

//////////////////////////////////////////////////////////////////////////
//
@@ -103,6 +103,8 @@ class CoordinateCapture: public QObject, public QgisPlugin
void copy();
//! called when the project's CRS is changed
void setSourceCrs();
//! update the plugins theme when the app tells us its theme is changed
void setCurrentTheme ( QString theThemeName );

private:
//! Container for the coordinate info

0 comments on commit 014692f

Please sign in to comment.
You can’t perform that action at this time.