Skip to content

Commit

Permalink
Automatically turn on the vector layer label toggle when the user sets
Browse files Browse the repository at this point in the history
the label field. 


git-svn-id: http://svn.osgeo.org/qgis/trunk@5875 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Sep 26, 2006
1 parent c61099c commit 749f822
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/gui/qgslabeldialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ public slots:
/** Initialise dialog to vector layer values */
void init ( void );

void on_cboLabelField_activated(int) {emit labelSourceSet(); }

signals:
/* emitted when anitem in label source list is chosen */
void labelSourceSet();

protected slots:


private:
QgsLabel *mLabel;
QColor mFontColor;
Expand Down
10 changes: 9 additions & 1 deletion src/gui/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(QgsVectorLayer * lyr,
QVBoxLayout *layout = new QVBoxLayout( labelOptionsFrame );
labelDialog = new QgsLabelDialog ( layer->label(), labelOptionsFrame);
layout->addWidget( labelDialog );
connect(labelDialog, SIGNAL(labelSourceSet()),
this, SLOT(setLabelCheckBox()));

// Create the Actions dialog tab
QgsVectorDataProvider *dp = dynamic_cast<QgsVectorDataProvider *>(layer->getDataProvider());
Expand Down Expand Up @@ -77,7 +79,8 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(QgsVectorLayer * lyr,

QgsVectorLayerProperties::~QgsVectorLayerProperties()
{

disconnect(labelDialog, SIGNAL(labelSourceSet()),
this, SLOT(setLabelCheckBox()));
}
void QgsVectorLayerProperties::sliderTransparency_valueChanged(int theValue)
{
Expand All @@ -86,6 +89,11 @@ void QgsVectorLayerProperties::sliderTransparency_valueChanged(int theValue)
lblTransparencyPercent->setText(tr("Transparency: ") + QString::number(myInt) + "%");
}//sliderTransparency_valueChanged

void QgsVectorLayerProperties::setLabelCheckBox()
{
labelCheckBox->setCheckState(Qt::Checked);
}

void QgsVectorLayerProperties::alterLayerDialog(const QString & dialogString)
{

Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsvectorlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
QString getMetadata();
/** Set transparency based on slider position */
void sliderTransparency_valueChanged(int theValue);
/** Toggles on the label check box */
void setLabelCheckBox();

//
//methods reimplemented from qt designer base class
Expand Down

0 comments on commit 749f822

Please sign in to comment.