Skip to content

Commit

Permalink
Applied patch for legend refresh from plugins provided by Juergen
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7296 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Oct 24, 2007
1 parent 71678cc commit 09a075b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/gui/qgisinterface.sip
Expand Up @@ -81,6 +81,9 @@ class QgisInterface : QObject
/** Return a pointer to the toolbox (where additional pages can be inserted) */
virtual QToolBox* getToolBox()=0;

/** refresh legend of a layer */
virtual void refreshLegend( QgsMapLayer * layer )=0;

signals:
/** Emited whenever current (selected) layer changes.
* The pointer to layer can be null if no layer is selected
Expand Down
8 changes: 8 additions & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -140,3 +140,11 @@ QToolBox* QgisAppInterface::getToolBox()
{
return qgis->toolBox;
}

void QgisAppInterface::refreshLegend(QgsMapLayer *l)
{
if(l && qgis && qgis->legend())
{
qgis->legend()->refreshLayerSymbology( l->getLayerID() );
}
}
2 changes: 2 additions & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -104,6 +104,8 @@ class QgisAppInterface : public QgisInterface
/** Return a pointer to the toolbox (where additional pages can be inserted) */
virtual QToolBox* getToolBox();

virtual void refreshLegend(QgsMapLayer *l);

private:

/// QgisInterface aren't copied
Expand Down
3 changes: 3 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -113,6 +113,9 @@ class GUI_EXPORT QgisInterface : public QObject
/** Return a pointer to the toolbox (where additional pages can be inserted) */
virtual QToolBox* getToolBox()=0;

/** refresh the legend of a layer */
virtual void refreshLegend(QgsMapLayer *l)=0;

signals:
/** Emited whenever current (selected) layer changes.
* The pointer to layer can be null if no layer is selected
Expand Down

0 comments on commit 09a075b

Please sign in to comment.