Skip to content
Permalink
Browse files

[StyleManager] show confirmation messagebox before removing item(s)

  • Loading branch information
SebDieBln committed Jan 6, 2016
1 parent 4d2d001 commit 2031ce0208f9c051f38418aaa60ca8cc8e9ff13a
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/gui/symbology-ng/qgsstylev2managerdialog.cpp
@@ -713,6 +713,12 @@ void QgsStyleV2ManagerDialog::removeItem()
bool QgsStyleV2ManagerDialog::removeSymbol()
{
QModelIndexList indexes = listItems->selectionModel()->selectedIndexes();
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Confirm removal" ),
QString( tr( "Do you really want to remove %n symbol(s)?", nullptr, indexes.count() ) ),
QMessageBox::Yes,
QMessageBox::No ) )
return false;

Q_FOREACH ( const QModelIndex& index, indexes )
{
QString symbolName = index.data().toString();
@@ -729,6 +735,11 @@ bool QgsStyleV2ManagerDialog::removeColorRamp()
QString rampName = currentItemName();
if ( rampName.isEmpty() )
return false;
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Confirm removal" ),
QString( tr( "Do you really want to remove the colorramp '%1'?" ) ).arg( rampName ),
QMessageBox::Yes,
QMessageBox::No ) )
return false;

mStyle->removeColorRamp( rampName );
mModified = true;

0 comments on commit 2031ce0

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