Skip to content
Permalink
Browse files
Add legend icon for editable layers with unsaved edits
  • Loading branch information
dakcarto committed Dec 2, 2012
1 parent eb5ba34 commit bba75a87b75426ea0b3924dabde7532799a634e8
@@ -185,6 +185,7 @@
<file>themes/default/mIconDbSchema.png</file>
<file>themes/default/mIconDelete.png</file>
<file>themes/default/mIconEditable.png</file>
<file>themes/default/mIconEditableEdits.png</file>
<file>themes/default/mIconExpand.png</file>
<file>themes/default/mIconFavourites.png</file>
<file>themes/default/mIconFirst.png</file>
@@ -384,6 +385,7 @@
<file>themes/gis/mActionZoomToSelected.png</file>
<file>themes/gis/mIconClose.png</file>
<file>themes/gis/mIconEditable.png</file>
<file>themes/gis/mIconEditableEdits.png</file>
<file>themes/gis/mIconLineLayer.png</file>
<file>themes/gis/mIconPointLayer.png</file>
<file>themes/gis/mIconPolygonLayer.png</file>
Binary file not shown.
Binary file not shown.
@@ -335,7 +335,16 @@ void QgsLegendLayer::updateIcon()
//editable
if ( theLayer->isEditable() )
{
QPixmap myPixmap = QgsApplication::getThemePixmap( "/mIconEditable.png" );
QPixmap myPixmap;
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer *>( theLayer );
if ( vlayer->isModified() )
{
myPixmap = QgsApplication::getThemePixmap( "/mIconEditableEdits.png" );
}
else
{
myPixmap = QgsApplication::getThemePixmap( "/mIconEditable.png" );
}
// use editable icon instead of the layer's type icon
newIcon = myPixmap;

@@ -606,6 +615,7 @@ void QgsLegendLayer::updateAfterLayerModification( bool onlyGeomChanged )

if ( onlyGeomChanged )
{
updateIcon();
return;
}

1 comment on commit bba75a8

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa commented on bba75a8 Dec 2, 2012

Very nice !

Thanks !

Please sign in to comment.