Skip to content

Commit

Permalink
Don't force users to make a choice in the datum transform dialog
Browse files Browse the repository at this point in the history
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 qgis#34234

(cherry picked from commit 644a552)
  • Loading branch information
nyalldawson committed Feb 10, 2020
1 parent bfd6ebc commit 60ba6fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsdatumtransformtablewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsdatumtransformdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsdatumtransformdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 60ba6fb

Please sign in to comment.