Skip to content
Permalink
Browse files

#9308: enable remove groups in the legend

  • Loading branch information
ahuarte47 committed Jan 7, 2014
1 parent 2daca28 commit 2155dd8c3df3e7d505ca18b9ffac9cca006ba114
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 2155dd8

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