Skip to content
Permalink
Browse files
-Fix for bugs introduced by patch attached to ticket #1683
-Closes ticket #2885

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14033 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ersts committed Aug 9, 2010
1 parent 82c2435 commit 801f93c3ac5056c3aea18a5a851021bf8450dba3
Showing with 42 additions and 13 deletions.
  1. +42 −13 src/app/qgsrasterlayerproperties.cpp
@@ -467,7 +467,7 @@ void QgsRasterLayerProperties::setMinimumMaximumEstimateWarning()
*/
void QgsRasterLayerProperties::sync()
{
QgsDebugMsg( "called." );
QSettings myQSettings;
QgsDebugMsg( "sync populate symbology tab" );
/*
* Symbology Tab
@@ -656,19 +656,28 @@ void QgsRasterLayerProperties::sync()
cboGray->setCurrentIndex( cboGray->findText( mRasterLayer->grayBandName() ) );

//set the stdDevs and min max values
mDefaultStandardDeviation = myQSettings.value( "/Raster/defaultStandardDeviation", 2.0 ).toDouble();
if ( mRasterLayerIsGdal && rbtnThreeBand->isChecked() )
{
mRGBMinimumMaximumEstimated = mRasterLayer->isRGBMinimumMaximumEstimated();
if ( mRasterLayer->hasUserDefinedRGBMinimumMaximum() )
{
sboxThreeBandStdDev->setValue( 0.0 );
sboxThreeBandStdDev->setValue( mDefaultStandardDeviation );
rbtnThreeBandStdDev->setChecked( false );
rbtnThreeBandMinMax->setChecked( true );
}
else
{
sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviations() );
rbtnThreeBandStdDev->setChecked( true );
if ( mRasterLayer->standardDeviations() == 0.0 )
{
sboxThreeBandStdDev->setValue( mDefaultStandardDeviation );
rbtnThreeBandStdDev->setChecked( false );
}
else
{
rbtnThreeBandStdDev->setChecked( true );
}
rbtnThreeBandMinMax->setChecked( false );
}

@@ -700,14 +709,22 @@ void QgsRasterLayerProperties::sync()
mGrayMinimumMaximumEstimated = mRasterLayer->isGrayMinimumMaximumEstimated();
if ( mRasterLayer->hasUserDefinedGrayMinimumMaximum() )
{
sboxSingleBandStdDev->setValue( 0.0 );
sboxSingleBandStdDev->setValue( mDefaultStandardDeviation );
rbtnSingleBandStdDev->setChecked( false );
rbtnSingleBandMinMax->setChecked( true );
}
else
{
sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviations() );
rbtnSingleBandStdDev->setChecked( true );
if ( mRasterLayer->standardDeviations() == 0.0 )
{
sboxSingleBandStdDev->setValue( mDefaultStandardDeviation );
rbtnSingleBandStdDev->setChecked( false );
}
else
{
rbtnSingleBandStdDev->setChecked( true );
}
rbtnSingleBandMinMax->setChecked( false );
}

@@ -748,7 +765,6 @@ void QgsRasterLayerProperties::sync()
}

//Display the current default contrast enhancement algorithm
QSettings myQSettings;
mDefaultRedBand = myQSettings.value( "/Raster/defaultRedBand", 1 ).toInt();
mDefaultGreenBand = myQSettings.value( "/Raster/defaultGreenBand", 2 ).toInt();
mDefaultBlueBand = myQSettings.value( "/Raster/defaultBlueBand", 3 ).toInt();
@@ -776,10 +792,6 @@ void QgsRasterLayerProperties::sync()
labelDefaultContrastEnhancementAlgorithm->setText( tr( "No Stretch" ) );
}

mDefaultStandardDeviation = myQSettings.value( "/Raster/defaultStandardDeviation", 1.0 ).toDouble();
sboxThreeBandStdDev->setValue( mDefaultStandardDeviation );


QgsDebugMsg( "populate transparency tab" );
/*
* Transparent Pixel Tab
@@ -2404,15 +2416,23 @@ void QgsRasterLayerProperties::on_rbtnSingleBand_toggled( bool theState )

if ( mRasterLayer->hasUserDefinedGrayMinimumMaximum() )
{
sboxSingleBandStdDev->setValue( 0.0 );
sboxSingleBandStdDev->setValue( mDefaultStandardDeviation );
rbtnSingleBandMinMax->setChecked( true );
leGrayMin->setText( QString::number( mRasterLayer->minimumValue( cboGray->currentText() ) ) );
leGrayMax->setText( QString::number( mRasterLayer->maximumValue( cboGray->currentText() ) ) );
}
else
{
sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviations() );
rbtnSingleBandStdDev->setChecked( true );
if ( mRasterLayer->standardDeviations() == 0.0 )
{
sboxSingleBandStdDev->setValue( mDefaultStandardDeviation );
rbtnSingleBandStdDev->setChecked( false );
}
else
{
rbtnSingleBandStdDev->setChecked( true );
}
}

// Populate transparency table with single value transparency pixels
@@ -2493,7 +2513,16 @@ void QgsRasterLayerProperties::on_rbtnThreeBand_toggled( bool theState )
else
{
sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviations() );
rbtnThreeBandStdDev->setChecked( true );
if ( mRasterLayer->standardDeviations() == 0.0 )
{
sboxThreeBandStdDev->setValue( mDefaultStandardDeviation );
rbtnThreeBandStdDev->setChecked( false );
}
else
{
rbtnThreeBandStdDev->setChecked( true );
}

}

// Populate transparency table with single value transparency pixels

0 comments on commit 801f93c

Please sign in to comment.