Skip to content
Permalink
Browse files

Allow removing multiple ramps at once in style manager

...previously multiple ramps could be selected, but only the
first would be removed
  • Loading branch information
nyalldawson committed Jan 7, 2016
1 parent f6ed453 commit 32e2849c0b22b95e3daf1e0841776b74886b16f4
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/gui/symbology-ng/qgsstylev2managerdialog.cpp
@@ -732,16 +732,20 @@ bool QgsStyleV2ManagerDialog::removeSymbol()

bool QgsStyleV2ManagerDialog::removeColorRamp()
{
QString rampName = currentItemName();
if ( rampName.isEmpty() )
return false;
QModelIndexList indexes = listItems->selectionModel()->selectedIndexes();
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Confirm removal" ),
QString( tr( "Do you really want to remove the colorramp '%1'?" ) ).arg( rampName ),
QString( tr( "Do you really want to remove %n ramps(s)?", nullptr, indexes.count() ) ),
QMessageBox::Yes,
QMessageBox::No ) )
return false;

mStyle->removeColorRamp( rampName );
Q_FOREACH ( const QModelIndex& index, indexes )
{
QString rampName = index.data().toString();
// delete from style and update list
if ( !rampName.isEmpty() )
mStyle->removeColorRamp( rampName );
}
mModified = true;
return true;
}

0 comments on commit 32e2849

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