Skip to content
Permalink
Browse files

Applied patch from Aaron for ticket #572

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7683 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Nov 29, 2007
1 parent 16a0c64 commit c56cbddbdd0c424666163eb8ace3db6861ca34b1
@@ -650,7 +650,7 @@ void QgsLegend::legendLayerShowProperties()
else
{
rlp = new QgsRasterLayerProperties(ml);
connect(rlp, SIGNAL(refreshLegend(QString)), this, SLOT(refreshLayerSymbology(QString)));
connect(rlp, SIGNAL(refreshLegend(QString,bool)), this, SLOT(refreshLayerSymbology(QString,bool)));
}
rlp->exec();
delete rlp; // delete since dialog cannot be reused without updating code
@@ -667,7 +667,7 @@ void QgsLegend::legendLayerShowProperties()
else
{
vlp = new QgsVectorLayerProperties(vlayer);
connect(vlp, SIGNAL(refreshLegend(QString)), this, SLOT(refreshLayerSymbology(QString)));
connect(vlp, SIGNAL(refreshLegend(QString,bool)), this, SLOT(refreshLayerSymbology(QString,bool)));
}
vlp->exec();
delete vlp; // delete since dialog cannot be reused without updating code
@@ -1405,7 +1405,7 @@ std::deque<QString> QgsLegend::layerIDs()
}


void QgsLegend::refreshLayerSymbology(QString key)
void QgsLegend::refreshLayerSymbology(QString key, bool expandItem)
{
QgsLegendLayer* theLegendLayer = findLegendLayer(key);
if(!theLegendLayer)
@@ -1421,7 +1421,10 @@ void QgsLegend::refreshLayerSymbology(QString key)
//restore the current item again
setCurrentItem(theCurrentItem);
adjustIconSize();
setItemExpanded(theLegendLayer, true);//make sure the symbology items are visible
if (expandItem)
{
setItemExpanded(theLegendLayer, true);//make sure the symbology items are visible
}
}


@@ -188,7 +188,7 @@ public slots:
void setMapCanvas(QgsMapCanvas * canvas){mMapCanvas = canvas;}

/**Updates symbology items for a layer*/
void refreshLayerSymbology(QString key);
void refreshLayerSymbology(QString key, bool expandItem = true);

/*!
* Slot called to clear the tree of all items
@@ -431,7 +431,7 @@ void QgsRasterLayerProperties::apply()
pixmapThumbnail->setPixmap(myQPixmap);

// update symbology
emit refreshLegend(rasterLayer->getLayerID());
emit refreshLegend(rasterLayer->getLayerID(), false);

//make sure the layer is redrawn
rasterLayer->triggerRepaint();
@@ -64,7 +64,7 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
signals:

/** emitted when changes to layer were saved to update legend */
void refreshLegend(QString layerID);
void refreshLegend(QString layerID, bool expandItem);


private:
@@ -312,7 +312,7 @@ void QgsVectorLayerProperties::apply()
layer->setTransparency(static_cast < unsigned int >(255 - sliderTransparency->value()));

// update symbology
emit refreshLegend(layer->getLayerID());
emit refreshLegend(layer->getLayerID(), false);

layer->triggerRepaint();

@@ -67,7 +67,7 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
signals:

/** emitted when changes to layer were saved to update legend */
void refreshLegend(QString layerID);
void refreshLegend(QString layerID, bool expandItem);

protected:
QgsVectorLayer *layer;

0 comments on commit c56cbdd

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