Navigation Menu

Skip to content

Commit

Permalink
Don't select not-available operations by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 3, 2019
1 parent 4bf6e8f commit c5c7d78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/qgsdatumtransformdialog.cpp
Expand Up @@ -150,7 +150,7 @@ void QgsDatumTransformDialog::load( QPair<int, int> selectedDatumTransforms, con
Q_UNUSED( selectedDatumTransforms )
for ( const QgsDatumTransform::TransformDetails &transform : qgis::as_const( mDatumTransforms ) )
{
bool itemDisabled = false;
bool itemDisabled = !transform.isAvailable;

std::unique_ptr< QTableWidgetItem > item = qgis::make_unique< QTableWidgetItem >();
item->setData( ProjRole, transform.proj );
Expand All @@ -166,15 +166,15 @@ void QgsDatumTransformDialog::load( QPair<int, int> selectedDatumTransforms, con
item->setForeground( QBrush( QColor( 0, 120, 0 ) ) );
}

if ( preferredInitialRow < 0 )
if ( preferredInitialRow < 0 && transform.isAvailable )
{
// try to select a "preferred" entry by default
preferredInitialRow = row;
}

const QString toolTipString = QStringLiteral( "<b>%1</b><p>%2</p>" ).arg( transform.name, transform.proj );
item->setToolTip( toolTipString );
if ( !transform.isAvailable )
if ( itemDisabled )
{
item->setFlags( Qt::NoItemFlags );
}
Expand Down

0 comments on commit c5c7d78

Please sign in to comment.