File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -156,11 +156,15 @@ void QgsMapThemes::applyState( const QString &presetName )
156
156
157
157
void QgsMapThemes::removeCurrentPreset ()
158
158
{
159
- Q_FOREACH ( QAction *a, mMenuPresetActions )
159
+ for ( QAction *actionPreset : qgis::as_const ( mMenuPresetActions ) )
160
160
{
161
- if ( a ->isChecked () )
161
+ if ( actionPreset ->isChecked () )
162
162
{
163
- QgsProject::instance ()->mapThemeCollection ()->removeMapTheme ( a->text () );
163
+ int res = QMessageBox::question ( mMenu , tr ( " Remove Theme" ),
164
+ trUtf8 ( " Are you sure you want to remove the existing theme “%1”?" ).arg ( actionPreset->text () ),
165
+ QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
166
+ if ( res == QMessageBox::Yes )
167
+ QgsProject::instance ()->mapThemeCollection ()->removeMapTheme ( actionPreset->text () );
164
168
break ;
165
169
}
166
170
}
You can’t perform that action at this time.
0 commit comments