Skip to content

Commit

Permalink
Ask for confirmation before clearing the list
Browse files Browse the repository at this point in the history
  • Loading branch information
YoannQDQ committed Apr 24, 2023
1 parent 3852bd4 commit 1934a62
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/gui/qgsprojectionselectiontreewidget.cpp
Expand Up @@ -1117,6 +1117,19 @@ void QgsProjectionSelectionTreeWidget::showDBMissingWarning( const QString &file

void QgsProjectionSelectionTreeWidget::clearRecentCrs()
{
// If the list is empty, there is nothing to do
if ( lstRecent->topLevelItemCount() == 0 )
{
return;
}

// Ask for confirmation
if ( QMessageBox::question( this, tr( "Clear Recent CRS" ),
tr( "Are you sure you want to clear the list of recently used coordinate reference system?" ),
QMessageBox::Yes | QMessageBox::No ) != QMessageBox::Yes )
{
return;
}
QgsCoordinateReferenceSystem::clearRecentCoordinateReferenceSystems();
lstRecent->clear();
}
Expand Down

0 comments on commit 1934a62

Please sign in to comment.