Skip to content
Permalink
Browse files

[raster] improve multiband color widget's band selection

  • Loading branch information
nirvn committed Dec 6, 2016
1 parent 5db654b commit a52a1e9f86c45bd1b9c5439570ad6df7687198a1
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/gui/raster/qgsmultibandcolorrendererwidget.cpp
@@ -306,9 +306,19 @@ void QgsMultiBandColorRendererWidget::setFromRenderer( const QgsRasterRenderer*
}
else
{
mRedBandComboBox->setCurrentIndex( mRedBandComboBox->findText( tr( "Red" ) ) );
mGreenBandComboBox->setCurrentIndex( mGreenBandComboBox->findText( tr( "Green" ) ) );
mBlueBandComboBox->setCurrentIndex( mBlueBandComboBox->findText( tr( "Blue" ) ) );
if ( mRedBandComboBox->findText( tr( "Red" ) ) > -1 && mRedBandComboBox->findText( tr( "Green" ) ) > -1 &&
mRedBandComboBox->findText( tr( "Blue" ) ) > -1 )
{
mRedBandComboBox->setCurrentIndex( mRedBandComboBox->findText( tr( "Red" ) ) );
mGreenBandComboBox->setCurrentIndex( mGreenBandComboBox->findText( tr( "Green" ) ) );
mBlueBandComboBox->setCurrentIndex( mBlueBandComboBox->findText( tr( "Blue" ) ) );
}
else
{
mRedBandComboBox->setCurrentIndex( mRedBandComboBox->count() > 1 ? 1 : 0 );
mGreenBandComboBox->setCurrentIndex( mRedBandComboBox->count() > 2 ? 2 : 0 );
mBlueBandComboBox->setCurrentIndex( mRedBandComboBox->count() > 3 ? 3 : 0 );
}
}
}

0 comments on commit a52a1e9

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