Skip to content

Commit

Permalink
Untranslatable strings and formatting of the raster min/max label
Browse files Browse the repository at this point in the history
  • Loading branch information
artfwo committed Aug 27, 2013
1 parent 2046342 commit c6e4838
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/core/raster/qgsrasterrenderer.cpp
Expand Up @@ -191,45 +191,48 @@ QString QgsRasterRenderer::minMaxOriginLabel( int theOrigin )
return tr( "User defined" ); return tr( "User defined" );
} }


QString name; QString label;
QString est_exact;
QString values;
QString extent;

if ( theOrigin & MinMaxEstimated ) if ( theOrigin & MinMaxEstimated )
{ {
name += tr( "Estimated" ); est_exact = tr( "Estimated" );
} }
else if ( theOrigin & MinMaxExact ) else if ( theOrigin & MinMaxExact )
{ {
name += tr( "Exact" ); est_exact = tr( "Exact" );
} }


name += " ";

if ( theOrigin & MinMaxMinMax ) if ( theOrigin & MinMaxMinMax )
{ {
name += tr( "min / max" ); values = tr( "min / max" );
} }
else if ( theOrigin & MinMaxCumulativeCut ) else if ( theOrigin & MinMaxCumulativeCut )
{ {
name += "cumulative cut"; values = tr( "cumulative cut" );
} }
else if ( theOrigin & MinMaxStdDev ) else if ( theOrigin & MinMaxStdDev )
{ {
name += "standard deviation"; values = tr( "standard deviation" );
} }


name += " " + tr( " of " ) + " ";

if ( theOrigin & MinMaxFullExtent ) if ( theOrigin & MinMaxFullExtent )
{ {
name += "full extent"; extent = tr( "full extent" );
} }
else if ( theOrigin & MinMaxSubExtent ) else if ( theOrigin & MinMaxSubExtent )
{ {
name += "sub extent"; extent = tr( "sub extent" );
} }


name += "."; label = QCoreApplication::translate ( "QgsRasterRenderer", "%1 %2 of %3.",

"min/max origin label in raster properties, where %1 - estimated/exact, %2 - values (min/max, stddev, etc.), %3 - extent" )
return name; .arg(est_exact)
.arg(values)
.arg(extent);
return label;
} }


int QgsRasterRenderer::minMaxOriginFromName( QString theName ) int QgsRasterRenderer::minMaxOriginFromName( QString theName )
Expand Down

0 comments on commit c6e4838

Please sign in to comment.