Skip to content
Permalink
Browse files

Prompt before replacing an existing map theme

It's too easy to accidently (and unrecoverably) erase an
entire theme using the replace preset menu
  • Loading branch information
nyalldawson committed Feb 23, 2017
1 parent f5a3967 commit b1158ff91036f85e57654f9d46b0ca0197f77888
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/app/qgsmapthemes.cpp
@@ -29,7 +29,7 @@
#include "qgsnewnamedialog.h"

#include <QInputDialog>

#include <QMessageBox>

QgsMapThemes* QgsMapThemes::sInstance;

@@ -136,6 +136,12 @@ void QgsMapThemes::replaceTriggered()
if ( !actionPreset )
return;

int res = QMessageBox::question( mMenu, tr( "Replace theme" ),
tr( "Are you sure you want to replace the existing theme “%1”?" ).arg( actionPreset->text() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
if ( res != QMessageBox::Yes )
return;

//adding preset with same name is effectively a replace
addPreset( actionPreset->text() );
}

0 comments on commit b1158ff

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