Showing with 63 additions and 72 deletions.
  1. +8 −5 src/app/qgslabelinggui.cpp
  2. +55 −67 src/ui/qgslabelingguibase.ui
13 changes: 8 additions & 5 deletions src/app/qgslabelinggui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM
chkLineAbove->setChecked( lyr.placementFlags & QgsPalLayerSettings::AboveLine );
chkLineBelow->setChecked( lyr.placementFlags & QgsPalLayerSettings::BelowLine );
chkLineOn->setChecked( lyr.placementFlags & QgsPalLayerSettings::OnLine );
if ( lyr.placementFlags & QgsPalLayerSettings::MapOrientation )
radOrientationMap->setChecked( true );
else
radOrientationLine->setChecked( true );
if ( ! ( lyr.placementFlags & QgsPalLayerSettings::MapOrientation ) )
chkLineOrientationDependent->setChecked( true );
}

cboFieldName->setCurrentIndex( cboFieldName->findText( lyr.fieldName ) );
Expand Down Expand Up @@ -190,6 +188,8 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM
connect( chkBuffer, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) );
connect( chkScaleBasedVisibility, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) );
connect( chkFormattedNumbers, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) );
connect( chkLineAbove, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) );
connect( chkLineBelow, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) );

// setup connection to changes in the placement
QRadioButton* placementRadios[] =
Expand Down Expand Up @@ -258,7 +258,7 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
if ( chkLineOn->isChecked() )
lyr.placementFlags |= QgsPalLayerSettings::OnLine;

if ( radOrientationMap->isChecked() )
if ( ! chkLineOrientationDependent->isChecked() )
lyr.placementFlags |= QgsPalLayerSettings::MapOrientation;
}
else if (( stackedPlacement->currentWidget() == pageLine && radLineHorizontal->isChecked() )
Expand Down Expand Up @@ -518,6 +518,9 @@ void QgsLabelingGui::updateUi()
spinScaleMax->setEnabled( scale );

spinDecimals->setEnabled( chkFormattedNumbers->isChecked() );

bool offline = chkLineAbove->isChecked() || chkLineBelow->isChecked();
offlineOptions->setEnabled ( offline );
}

void QgsLabelingGui::changeBufferColor()
Expand Down
122 changes: 55 additions & 67 deletions src/ui/qgslabelingguibase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>646</width>
<height>451</height>
<width>658</width>
<height>443</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_13">
Expand Down Expand Up @@ -731,7 +731,7 @@
<item>
<widget class="QStackedWidget" name="stackedOptions">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="pageOptionsPoint">
<layout class="QGridLayout" name="gridLayout_7">
Expand Down Expand Up @@ -822,70 +822,58 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QLabel" name="label_25">
<property name="text">
<string>Orientation</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radOrientationMap">
<property name="text">
<string>map</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radOrientationLine">
<property name="text">
<string>line</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QLabel" name="label_26">
<property name="text">
<string>Label distance</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="spinDistLine">
<property name="decimals">
<number>4</number>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mLineDistanceUnitComboBox">
<item>
<property name="text">
<string>In mm</string>
</property>
</item>
<item>
<widget class="QWidget" name="offlineOptions" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QLabel" name="label_26">
<property name="text">
<string>Label distance</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="spinDistLine">
<property name="decimals">
<number>4</number>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mLineDistanceUnitComboBox">
<item>
<property name="text">
<string>In mm</string>
</property>
</item>
<item>
<property name="text">
<string>In map units</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="chkLineOrientationDependent">
<property name="text">
<string>In map units</string>
<string>Line orientation dependent position</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
Expand Down Expand Up @@ -923,8 +911,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>646</width>
<height>585</height>
<width>249</width>
<height>567</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_11">
Expand Down