Skip to content

Commit

Permalink
#9308: enable remove groups in the legend
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 committed Jan 7, 2014
1 parent 2daca28 commit 2155dd8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/qgisapp.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit 2155dd8

Please sign in to comment.