Skip to content
Permalink
Browse files

Merge pull request #1060 from ahuarte47/Issue_9308

Bug #9308: fix impossible to remove a group in the legend
  • Loading branch information
jef-n committed Jan 8, 2014
2 parents eaf1f38 + 2155dd8 commit 926a67655531a81edf09501f0293c43b2c02f03f
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/app/qgisapp.cpp
@@ -6524,23 +6524,23 @@ void QgisApp::removeLayer( bool promptConfirmation )
}

//validate selection
int numberOfRemovedLayers = mMapLegend->selectedLayers().size();
if ( numberOfRemovedLayers == 0 )
int numberOfRemovedItems = mMapLegend->selectedItems().size();
if ( numberOfRemovedItems == 0 )
{
messageBar()->pushMessage( tr( "No Layer Selected" ),
tr( "To remove layers, you must select they in the legend" ),
messageBar()->pushMessage( tr( "No Object Selected" ),
tr( "To remove objects, you must select them in the legend" ),
QgsMessageBar::INFO, messageTimeout() );
return;
}
//display a warning
if ( promptConfirmation && QMessageBox::warning( this, tr( "Remove layers" ), tr( "Remove %n layer(s)?", "number of layers to remove", numberOfRemovedLayers ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
if ( promptConfirmation && QMessageBox::warning( this, tr( "Remove objects" ), tr( "Remove %n object(s)?", "number of objects to remove", numberOfRemovedItems ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{
return;
}

mMapLegend->removeSelectedLayers();

showStatusMessage( tr( "%n layer(s) removed.", "number of layers removed", numberOfRemovedLayers ) );
showStatusMessage( tr( "%n object(s) removed.", "number of objects removed", numberOfRemovedItems ) );

mMapCanvas->refresh();
}

0 comments on commit 926a676

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