Skip to content
Permalink
Browse files

Diagram option page reloaded, pt. 1

  • Loading branch information
m-kuhn committed Aug 10, 2012
1 parent edd14f7 commit 2c9a3a7d36b71cf36c1eeec9b0ed98ab54b4ef6c
Showing with 557 additions and 538 deletions.
  1. +35 −7 src/app/qgsvectorlayerproperties.cpp
  2. +4 −0 src/app/qgsvectorlayerproperties.h
  3. +518 −531 src/ui/qgsvectorlayerpropertiesbase.ui
@@ -1363,6 +1363,17 @@ void QgsVectorLayerProperties::handleDiagramTypeChanged( const QString& itemtext
mLabelPlacementComboBox->hide();
mLabelPlacementLabel->hide();
}

if ( tr( "Histogram" ) == itemtext )
{
mDiagramOptionsGroupBox->show();
mBarWidthLabel->show();
}
else
{
mDiagramOptionsGroupBox->hide();
mBarWidthLabel->hide();
}
}

void QgsVectorLayerProperties::on_mIncreaseSmallDiagramsCheckBox_stateChanged( int state )
@@ -1588,6 +1599,21 @@ void QgsVectorLayerProperties::on_mDiagramPenColorButton_clicked()
}
}

void QgsVectorLayerProperties::on_mDisplayDiagramsCheckBox_stateChanged( int state )
{
// Set all widget enabled states
foreach( QWidget *widget, mDiagramDetailWidgets )
{
widget->setEnabled( Qt::Checked == state );
}

// if enabled show diagram specific options
if ( Qt::Checked == state )
{
handleDiagramTypeChanged( mDiagramTypeComboBox->currentText() );
}
}

void QgsVectorLayerProperties::initDiagramTab()
{
if ( !layer )
@@ -1698,7 +1724,7 @@ void QgsVectorLayerProperties::initDiagramTab()
}
mBackgroundColorButton->setColor( QColor( 255, 255, 255, 255 ) );
}
else
else // already a diagram renderer present
{
mDisplayDiagramsCheckBox->setChecked( true );

@@ -1813,13 +1839,15 @@ void QgsVectorLayerProperties::initDiagramTab()
mDiagramTypeComboBox->setCurrentIndex( mDiagramTypeComboBox->findText( tr( "Histogram" ) ) );
}
}
}
} // if ( !dr ), else

// Popuplate the widget list with all widgets which should be enabled/disabled when diagrams are
// enabled / disabled
mDiagramDetailWidgets << mTypeLabel << mDiagramTypeComboBox << mPriorityLabel << mPriorityLowLabel
<< mPrioritySlider << mPriorityHighLabel << mAppearanceGroupBox << mVisibilityGroupBox << mSizeGroupBox
<< mPlacementGroupBox << mAttributesLabel << mDiagramAttributesComboBox << mRemoveCategoryPushButton
<< mAddCategoryPushButton << mDiagramAttributesTreeWidget << mDiagramOptionsGroupBox;

// Hide/Show diagram specific widgets
// handleDiagramTypeChanged( mDiagramTypeComboBox->currentText() );
// Enable / disable small diagram scaling related widgets
// on_mFixedSizeCheckBox_stateChanged( mIncreaseSmallDiagramsCheckBox->checkState() );
connect( mDiagramAttributesTreeWidget, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( handleDiagramItemDoubleClick( QTreeWidgetItem*, int ) ) );
connect( mDiagramTypeComboBox, SIGNAL( currentIndexChanged( const QString& ) ), this, SLOT( handleDiagramTypeChanged( const QString& ) ) );
// connect( mIncreaseSmallDiagramsCheckBox, SIGNAL( stateChanged( int ) ), this, SLOT( handleIncreaseSmallDiagramsChanged( int ) ) );
}
@@ -127,6 +127,7 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
void on_mFindMaximumValueButton_clicked();
void on_mBackgroundColorButton_clicked();
void on_mDiagramPenColorButton_clicked();
void on_mDisplayDiagramsCheckBox_stateChanged( int state );
void on_pbnUpdateExtents_clicked();
void on_mIncreaseSmallDiagramsCheckBox_stateChanged( int state );

@@ -197,6 +198,9 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
/**Actions dialog. If apply is pressed, the actions are stored for later use */
QgsAttributeActionDialog* actionDialog;

/**A list of all widgets to enable/disable when diagrams are enabled / disabled */
QList<QWidget *> mDiagramDetailWidgets;

QList<QgsApplyDialog*> mOverlayDialogs;
QMap<int, QPushButton*> mButtonMap;
QMap<int, QgsVectorLayer::EditType> mEditTypeMap;

0 comments on commit 2c9a3a7

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