Skip to content

Commit 1009c74

Browse files
committed
- Line options only shown when available
- Default value for text diagram => label placment option -
1 parent 4f9e623 commit 1009c74

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/app/qgsdiagramproperties.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare
8383
}
8484
else
8585
{
86-
mLineOptionsComboBox->setEnabled( false );
87-
mLineOptionsLabel->setEnabled( false );
86+
mLineOptionsComboBox->setVisible( false );
87+
mLineOptionsLabel->setVisible( false );
8888
}
8989

9090
mDiagramTypeComboBox->addItem( tr( "Pie chart" ) );
@@ -255,9 +255,9 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare
255255
mPrioritySlider->setValue( dls->priority );
256256
mDataDefinedXComboBox->setCurrentIndex( mDataDefinedXComboBox->findData( dls->xPosColumn ) );
257257
mDataDefinedYComboBox->setCurrentIndex( mDataDefinedYComboBox->findData( dls->yPosColumn ) );
258-
if ( dls->xPosColumn == -1 && dls->yPosColumn == -1 )
258+
if ( dls->xPosColumn != -1 || dls->yPosColumn != -1 )
259259
{
260-
mDataDefinedPositionGroupBox->setChecked( false );
260+
mDataDefinedPositionGroupBox->setChecked( true );
261261
}
262262
mPlacementComboBox->setCurrentIndex( mPlacementComboBox->findData( dls->placement ) );
263263
mLineOptionsComboBox->setCurrentIndex( mLineOptionsComboBox->findData( dls->placementFlags ) );
@@ -455,7 +455,7 @@ void QgsDiagramProperties::apply()
455455
if ( 0 == mDiagramAttributesTreeWidget->topLevelItemCount() )
456456
{
457457
QMessageBox::warning( this, tr( "No attributes added." ),
458-
tr( "You did not add any attributes to this diagram layer. Please specify the attributes to show on the diagrams." ), QMessageBox::Ok );
458+
tr( "You did not add any attributes to this diagram layer. Please specify the attributes to visualize on the diagrams or disable diagrams." ), QMessageBox::Ok );
459459
}
460460

461461
QgsDiagram* diagram = 0;
@@ -497,7 +497,7 @@ void QgsDiagramProperties::apply()
497497
{
498498
ds.labelPlacementMethod = QgsDiagramSettings::Height;
499499
}
500-
else if ( tr( "x-height" ) == mLabelPlacementComboBox->currentText() )
500+
else
501501
{
502502
ds.labelPlacementMethod = QgsDiagramSettings::XHeight;
503503
}

src/ui/qgsdiagrampropertiesbase.ui

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,9 @@
529529
<property name="checkable">
530530
<bool>true</bool>
531531
</property>
532+
<property name="checked">
533+
<bool>false</bool>
534+
</property>
532535
<layout class="QGridLayout" name="gridLayout_5">
533536
<item row="0" column="0" rowspan="2" colspan="3">
534537
<widget class="QLabel" name="mXPosColLabel">

0 commit comments

Comments
 (0)