Skip to content

Commit 2031ce0

Browse files
committedJan 6, 2016
[StyleManager] show confirmation messagebox before removing item(s)
1 parent 4d2d001 commit 2031ce0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/gui/symbology-ng/qgsstylev2managerdialog.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,12 @@ void QgsStyleV2ManagerDialog::removeItem()
713713
bool QgsStyleV2ManagerDialog::removeSymbol()
714714
{
715715
QModelIndexList indexes = listItems->selectionModel()->selectedIndexes();
716+
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Confirm removal" ),
717+
QString( tr( "Do you really want to remove %n symbol(s)?", nullptr, indexes.count() ) ),
718+
QMessageBox::Yes,
719+
QMessageBox::No ) )
720+
return false;
721+
716722
Q_FOREACH ( const QModelIndex& index, indexes )
717723
{
718724
QString symbolName = index.data().toString();
@@ -729,6 +735,11 @@ bool QgsStyleV2ManagerDialog::removeColorRamp()
729735
QString rampName = currentItemName();
730736
if ( rampName.isEmpty() )
731737
return false;
738+
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Confirm removal" ),
739+
QString( tr( "Do you really want to remove the colorramp '%1'?" ) ).arg( rampName ),
740+
QMessageBox::Yes,
741+
QMessageBox::No ) )
742+
return false;
732743

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

0 commit comments

Comments
 (0)
Please sign in to comment.