Skip to content
Permalink
Browse files

Don't force users to make a choice in the datum transform dialog

It's possible to get a situation where none of the options can be
selected, because they all require a grid which isn't available on
the system. So always allow users to close the dialog to dismiss it
(which has the same effect as picking the default selection from
the dialog when possible, or giving null transforms if NO transforms
are available at all...)

Fixes #34234

(cherry picked from commit 644a552)
  • Loading branch information
nyalldawson committed Feb 4, 2020
1 parent d32d539 commit 7d33f8cf43e2d079684c09bd0b51a1a5dda2e136
@@ -291,7 +291,7 @@ void QgsDatumTransformTableWidget::editDatumTransform()
}

#if PROJ_VERSION_MAJOR>=6
if ( sourceCrs.isValid() && destinationCrs.isValid() && !proj.isEmpty() )
if ( sourceCrs.isValid() && destinationCrs.isValid() )
#else
if ( sourceCrs.isValid() && destinationCrs.isValid() &&
( sourceTransform != -1 || destinationTransform != -1 ) )
@@ -44,7 +44,7 @@ bool QgsDatumTransformDialog::run( const QgsCoordinateReferenceSystem &sourceCrs
return true;
}

QgsDatumTransformDialog dlg( sourceCrs, destinationCrs, false, true, true, qMakePair( -1, -1 ), parent, nullptr, QString(), mapCanvas );
QgsDatumTransformDialog dlg( sourceCrs, destinationCrs, false, true, false, qMakePair( -1, -1 ), parent, nullptr, QString(), mapCanvas );
if ( !windowTitle.isEmpty() )
dlg.setWindowTitle( windowTitle );

@@ -76,7 +76,7 @@ class GUI_EXPORT QgsDatumTransformDialog : public QDialog, private Ui::QgsDatumT
QgsMapCanvas *mapCanvas = nullptr,
const QString &windowTitle = QString() );

// TODO QGIS 4.0 - remove selectedDatumTransform
// TODO QGIS 4.0 - remove selectedDatumTransform, forceChoice

/**
* Constructor for QgsDatumTransformDialog.

0 comments on commit 7d33f8c

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