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 bba75a8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
@@ -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>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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
Copy link
Member

@slarosa slarosa commented on bba75a8 Dec 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice !

Thanks !

Please sign in to comment.