Skip to content
Permalink
Browse files
UI enable/disable works
  • Loading branch information
olivierdalang committed Jan 29, 2013
1 parent 94491b8 commit f150fb89bf068cee070d600e04fc4cd72b4fd6e2
Showing with 182 additions and 79 deletions.
  1. +40 −0 src/app/composer/qgscomposerlabelwidget.cpp
  2. +1 −0 src/app/composer/qgscomposerlabelwidget.h
  3. +22 −9 src/ui/qgscomposerhtmlwidgetbase.ui
  4. +119 −70 src/ui/qgscomposerlabelwidgetbase.ui
@@ -32,13 +32,53 @@ QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel* label ): QWidg
QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, label );
toolBox->addItem( itemPropertiesWidget, tr( "General options" ) );


if ( mComposerLabel )
{
setGuiElementValues();
connect( mComposerLabel, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
}
}

void QgsComposerLabelWidget::on_mHtmlCheckBox_stateChanged( int state )
{
if ( mComposerLabel )
{
if (state)
{
mFontButton->setEnabled( false );
mFontColorButton->setEnabled( false );
mHorizontalAlignementGroup->setEnabled( false );
mVerticalAlignementGroup->setEnabled( false );
mMarginDoubleSpinBox->setEnabled( false );
mRotationSpinBox->setEnabled( false );
mComposerLabel->beginCommand( tr( "Label text HTML state changed" ), QgsComposerMergeCommand::ComposerLabelSetText );
mComposerLabel->blockSignals( true );
//mComposerLabel->setHtml(state);
mComposerLabel->setText( mTextEdit->toPlainText() );
mComposerLabel->update();
mComposerLabel->blockSignals( false );
mComposerLabel->endCommand();
}
else
{
mFontButton->setEnabled( true );
mFontColorButton->setEnabled( true );
mHorizontalAlignementGroup->setEnabled( true );
mVerticalAlignementGroup->setEnabled( true );
mMarginDoubleSpinBox->setEnabled( true );
mRotationSpinBox->setEnabled( true );
mComposerLabel->beginCommand( tr( "Label text HTML state changed" ), QgsComposerMergeCommand::ComposerLabelSetText );
mComposerLabel->blockSignals( true );
//mComposerLabel->setHtml(state);
mComposerLabel->setText( mTextEdit->toPlainText() );
mComposerLabel->update();
mComposerLabel->blockSignals( false );
mComposerLabel->endCommand();
}
}
}

void QgsComposerLabelWidget::on_mTextEdit_textChanged()
{
if ( mComposerLabel )
@@ -32,6 +32,7 @@ class QgsComposerLabelWidget: public QWidget, private Ui::QgsComposerLabelWidget
QgsComposerLabelWidget( QgsComposerLabel* label );

public slots:
void on_mHtmlCheckBox_stateChanged( int i );
void on_mTextEdit_textChanged();
void on_mFontButton_clicked();
void on_mInsertExpressionButton_clicked();
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>243</width>
<height>116</height>
<height>153</height>
</rect>
</property>
<property name="windowTitle">
@@ -24,41 +24,54 @@
<rect>
<x>0</x>
<y>0</y>
<width>225</width>
<height>72</height>
<width>221</width>
<height>100</height>
</rect>
</property>
<attribute name="label">
<string>HTML</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="2">
<item row="2" column="2">
<widget class="QToolButton" name="mFileToolButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QLineEdit" name="mUrlLineEdit"/>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="mUrlLabel">
<property name="text">
<string>URL</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="mResizeModeComboBox"/>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mResizeModeLabel">
<property name="text">
<string>Resize mode</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="mResizeModeComboBox"/>
</item>
</layout>
</widget>
</widget>
Loading

0 comments on commit f150fb8

Please sign in to comment.