Skip to content

Commit

Permalink
[FEATURE] make restriction to change only common properties of unique…
Browse files Browse the repository at this point in the history
… value classes optional (fixes #1703)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11229 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 31, 2009
1 parent 024529e commit 414f768
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/app/qgsuniquevaluedialog.cpp
Expand Up @@ -102,6 +102,7 @@ QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVe
QObject::connect( mRandomizeColors, SIGNAL( clicked() ), this, SLOT( randomizeColors() ) );
QObject::connect( mResetColors, SIGNAL( clicked() ), this, SLOT( resetColors() ) );
QObject::connect( mClassListWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( selectionChanged() ) );
QObject::connect( mCommonPropertyLock, SIGNAL( clicked() ), this, SLOT( selectionChanged() ) );
QObject::connect( mClassListWidget, SIGNAL( itemChanged( QListWidgetItem * ) ), this, SLOT( itemChanged( QListWidgetItem * ) ) );
QObject::connect( &sydialog, SIGNAL( settingsChanged() ), this, SLOT( applySymbologyChanges() ) );
mSymbolWidgetStack->addWidget( &sydialog );
Expand Down Expand Up @@ -348,7 +349,7 @@ void QgsUniqueValueDialog::selectionChanged()
{
mDeletePushButton->setEnabled( true );

if ( selection.size() == 1 )
if ( selection.size() == 1 || !mCommonPropertyLock->isChecked() )
{
QListWidgetItem *item = selection[0];
if ( !item )
Expand All @@ -361,7 +362,7 @@ void QgsUniqueValueDialog::selectionChanged()
sydialog.set( symbol );
sydialog.setLabel( symbol->label() );
}
else if ( selection.size() > 1 )
else if ( selection.size() > 1 && mCommonPropertyLock->isChecked() )
{
if ( !mValues.contains( selection[0]->text() ) )
return;
Expand Down
12 changes: 11 additions & 1 deletion src/ui/qgsuniquevaluedialogbase.ui
Expand Up @@ -124,7 +124,7 @@
</item>
</layout>
</item>
<item row="2" column="0" >
<item row="2" column="0" rowspan="2" >
<widget class="QListWidget" name="mClassListWidget" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
Expand All @@ -146,6 +146,16 @@
<widget class="QWidget" name="page_2" />
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="mCommonPropertyLock">
<property name="text">
<string>Restrict changes to common properties</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
Expand Down

0 comments on commit 414f768

Please sign in to comment.