Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for the bug reported by Stephan where the vector layer properties…
… was not restored properly for unique value renderers. And removed a call to QgsVectorLayerProperties::reset() in QgsVectorLayer::showLayerProperties() because it is already called in the constructor of vector layer properties

git-svn-id: http://svn.osgeo.org/qgis/trunk@4928 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Feb 28, 2006
1 parent fc7ca7b commit 5720a46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
22 changes: 7 additions & 15 deletions src/gui/qgsuniquevaluedialog.cpp
Expand Up @@ -52,12 +52,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
return;
}

QObject::connect(mClassificationComboBox, SIGNAL(activated(int)), this, SLOT(changeClassificationAttribute(int)));
QObject::connect(mClassBreakBox, SIGNAL(selectionChanged()), this, SLOT(changeCurrentValue()));
QObject::connect(&sydialog, SIGNAL(settingsChanged()), this, SLOT(applySymbologyChanges()));
mSymbolWidgetStack->addWidget(&sydialog);
mSymbolWidgetStack->raiseWidget(&sydialog);

const QgsUniqueValueRenderer* renderer = dynamic_cast < const QgsUniqueValueRenderer * >(mVectorLayer->renderer());

if (renderer)
Expand All @@ -66,11 +60,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
std::list<int>::iterator iter=renderer->classificationAttributes().begin();
int classattr=*iter;
mClassificationComboBox->setCurrentItem(classattr);

if(renderer->symbols().size()>0)
{
changeClassificationAttribute(classattr);
}

const std::list<QgsSymbol*> list = renderer->symbols();
//fill the items of the renderer into mValues
Expand All @@ -83,7 +72,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
sym->setBrush(symbol->brush());
sym->setNamedPointSymbol(symbol->pointSymbolName());
sym->setPointSize(symbol->pointSize());

mValues.insert(std::make_pair(symbolvalue,sym));
mClassBreakBox->insertItem(symbolvalue);
}
Expand All @@ -92,6 +80,13 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
{
changeClassificationAttribute(0);
}

QObject::connect(mClassificationComboBox, SIGNAL(activated(int)), this, SLOT(changeClassificationAttribute(int)));
QObject::connect(mClassBreakBox, SIGNAL(selectionChanged()), this, SLOT(changeCurrentValue()));
QObject::connect(&sydialog, SIGNAL(settingsChanged()), this, SLOT(applySymbologyChanges()));
mSymbolWidgetStack->addWidget(&sydialog);
mSymbolWidgetStack->raiseWidget(&sydialog);

mClassBreakBox->setCurrentItem(0);
}

Expand All @@ -118,9 +113,6 @@ void QgsUniqueValueDialog::apply()
for(std::map<QString,QgsSymbol*>::iterator it=mValues.begin();it!=mValues.end();++it)
{
QgsSymbol* symbol=it->second;
#ifdef QGISDEBUG
qWarning("apply: lower value is "+symbol->lowerValue());
#endif
QgsSymbol* newsymbol=new QgsSymbol(mVectorLayer->vectorType(), symbol->lowerValue(), symbol->upperValue(), symbol->label());
newsymbol->setPen(symbol->pen());
newsymbol->setBrush(symbol->brush());
Expand Down
4 changes: 0 additions & 4 deletions src/gui/qgsvectorlayer.cpp
Expand Up @@ -1414,10 +1414,6 @@ void QgsVectorLayer::showLayerProperties()
#endif
m_propertiesDialog->setDisplayField(displayField());

#ifdef QGISDEBUG
std::cerr << "Resetting prop dialog\n";
#endif
m_propertiesDialog->reset();
#ifdef QGISDEBUG
std::cerr << "Raising prop dialog\n";
#endif
Expand Down

0 comments on commit 5720a46

Please sign in to comment.