mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
When the custom projection dialog is blocked from closing due to an invalid projection, automatically
select that projection in the list for the user
This commit is contained in:
parent
aa0b9b0547
commit
c24f79da26
@ -405,6 +405,19 @@ void QgsCustomProjectionDialog::buttonBox_accepted()
|
||||
CRS.createFromProj4( mCustomCRSparameters[i] );
|
||||
if ( !CRS.isValid() )
|
||||
{
|
||||
// auto select the invalid CRS row
|
||||
for ( int row = 0; row < leNameList->model()->rowCount(); ++row )
|
||||
{
|
||||
if ( leNameList->model()->data( leNameList->model()->index( row, QgisCrsNameColumn ) ).toString() == mCustomCRSnames[i]
|
||||
&& leNameList->model()->data( leNameList->model()->index( row, QgisCrsParametersColumn ) ).toString() == mCustomCRSparameters[i] )
|
||||
{
|
||||
//leNameList_currentItemChanged( leNameList->invisibleRootItem()->child( row ), leNameList->currentItem() );
|
||||
leNameList->setCurrentItem( leNameList->invisibleRootItem()->child( row ) );
|
||||
//leNameList->selectionModel()->select( leNameList->model()->index( row, 0 ), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QMessageBox::warning( this, tr( "Custom Coordinate Reference System" ),
|
||||
tr( "The proj4 definition of '%1' is not valid." ).arg( mCustomCRSnames[i] ) );
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user