Skip to content

Commit

Permalink
Merge pull request #8735 from m-kuhn/crs_selector_optimized_space
Browse files Browse the repository at this point in the history
Optimize space on CRS selection tab
  • Loading branch information
m-kuhn committed Dec 23, 2018
2 parents f301f94 + 59cfa50 commit 05a82d9
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 209 deletions.
27 changes: 12 additions & 15 deletions src/gui/qgsprojectionselectiontreewidget.cpp
Expand Up @@ -277,7 +277,6 @@ void QgsProjectionSelectionTreeWidget::applySelection( int column, QString value
lstCoordinateSystems->clearSelection();
lstRecent->clearSelection();
teProjection->clear();
teSelected->clear();
}
}

Expand Down Expand Up @@ -772,7 +771,6 @@ void QgsProjectionSelectionTreeWidget::lstCoordinateSystems_currentItemChanged(
// Found a real CRS
emit crsSelected();

teSelected->setText( selectedName() );
updateBoundsPreview();

QList<QTreeWidgetItem *> nodes = lstRecent->findItems( current->text( QgisCrsIdColumn ), Qt::MatchExactly, QgisCrsIdColumn );
Expand All @@ -790,10 +788,9 @@ void QgsProjectionSelectionTreeWidget::lstCoordinateSystems_currentItemChanged(
}
else
{
// Not an CRS - remove the highlight so the user doesn't get too confused
// Not a CRS - remove the highlight so the user doesn't get too confused
current->setSelected( false );
teProjection->clear();
teSelected->clear();
lstRecent->clearSelection();
}
}
Expand Down Expand Up @@ -872,7 +869,6 @@ void QgsProjectionSelectionTreeWidget::updateFilter()
{
( *itr )->setSelected( false );
teProjection->clear();
teSelected->clear();
}
}
else if ( ( *itr )->text( NameColumn ).contains( re )
Expand Down Expand Up @@ -996,6 +992,7 @@ void QgsProjectionSelectionTreeWidget::updateBoundsPreview()
return;

QgsRectangle rect = currentCrs.bounds();
QString extentString = tr( "Extent not known" );
if ( !qgsDoubleNear( rect.area(), 0.0 ) )
{
QgsGeometry geom;
Expand All @@ -1017,22 +1014,22 @@ void QgsProjectionSelectionTreeWidget::updateBoundsPreview()
mAreaCanvas->setExtent( extent );
mAreaCanvas->refresh();
mPreviewBand->show();
QString extentString = tr( "Extent: %1, %2, %3, %4" )
.arg( rect.xMinimum(), 0, 'f', 2 )
.arg( rect.yMinimum(), 0, 'f', 2 )
.arg( rect.xMaximum(), 0, 'f', 2 )
.arg( rect.yMaximum(), 0, 'f', 2 );
QString proj4String = tr( "Proj4: %1" ).arg( selectedProj4String() );
teProjection->setText( extentString + "\n" + proj4String );
extentString = QStringLiteral( "%1, %2, %3, %4" )
.arg( rect.xMinimum(), 0, 'f', 2 )
.arg( rect.yMinimum(), 0, 'f', 2 )
.arg( rect.xMaximum(), 0, 'f', 2 )
.arg( rect.yMaximum(), 0, 'f', 2 );

}
else
{
mPreviewBand->hide();
mAreaCanvas->zoomToFullExtent();
QString extentString = tr( "Extent: Extent not known" );
QString proj4String = tr( "Proj4: %1" ).arg( selectedProj4String() );
teProjection->setText( extentString + "\n" + proj4String );
}

QString extentHtml = QStringLiteral( "<dt><b>%1</b></dt><dd>%2</dd>" ).arg( tr( "Extent" ), extentString );
QString proj4String = tr( "<dt><b>%1</b></dt><dd>%2</dd>" ).arg( tr( "Proj4" ), selectedProj4String() );
teProjection->setText( QStringLiteral( "<h3>%1</h3><dl>" ).arg( selectedName() ) + extentHtml + proj4String + QLatin1String( "</dl>" ) );
}

QStringList QgsProjectionSelectionTreeWidget::authorities()
Expand Down
43 changes: 43 additions & 0 deletions src/ui/qgsdatumtransformtablewidgetbase.ui
Expand Up @@ -14,6 +14,18 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QToolButton" name="mAddButton">
<property name="text">
Expand Down Expand Up @@ -67,6 +79,37 @@
</widget>
<resources>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
</resources>
<connections/>
</ui>

0 comments on commit 05a82d9

Please sign in to comment.