Skip to content
Permalink
Browse files

allow to have single dest/source transform in dialog

  • Loading branch information
3nids committed Dec 18, 2017
1 parent 52f6701 commit 3978626310a3b5980c460ad683975c352a4c4b44
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/gui/qgsdatumtransformdialog.cpp
@@ -78,7 +78,7 @@ void QgsDatumTransformDialog::load( const QPair<int, int> &selectedDatumTransfor
bool itemDisabled = false;
bool itemHidden = false;

if ( transform.sourceTransformId == -1 || transform.destinationTransformId == -1 )
if ( transform.sourceTransformId == -1 && transform.destinationTransformId == -1 )
continue;

for ( int i = 0; i < 2; ++i )
@@ -157,8 +157,8 @@ void QgsDatumTransformDialog::load( const QPair<int, int> &selectedDatumTransfor

void QgsDatumTransformDialog::setOKButtonEnabled()
{
QTableWidgetItem *item = mDatumTransformTableWidget->currentItem();
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( mSourceCrs.isValid() && mDestinationCrs.isValid() && item );
int row = mDatumTransformTableWidget->currentRow();
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( mSourceCrs.isValid() && mDestinationCrs.isValid() && row >= 0 );
}

QgsDatumTransformDialog::~QgsDatumTransformDialog()
@@ -190,8 +190,10 @@ QPair<QPair<QgsCoordinateReferenceSystem, int>, QPair<QgsCoordinateReferenceSyst

if ( row >= 0 )
{
sdt.first.second = mDatumTransformTableWidget->item( row, 0 )->data( Qt::UserRole ).toInt();
sdt.second.second = mDatumTransformTableWidget->item( row, 1 )->data( Qt::UserRole ).toInt();
QTableWidgetItem *srcItem = mDatumTransformTableWidget->item( row, 0 );
sdt.first.second = srcItem ? srcItem->data( Qt::UserRole ).toInt() : -1;
QTableWidgetItem *destItem = mDatumTransformTableWidget->item( row, 1 );
sdt.second.second = destItem ? destItem->data( Qt::UserRole ).toInt() : -1;
}
else
{

0 comments on commit 3978626

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