Skip to content
Permalink
Browse files

[composer] Correctly update non-position related item property contro…

…ls after undo/redo
  • Loading branch information
nyalldawson committed Apr 13, 2014
1 parent 5537afc commit 80ab4a2818445543ec10d5d944ec261c2d1e653e
Showing with 21 additions and 7 deletions.
  1. +18 −7 src/app/composer/qgscomposeritemwidget.cpp
  2. +3 −0 src/app/composer/qgscomposeritemwidget.h
@@ -47,6 +47,7 @@ QgsComposerItemWidget::QgsComposerItemWidget( QWidget* parent, QgsComposerItem*

setValuesForGuiElements();
connect( mItem, SIGNAL( sizeChanged() ), this, SLOT( setValuesForGuiPositionElements() ) );
connect( mItem, SIGNAL( itemChanged() ), this, SLOT( setValuesForGuiNonPositionElements() ) );

connect( mTransparencySlider, SIGNAL( valueChanged( int ) ), mTransparencySpnBx, SLOT( setValue( int ) ) );
connect( mTransparencySpnBx, SIGNAL( valueChanged( int ) ), mTransparencySlider, SLOT( setValue( int ) ) );
@@ -335,15 +336,13 @@ void QgsComposerItemWidget::setValuesForGuiPositionElements()
mHeightLineEdit->blockSignals( false );
}

void QgsComposerItemWidget::setValuesForGuiElements()
void QgsComposerItemWidget::setValuesForGuiNonPositionElements()
{
if ( !mItem )
{
return;
}

setValuesForGuiPositionElements();

mOutlineWidthSpinBox->blockSignals( true );
mFrameGroupBox->blockSignals( true );
mBackgroundGroupBox->blockSignals( true );
@@ -357,11 +356,7 @@ void QgsComposerItemWidget::setValuesForGuiElements()
mItemRotationSpinBox->blockSignals( true );

mBackgroundColorButton->setColor( mItem->brush().color() );
mBackgroundColorButton->setColorDialogTitle( tr( "Select background color" ) );
mBackgroundColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
mFrameColorButton->setColor( mItem->pen().color() );
mFrameColorButton->setColorDialogTitle( tr( "Select frame color" ) );
mFrameColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
mOutlineWidthSpinBox->setValue( mItem->pen().widthF() );
mFrameJoinStyleCombo->setPenJoinStyle( mItem->frameJoinStyle() );
mItemIdLineEdit->setText( mItem->id() );
@@ -385,6 +380,22 @@ void QgsComposerItemWidget::setValuesForGuiElements()
mItemRotationSpinBox->blockSignals( false );
}

void QgsComposerItemWidget::setValuesForGuiElements()
{
if ( !mItem )
{
return;
}

mBackgroundColorButton->setColorDialogTitle( tr( "Select background color" ) );
mBackgroundColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
mFrameColorButton->setColorDialogTitle( tr( "Select frame color" ) );
mFrameColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );

setValuesForGuiPositionElements();
setValuesForGuiNonPositionElements();
}

void QgsComposerItemWidget::on_mBlendModeCombo_currentIndexChanged( int index )
{
Q_UNUSED( index );
@@ -81,7 +81,10 @@ class QgsComposerItemWidget: public QWidget, private Ui::QgsComposerItemWidgetBa
void on_mItemRotationSpinBox_valueChanged( double val );

void setValuesForGuiElements();
//sets the values for all position related (x, y, width, height) elements
void setValuesForGuiPositionElements();
//sets the values for all non-position related elements
void setValuesForGuiNonPositionElements();

private:
QgsComposerItemWidget();

0 comments on commit 80ab4a2

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