@@ -282,7 +282,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
282
282
283
283
QSettings settings;
284
284
restoreGeometry ( settings.value ( " /Windows/RasterLayerProperties/geometry" ).toByteArray () );
285
- listWidget-> setCurrentRow ( settings.value ( " /Windows/RasterLayerProperties/row" ).toInt () );
285
+ tabBar-> setCurrentIndex ( settings.value ( " /Windows/RasterLayerProperties/row" ).toInt () );
286
286
287
287
setWindowTitle ( tr ( " Layer Properties - %1" ).arg ( lyr->name () ) );
288
288
int myHistogramTab = 6 ;
@@ -297,7 +297,7 @@ QgsRasterLayerProperties::~QgsRasterLayerProperties()
297
297
{
298
298
QSettings settings;
299
299
settings.setValue ( " /Windows/RasterLayerProperties/geometry" , saveGeometry () );
300
- settings.setValue ( " /Windows/RasterLayerProperties/row" , listWidget-> currentRow () );
300
+ settings.setValue ( " /Windows/RasterLayerProperties/row" , tabBar-> currentIndex () );
301
301
if ( mPixelSelectorTool )
302
302
{
303
303
delete mPixelSelectorTool ;
@@ -529,26 +529,15 @@ void QgsRasterLayerProperties::sync()
529
529
530
530
if ( mRasterLayerIsWms )
531
531
{
532
- QListWidgetItem *symbologyItem = listWidget->item ( 0 );
533
- QListWidgetItem *colormapItem = listWidget->item ( 2 );
534
- QListWidgetItem *metadataItem = listWidget->item ( 4 );
535
- QListWidgetItem *pyramidItem = listWidget->item ( 5 );
536
- QListWidgetItem *histogramItem = listWidget->item ( 6 );
537
-
538
- delete symbologyItem;
539
- delete colormapItem;
540
- delete pyramidItem;
541
- delete histogramItem;
542
-
543
- tabBar->removeWidget ( tabPageSymbology );
544
- tabBar->removeWidget ( tabPageColormap );
545
- tabBar->removeWidget ( tabPagePyramids );
546
- tabBar->removeWidget ( tabPageHistogram );
532
+ delete tabPageSymbology;
533
+ delete tabPageColormap;
534
+ delete tabPagePyramids;
535
+ delete tabPageHistogram;
547
536
548
537
gboxNoDataValue->setEnabled ( false );
549
538
gboxCustomTransparency->setEnabled ( false );
550
539
551
- listWidget-> setCurrentItem ( metadataItem );
540
+ tabBar-> setCurrentWidget ( tabPageMetadata );
552
541
}
553
542
554
543
#if 0
@@ -601,29 +590,32 @@ void QgsRasterLayerProperties::sync()
601
590
cboxColorMap->setCurrentIndex ( cboxColorMap->findText ( tr ( " User Defined" ) ) );
602
591
}
603
592
}
604
- else
593
+ else if ( ! mRasterLayerIsWms )
605
594
{
606
595
cboxColorMap->setCurrentIndex ( cboxColorMap->findText ( tr ( " Grayscale" ) ) );
607
596
}
608
597
609
- // set whether the layer histogram should be inverted
610
- if ( mRasterLayer ->invertHistogram () )
598
+ if ( !mRasterLayerIsWms )
611
599
{
612
- cboxInvertColorMap->setChecked ( true );
613
- }
614
- else
615
- {
616
- cboxInvertColorMap->setChecked ( false );
617
- }
600
+ // set whether the layer histogram should be inverted
601
+ if ( mRasterLayer ->invertHistogram () )
602
+ {
603
+ cboxInvertColorMap->setChecked ( true );
604
+ }
605
+ else
606
+ {
607
+ cboxInvertColorMap->setChecked ( false );
608
+ }
618
609
619
- // set the combos to the correct values
620
- cboRed->setCurrentIndex ( cboRed->findText ( mRasterLayer ->redBandName () ) );
621
- cboGreen->setCurrentIndex ( cboGreen->findText ( mRasterLayer ->greenBandName () ) );
622
- cboBlue->setCurrentIndex ( cboBlue->findText ( mRasterLayer ->blueBandName () ) );
623
- cboGray->setCurrentIndex ( cboGray->findText ( mRasterLayer ->grayBandName () ) );
610
+ // set the combos to the correct values
611
+ cboRed->setCurrentIndex ( cboRed->findText ( mRasterLayer ->redBandName () ) );
612
+ cboGreen->setCurrentIndex ( cboGreen->findText ( mRasterLayer ->greenBandName () ) );
613
+ cboBlue->setCurrentIndex ( cboBlue->findText ( mRasterLayer ->blueBandName () ) );
614
+ cboGray->setCurrentIndex ( cboGray->findText ( mRasterLayer ->grayBandName () ) );
624
615
625
- // set the stdDevs and min max values
626
- mDefaultStandardDeviation = myQSettings.value ( " /Raster/defaultStandardDeviation" , 2.0 ).toDouble ();
616
+ // set the stdDevs and min max values
617
+ mDefaultStandardDeviation = myQSettings.value ( " /Raster/defaultStandardDeviation" , 2.0 ).toDouble ();
618
+ }
627
619
if ( mRasterLayerIsGdal && rbtnThreeBand->isChecked () )
628
620
{
629
621
mRGBMinimumMaximumEstimated = mRasterLayer ->isRGBMinimumMaximumEstimated ();
@@ -709,54 +701,57 @@ void QgsRasterLayerProperties::sync()
709
701
setMinimumMaximumEstimateWarning ();
710
702
}
711
703
712
- // set color scaling algorithm
713
- if ( QgsContrastEnhancement::StretchToMinimumMaximum == mRasterLayer ->contrastEnhancementAlgorithm () )
704
+ if ( !mRasterLayerIsWms )
714
705
{
715
- cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " Stretch To MinMax" ) ) );
716
- }
717
- else if ( QgsContrastEnhancement::StretchAndClipToMinimumMaximum == mRasterLayer ->contrastEnhancementAlgorithm () )
718
- {
719
- cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " Stretch And Clip To MinMax" ) ) );
720
- }
721
- else if ( QgsContrastEnhancement::ClipToMinimumMaximum == mRasterLayer ->contrastEnhancementAlgorithm () )
722
- {
723
- cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " Clip To MinMax" ) ) );
724
- }
725
- else if ( QgsContrastEnhancement::UserDefinedEnhancement == mRasterLayer ->contrastEnhancementAlgorithm () )
726
- {
727
- cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " User Defined" ) ) );
728
- }
729
- else
730
- {
731
- cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " No Stretch" ) ) );
732
- }
706
+ // set color scaling algorithm
707
+ if ( QgsContrastEnhancement::StretchToMinimumMaximum == mRasterLayer ->contrastEnhancementAlgorithm () )
708
+ {
709
+ cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " Stretch To MinMax" ) ) );
710
+ }
711
+ else if ( QgsContrastEnhancement::StretchAndClipToMinimumMaximum == mRasterLayer ->contrastEnhancementAlgorithm () )
712
+ {
713
+ cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " Stretch And Clip To MinMax" ) ) );
714
+ }
715
+ else if ( QgsContrastEnhancement::ClipToMinimumMaximum == mRasterLayer ->contrastEnhancementAlgorithm () )
716
+ {
717
+ cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " Clip To MinMax" ) ) );
718
+ }
719
+ else if ( QgsContrastEnhancement::UserDefinedEnhancement == mRasterLayer ->contrastEnhancementAlgorithm () )
720
+ {
721
+ cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " User Defined" ) ) );
722
+ }
723
+ else
724
+ {
725
+ cboxContrastEnhancementAlgorithm->setCurrentIndex ( cboxContrastEnhancementAlgorithm->findText ( tr ( " No Stretch" ) ) );
726
+ }
733
727
734
- // Display the current default contrast enhancement algorithm
735
- mDefaultRedBand = myQSettings.value ( " /Raster/defaultRedBand" , 1 ).toInt ();
736
- mDefaultGreenBand = myQSettings.value ( " /Raster/defaultGreenBand" , 2 ).toInt ();
737
- mDefaultBlueBand = myQSettings.value ( " /Raster/defaultBlueBand" , 3 ).toInt ();
738
- labelDefaultBandCombination->setText ( tr ( " Default R:%1 G:%2 B:%3" ).arg ( mDefaultRedBand ) .arg ( mDefaultGreenBand ) .arg ( mDefaultBlueBand ) );
728
+ // Display the current default contrast enhancement algorithm
729
+ mDefaultRedBand = myQSettings.value ( " /Raster/defaultRedBand" , 1 ).toInt ();
730
+ mDefaultGreenBand = myQSettings.value ( " /Raster/defaultGreenBand" , 2 ).toInt ();
731
+ mDefaultBlueBand = myQSettings.value ( " /Raster/defaultBlueBand" , 3 ).toInt ();
732
+ labelDefaultBandCombination->setText ( tr ( " Default R:%1 G:%2 B:%3" ).arg ( mDefaultRedBand ) .arg ( mDefaultGreenBand ) .arg ( mDefaultBlueBand ) );
739
733
740
- mDefaultContrastEnhancementAlgorithm = myQSettings.value ( " /Raster/defaultContrastEnhancementAlgorithm" , " NoEnhancement" ).toString ();
741
- if ( mDefaultContrastEnhancementAlgorithm == " NoEnhancement" )
742
- {
743
- labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " No Stretch" ) );
744
- }
745
- if ( mDefaultContrastEnhancementAlgorithm == " StretchToMinimumMaximum" )
746
- {
747
- labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " Stretch To MinMax" ) );
748
- }
749
- else if ( mDefaultContrastEnhancementAlgorithm == " StretchAndClipToMinimumMaximum" )
750
- {
751
- labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " Stretch And Clip To MinMax" ) );
752
- }
753
- else if ( mDefaultContrastEnhancementAlgorithm == " ClipToMinimumMaximum" )
754
- {
755
- labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " Clip To MinMax" ) );
756
- }
757
- else
758
- {
759
- labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " No Stretch" ) );
734
+ mDefaultContrastEnhancementAlgorithm = myQSettings.value ( " /Raster/defaultContrastEnhancementAlgorithm" , " NoEnhancement" ).toString ();
735
+ if ( mDefaultContrastEnhancementAlgorithm == " NoEnhancement" )
736
+ {
737
+ labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " No Stretch" ) );
738
+ }
739
+ if ( mDefaultContrastEnhancementAlgorithm == " StretchToMinimumMaximum" )
740
+ {
741
+ labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " Stretch To MinMax" ) );
742
+ }
743
+ else if ( mDefaultContrastEnhancementAlgorithm == " StretchAndClipToMinimumMaximum" )
744
+ {
745
+ labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " Stretch And Clip To MinMax" ) );
746
+ }
747
+ else if ( mDefaultContrastEnhancementAlgorithm == " ClipToMinimumMaximum" )
748
+ {
749
+ labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " Clip To MinMax" ) );
750
+ }
751
+ else
752
+ {
753
+ labelDefaultContrastEnhancementAlgorithm->setText ( tr ( " No Stretch" ) );
754
+ }
760
755
}
761
756
762
757
QgsDebugMsg ( " populate transparency tab" );
0 commit comments