void QgsLabelPropertyDialog::on_mFontPushButton_clicked()
{
  bool ok;
  mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr( "Label font" ) );
  if ( ok )
  {
    insertChangedValue( QgsPalLayerSettings::Size, mLabelFont.pointSizeF() );
    insertChangedValue( QgsPalLayerSettings::Bold, mLabelFont.bold() );
    insertChangedValue( QgsPalLayerSettings::Italic, mLabelFont.italic() );
    insertChangedValue( QgsPalLayerSettings::Underline, mLabelFont.underline() );
  }
}
void QgsLabelPropertyDialog::on_mFontPushButton_clicked()
{
  bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
  // Native Mac dialog works only for Qt Carbon
  mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr( "Label font" ), QFontDialog::DontUseNativeDialog );
#else
  mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr( "Label font" ) );
#endif
  if ( ok )
  {
    insertChangedValue( QgsPalLayerSettings::Size, mLabelFont.pointSizeF() );
    insertChangedValue( QgsPalLayerSettings::Bold, mLabelFont.bold() );
    insertChangedValue( QgsPalLayerSettings::Italic, mLabelFont.italic() );
    insertChangedValue( QgsPalLayerSettings::Underline, mLabelFont.underline() );
  }
}
void QgsLabelPropertyDialog::on_mRotationSpinBox_valueChanged( double d )
{
  QVariant rotation( d );
  if ( d < 0 )
  {
    //null value so that size is reset to default
    rotation.clear();
  }
  insertChangedValue( QgsPalLayerSettings::Rotation, rotation );
}
void QgsLabelPropertyDialog::on_mYCoordSpinBox_valueChanged( double d )
{
  QVariant y( d );
  if ( d < mYCoordSpinBox->minimum() + mYCoordSpinBox->singleStep() )
  {
    //null value
    y.clear();
  }
  insertChangedValue( QgsPalLayerSettings::PositionY, y );
}
void QgsLabelPropertyDialog::on_mLabelDistanceSpinBox_valueChanged( double d )
{
  QVariant distance( d );
  if ( d < 0 )
  {
    //null value so that distance is reset to default
    distance.clear();
  }
  insertChangedValue( QgsPalLayerSettings::LabelDistance, distance );
}
void QgsLabelPropertyDialog::on_mBufferSizeSpinBox_valueChanged( double d )
{
  QVariant size( d );
  if ( d < 0 )
  {
    //null value so that size is reset to default
    size.clear();
  }
  insertChangedValue( QgsPalLayerSettings::BufferSize, size );
}
void QgsLabelPropertyDialog::on_mBufferColorButton_clicked()
{
#if QT_VERSION >= 0x040500
  QColor c = QColorDialog::getColor( mBufferColorButton->color(), 0, tr( "Buffer color" ), QColorDialog::ShowAlphaChannel );
#else
  QColor c = QColorDialog::getColor( mBufferColorButton->color() );
#endif
  if ( c.isValid() )
  {
    mFontColorButton->setColor( c );
    insertChangedValue( QgsPalLayerSettings::BufferColor, c.name() );
  }
}
void QgsLabelPropertyDialog::on_mValiComboBox_currentIndexChanged( const int index )
{
  insertChangedValue( QgsPalLayerSettings::Vali, mValiComboBox->itemData( index ) );
}
void QgsLabelPropertyDialog::on_mBufferColorButton_colorChanged( const QColor &color )
{
  insertChangedValue( QgsPalLayerSettings::BufferColor, color.name() );
}
void QgsLabelPropertyDialog::mFontBoldBtn_toggled( bool ckd )
{
  mLabelFont.setBold( ckd );
  updateFont( mLabelFont );
  insertChangedValue( QgsPalLayerSettings::Bold, ckd );
}
void QgsLabelPropertyDialog::on_mBufferSizeSpinBox_valueChanged( double d )
{
  insertChangedValue( QgsPalLayerSettings::PositionX, d );
}
void QgsLabelPropertyDialog::on_mLabelDistanceSpinBox_valueChanged( double d )
{
  insertChangedValue( QgsPalLayerSettings::LabelDistance, d );
}
void QgsLabelPropertyDialog::on_mFontStyleCmbBx_currentIndexChanged( const QString & text )
{
  QgsFontUtils::updateFontViaStyle( mLabelFont, text );
  updateFont( mLabelFont );
  insertChangedValue( QgsPalLayerSettings::FontStyle, text );
}
void QgsLabelPropertyDialog::on_mFontFamilyCmbBx_currentFontChanged( const QFont& f )
{
  mLabelFont.setFamily( f.family() );
  updateFont( mLabelFont );
  insertChangedValue( QgsPalLayerSettings::Family, f.family() );
}
void QgsLabelPropertyDialog::on_mAlwaysShowChkbx_toggled( bool chkd )
{
  insertChangedValue( QgsPalLayerSettings::AlwaysShow, ( chkd ? 1 : 0 ) );
}
void QgsLabelPropertyDialog::on_mMaxScaleSpinBox_valueChanged( int i )
{
  insertChangedValue( QgsPalLayerSettings::MaxScale, i );
}
void QgsLabelPropertyDialog::on_mFontUnderlineBtn_toggled( bool ckd )
{
  mLabelFont.setUnderline( ckd );
  updateFont( mLabelFont );
  insertChangedValue( QgsPalLayerSettings::Underline, ckd );
}
void QgsLabelPropertyDialog::on_mFontSizeSpinBox_valueChanged( double d )
{
  insertChangedValue( QgsPalLayerSettings::Size, d );
}
void QgsLabelPropertyDialog::on_mFontStrikethroughBtn_toggled( bool ckd )
{
  mLabelFont.setStrikeOut( ckd );
  updateFont( mLabelFont );
  insertChangedValue( QgsPalLayerSettings::Strikeout, ckd );
}
void QgsLabelPropertyDialog::on_mRotationSpinBox_valueChanged( double d )
{
  insertChangedValue( QgsPalLayerSettings::Rotation, d );
}
void QgsLabelPropertyDialog::on_mFontItalicBtn_toggled( bool ckd )
{
  mLabelFont.setItalic( ckd );
  updateFont( mLabelFont );
  insertChangedValue( QgsPalLayerSettings::Italic, ckd );
}
void QgsLabelPropertyDialog::on_mValiComboBox_currentIndexChanged( const QString& text )
{
  insertChangedValue( QgsPalLayerSettings::Vali, text );
}
void QgsLabelPropertyDialog::maxScaleChanged( double scale )
{
  insertChangedValue( QgsPalLayerSettings::MaximumScale, scale );
}