Skip to content
Permalink
Browse files
Check for adding a layer without CRS
When (re)defining the geometry type, the default CRS is empty.
There was no check for it, resulting in a layer without a CRS.
That seems not very user friendly. So I choose to check for it and
ask the user if she really wants that.
  • Loading branch information
rduivenvoorde authored and nyalldawson committed Sep 6, 2021
1 parent 5c35539 commit 4f4fbca5f8043952cfe5fa082dc986a39ae567bc
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/providers/virtual/qgsvirtuallayersourceselect.cpp
@@ -235,6 +235,19 @@ bool QgsVirtualLayerSourceSelect::preFlight()
}
else
{
if ( mGeometryRadio->isChecked() && mCRS->text().isEmpty() )
{
// warning when the geometryRadio is checked, but the user did not set a proper crs
// old implementation did NOT set a crs then...
if ( QMessageBox::Yes == QMessageBox::question( nullptr, tr( "Test Virtual Layer " ), tr( "No CRS defined, are you sure you want to create a layer without a crs?" ), QMessageBox::Yes | QMessageBox::No ) )
{
return true;
}
else
{
return false;
}
}
return true;
}
}

0 comments on commit 4f4fbca

Please sign in to comment.