Skip to content

Commit

Permalink
Merge pull request #1060 from ahuarte47/Issue_9308
Browse files Browse the repository at this point in the history
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 926a676
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 926a676

Please sign in to comment.