Skip to content
Permalink
Browse files

Merge pull request #5683 from Gustry/metadata_crs

fix #17456 improve CRS display in the metadata tab
  • Loading branch information
nyalldawson committed Nov 21, 2017
2 parents 5be5c1e + 59cc543 commit d62b4e9760f2b5018634d861360e30cd2f0f2ecd
@@ -2060,6 +2060,7 @@ QgsRasterDataProvider {#qgis_api_break_3_0_QgsRasterDataProvider}
- useSrcNoDataValue() has been renamed to useSourceNoDataValue()
- setUseSrcNoDataValue() has been renamed to setUseSourceNoDataValue()
- srcNoDataValue() has been renamed to sourceNoDataValue()
- metadata() was renamed to htmlMetadata()
- draw() has been removed from the interface as it was not used anywhere.
- The progress and progressUpdate signals were removed. Methods which previously emitted these
signals now accept a QgsRasterBlockFeedback argument for reporting progress updates.
@@ -96,12 +96,16 @@ QString QgsLayerMetadataFormatter::contactsSectionHtml() const
QString QgsLayerMetadataFormatter::extentSectionHtml() const
{
QString myMetadata = QStringLiteral( "<table class=\"list-view\">\n" );
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + QObject::tr( "CRS" ) + QStringLiteral( "</td><td>" ) + mMetadata.crs().authid() + QStringLiteral( " - " );
myMetadata += mMetadata.crs().description() + QStringLiteral( " - " );
if ( mMetadata.crs().isGeographic() )
myMetadata += QObject::tr( "Geographic" );
else
myMetadata += QObject::tr( "Projected" );
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + QObject::tr( "CRS" ) + QStringLiteral( "</td><td>" );
if ( mMetadata.crs().isValid() )
{
myMetadata += mMetadata.crs().authid() + QStringLiteral( " - " );
myMetadata += mMetadata.crs().description() + QStringLiteral( " - " );
if ( mMetadata.crs().isGeographic() )
myMetadata += QObject::tr( "Geographic" );
else
myMetadata += QObject::tr( "Projected" );
}
myMetadata += QLatin1String( "</td></tr>\n" );

const QgsLayerMetadata::Extent extent = mMetadata.extent();
@@ -3987,11 +3987,6 @@ QString QgsVectorLayer::htmlMetadata() const
QgsLayerMetadataFormatter htmlFormatter( metadata() );
QString myMetadata = QStringLiteral( "<html>\n<body>\n" );

// identification section
myMetadata += QStringLiteral( "<h1>" ) + tr( "Identification" ) + QStringLiteral( "</h1>\n<hr>\n" );
myMetadata += htmlFormatter.identificationSectionHtml( );
myMetadata += QLatin1String( "<br><br>\n" );

// Begin Provider section
myMetadata += QStringLiteral( "<h1>" ) + tr( "Information from provider" ) + QStringLiteral( "</h1>\n<hr>\n" );
myMetadata += QLatin1String( "<table class=\"list-view\">\n" );
@@ -4048,6 +4043,11 @@ QString QgsVectorLayer::htmlMetadata() const
// End Provider section
myMetadata += QLatin1String( "</table>\n<br><br>" );

// identification section
myMetadata += QStringLiteral( "<h1>" ) + tr( "Identification" ) + QStringLiteral( "</h1>\n<hr>\n" );
myMetadata += htmlFormatter.identificationSectionHtml( );
myMetadata += QLatin1String( "<br><br>\n" );

// extent section
myMetadata += QStringLiteral( "<h1>" ) + tr( "Extent" ) + QStringLiteral( "</h1>\n<hr>\n" );
myMetadata += htmlFormatter.extentSectionHtml( );
@@ -307,11 +307,6 @@ QString QgsRasterLayer::htmlMetadata() const
QgsLayerMetadataFormatter htmlFormatter( metadata() );
QString myMetadata = QStringLiteral( "<html>\n<body>\n" );

// Identification section
myMetadata += QStringLiteral( "<h1>" ) + tr( "Identification" ) + QStringLiteral( "</h1>\n<hr>\n" );
myMetadata += htmlFormatter.identificationSectionHtml();
myMetadata += QLatin1String( "<br><br>\n" );

// Begin Provider section
myMetadata += QStringLiteral( "<h1>" ) + tr( "Information from provider" ) + QStringLiteral( "</h1>\n<hr>\n" );
myMetadata += QLatin1String( "<table class=\"list-view\">\n" );
@@ -405,6 +400,11 @@ QString QgsRasterLayer::htmlMetadata() const
// End Provider section
myMetadata += QLatin1String( "</table>\n<br><br>" );

// Identification section
myMetadata += QStringLiteral( "<h1>" ) + tr( "Identification" ) + QStringLiteral( "</h1>\n<hr>\n" );
myMetadata += htmlFormatter.identificationSectionHtml();
myMetadata += QLatin1String( "<br><br>\n" );

// extent section
myMetadata += QStringLiteral( "<h1>" ) + tr( "Extent" ) + QStringLiteral( "</h1>\n<hr>\n" );
myMetadata += htmlFormatter.extentSectionHtml( );
@@ -414,6 +414,10 @@ void QgsMetadataWidget::setPropertiesFromLayer() const
{
selectionCrs->setCrs( mMetadata.crs() );
}
else
{
selectionCrs->setOptionVisible( QgsProjectionSelectionWidget::CrsNotSet, true );
}

// Links
const QList<QgsLayerMetadata::Link> &links = mMetadata.links();

0 comments on commit d62b4e9

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