Skip to content
Permalink
Browse files

Label property dialog: allow translation of comboboxes entries and ad…

…d missing vertical alignment
  • Loading branch information
3nids committed Sep 1, 2015
1 parent 0512d02 commit 4e600226d82d8af0983c3cf81fbafe2084edabd6
Showing with 18 additions and 17 deletions.
  1. +16 −15 src/app/qgslabelpropertydialog.cpp
  2. +2 −2 src/app/qgslabelpropertydialog.h
@@ -134,8 +134,8 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const
mBufferColorButton->setColor( layerSettings.bufferColor );
mMinScaleSpinBox->setValue( layerSettings.scaleMin );
mMaxScaleSpinBox->setValue( layerSettings.scaleMax );
mHaliComboBox->setCurrentIndex( mHaliComboBox->findText( "Left" ) );
mValiComboBox->setCurrentIndex( mValiComboBox->findText( "Bottom" ) );
mHaliComboBox->setCurrentIndex( mHaliComboBox->findData( "Left" ) );
mValiComboBox->setCurrentIndex( mValiComboBox->findData( "Bottom" ) );
mFontColorButton->setColorDialogTitle( tr( "Font color" ) );
mBufferColorButton->setColorDialogTitle( tr( "Buffer color" ) );

@@ -300,10 +300,10 @@ void QgsLabelPropertyDialog::setDataDefinedValues( const QgsPalLayerSettings &la
break;
}
case QgsPalLayerSettings::Hali:
mHaliComboBox->setCurrentIndex( mHaliComboBox->findText( result.toString(), Qt::MatchFixedString ) );
mHaliComboBox->setCurrentIndex( mHaliComboBox->findData( result.toString() ) );
break;
case QgsPalLayerSettings::Vali:
mValiComboBox->setCurrentIndex( mValiComboBox->findText( result.toString(), Qt::MatchFixedString ) );
mValiComboBox->setCurrentIndex( mValiComboBox->findData( result.toString() ) );
break;
case QgsPalLayerSettings::BufferColor:
mBufferColorButton->setColor( QColor( result.toString() ) );
@@ -475,17 +475,18 @@ void QgsLabelPropertyDialog::populateFontStyleComboBox()

void QgsLabelPropertyDialog::fillHaliComboBox()
{
mHaliComboBox->addItem( "Left" );
mHaliComboBox->addItem( "Center" );
mHaliComboBox->addItem( "Right" );
mHaliComboBox->addItem( tr( "Left" ), "Left" );
mHaliComboBox->addItem( tr( "Center" ), "Center" );
mHaliComboBox->addItem( tr( "Right" ), "Right" );
}

void QgsLabelPropertyDialog::fillValiComboBox()
{
mValiComboBox->addItem( "Bottom" );
mValiComboBox->addItem( "Base" );
mValiComboBox->addItem( "Half" );
mValiComboBox->addItem( "Top" );
mValiComboBox->addItem( tr( "Bottom" ), "Bottom" );
mValiComboBox->addItem( tr( "Base" ), "Base" );
mValiComboBox->addItem( tr( "Half" ), "Half" );
mValiComboBox->addItem( tr( "Cap" ), "Cap" );
mValiComboBox->addItem( tr( "Top" ), "Top" );
}

void QgsLabelPropertyDialog::on_mShowLabelChkbx_toggled( bool chkd )
@@ -626,14 +627,14 @@ void QgsLabelPropertyDialog::on_mBufferColorButton_colorChanged( const QColor &c
insertChangedValue( QgsPalLayerSettings::BufferColor, color.name() );
}

void QgsLabelPropertyDialog::on_mHaliComboBox_currentIndexChanged( const QString& text )
void QgsLabelPropertyDialog::on_mHaliComboBox_currentIndexChanged( const int index )
{
insertChangedValue( QgsPalLayerSettings::Hali, text );
insertChangedValue( QgsPalLayerSettings::Hali, mHaliComboBox->itemData( index ) );
}

void QgsLabelPropertyDialog::on_mValiComboBox_currentIndexChanged( const QString& text )
void QgsLabelPropertyDialog::on_mValiComboBox_currentIndexChanged( const int index )
{
insertChangedValue( QgsPalLayerSettings::Vali, text );
insertChangedValue( QgsPalLayerSettings::Vali, mValiComboBox->itemData( index ) );
}

void QgsLabelPropertyDialog::on_mLabelTextLineEdit_textChanged( const QString& text )
@@ -62,8 +62,8 @@ class APP_EXPORT QgsLabelPropertyDialog: public QDialog, private Ui::QgsLabelPro
void on_mRotationSpinBox_valueChanged( double d );
void on_mFontColorButton_colorChanged( const QColor &color );
void on_mBufferColorButton_colorChanged( const QColor &color );
void on_mHaliComboBox_currentIndexChanged( const QString& text );
void on_mValiComboBox_currentIndexChanged( const QString& text );
void on_mHaliComboBox_currentIndexChanged( const int index );
void on_mValiComboBox_currentIndexChanged( const int index );
void on_mLabelTextLineEdit_textChanged( const QString& text );

private:

0 comments on commit 4e60022

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