Skip to content
Permalink
Browse files

Style dock: properly restore values in spinboxes for brightness etc (f…

…ixes #15228)
  • Loading branch information
wonder-sk committed Jul 7, 2016
1 parent cca79aa commit 612043cd0243e1cf002f26cd3076d813e441f26a
Showing with 10 additions and 16 deletions.
  1. +10 −16 src/gui/raster/qgsrendererrasterpropertieswidget.cpp
@@ -64,48 +64,42 @@ QgsRendererRasterPropertiesWidget::QgsRendererRasterPropertiesWidget( QgsMapLaye
mZoomedOutResamplingComboBox->insertItem( 0, tr( "Nearest neighbour" ) );
mZoomedOutResamplingComboBox->insertItem( 1, tr( "Average" ) );

syncToLayer( mRasterLayer );

connect( cboRenderers, SIGNAL( currentIndexChanged( int ) ), this, SLOT( rendererChanged() ) );

connect( mSliderBrightness, SIGNAL( valueChanged( int ) ), mBrightnessSpinBox, SLOT( setValue( int ) ) );
connect( mBrightnessSpinBox, SIGNAL( valueChanged( int ) ), mSliderBrightness, SLOT( setValue( int ) ) );

// Just connect the spin box because the slidder updates the spinner
connect( mBrightnessSpinBox, SIGNAL( valueChanged( int ) ), this, SIGNAL( widgetChanged() ) );

connect( mSliderContrast, SIGNAL( valueChanged( int ) ), mContrastSpinBox, SLOT( setValue( int ) ) );
connect( mContrastSpinBox, SIGNAL( valueChanged( int ) ), mSliderContrast, SLOT( setValue( int ) ) );

// Just connect the spin box because the slidder updates the spinner
connect( mContrastSpinBox, SIGNAL( valueChanged( int ) ), this, SIGNAL( widgetChanged() ) );

// Connect saturation slider and spin box
connect( sliderSaturation, SIGNAL( valueChanged( int ) ), spinBoxSaturation, SLOT( setValue( int ) ) );
connect( spinBoxSaturation, SIGNAL( valueChanged( int ) ), sliderSaturation, SLOT( setValue( int ) ) );

// Just connect the spin box because the slidder updates the spinner
connect( spinBoxSaturation, SIGNAL( valueChanged( int ) ), this, SIGNAL( widgetChanged() ) );

// Connect colorize strength slider and spin box
connect( sliderColorizeStrength, SIGNAL( valueChanged( int ) ), spinColorizeStrength, SLOT( setValue( int ) ) );
connect( spinColorizeStrength, SIGNAL( valueChanged( int ) ), sliderColorizeStrength, SLOT( setValue( int ) ) );

// Connect colorize strength slider and spin box
connect( spinColorizeStrength, SIGNAL( valueChanged( int ) ), this, SIGNAL( widgetChanged() ) );

// enable or disable saturation slider and spin box depending on grayscale combo choice
connect( comboGrayscale, SIGNAL( currentIndexChanged( int ) ), this, SLOT( toggleSaturationControls( int ) ) );

connect( mBlendModeComboBox, SIGNAL( currentIndexChanged( int ) ), this, SIGNAL( widgetChanged() ) );

// enable or disable colorize colorbutton with colorize checkbox
connect( mColorizeCheck, SIGNAL( toggled( bool ) ), this, SLOT( toggleColorizeControls( bool ) ) );

// Just connect the spin boxes because the sliders update the spinners
connect( mBrightnessSpinBox, SIGNAL( valueChanged( int ) ), this, SIGNAL( widgetChanged() ) );
connect( mContrastSpinBox, SIGNAL( valueChanged( int ) ), this, SIGNAL( widgetChanged() ) );
connect( spinBoxSaturation, SIGNAL( valueChanged( int ) ), this, SIGNAL( widgetChanged() ) );
connect( spinColorizeStrength, SIGNAL( valueChanged( int ) ), this, SIGNAL( widgetChanged() ) );

connect( mBlendModeComboBox, SIGNAL( currentIndexChanged( int ) ), this, SIGNAL( widgetChanged() ) );
connect( mZoomedInResamplingComboBox, SIGNAL( currentIndexChanged( int ) ), this, SIGNAL( widgetChanged() ) );
connect( mZoomedOutResamplingComboBox, SIGNAL( currentIndexChanged( int ) ), this, SIGNAL( widgetChanged() ) );
connect( mMaximumOversamplingSpinBox, SIGNAL( valueChanged( double ) ), this, SIGNAL( widgetChanged() ) );

// finally sync to the layer - even though some actions may emit widgetChanged signal,
// this is not a problem - nobody is listening to our signals yet
syncToLayer( mRasterLayer );
}

QgsRendererRasterPropertiesWidget::~QgsRendererRasterPropertiesWidget()

0 comments on commit 612043c

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