Skip to content
Permalink
Browse files

Merge pull request #8735 from m-kuhn/crs_selector_optimized_space

Optimize space on CRS selection tab
  • Loading branch information
m-kuhn committed Dec 23, 2018
2 parents f301f94 + 59cfa50 commit 05a82d92ad5857fd0c5e389a33ed4221e8905627
@@ -277,7 +277,6 @@ void QgsProjectionSelectionTreeWidget::applySelection( int column, QString value
lstCoordinateSystems->clearSelection();
lstRecent->clearSelection();
teProjection->clear();
teSelected->clear();
}
}

@@ -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 );
@@ -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();
}
}
@@ -872,7 +869,6 @@ void QgsProjectionSelectionTreeWidget::updateFilter()
{
( *itr )->setSelected( false );
teProjection->clear();
teSelected->clear();
}
}
else if ( ( *itr )->text( NameColumn ).contains( re )
@@ -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;
@@ -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()
@@ -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">
@@ -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.
You can’t perform that action at this time.