@@ -83,9 +83,10 @@ QgsPropertyOverrideButton::QgsPropertyOverrideButton( QWidget *parent,
8383}
8484
8585
86- void QgsPropertyOverrideButton::init ( int propertyKey, const QgsProperty &property, const QgsPropertiesDefinition &definitions, const QgsVectorLayer *layer )
86+ void QgsPropertyOverrideButton::init ( int propertyKey, const QgsProperty &property, const QgsPropertiesDefinition &definitions, const QgsVectorLayer *layer, bool auxiliaryStorageEnabled )
8787{
8888 mVectorLayer = layer;
89+ mAuxiliaryStorageEnabled = auxiliaryStorageEnabled;
8990 setToProperty ( property );
9091 mPropertyKey = propertyKey;
9192
@@ -126,9 +127,9 @@ void QgsPropertyOverrideButton::init( int propertyKey, const QgsProperty &proper
126127 updateGui ();
127128}
128129
129- void QgsPropertyOverrideButton::init ( int propertyKey, const QgsAbstractPropertyCollection &collection, const QgsPropertiesDefinition &definitions, const QgsVectorLayer *layer )
130+ void QgsPropertyOverrideButton::init ( int propertyKey, const QgsAbstractPropertyCollection &collection, const QgsPropertiesDefinition &definitions, const QgsVectorLayer *layer, bool auxiliaryStorageEnabled )
130131{
131- init ( propertyKey, collection.property ( propertyKey ), definitions, layer );
132+ init ( propertyKey, collection.property ( propertyKey ), definitions, layer, auxiliaryStorageEnabled );
132133}
133134
134135
@@ -334,18 +335,21 @@ void QgsPropertyOverrideButton::aboutToShowMenu()
334335 mDefineMenu ->addSeparator ();
335336
336337 // deactivate button if field already exists
337- mDefineMenu ->addAction ( mActionCreateAuxiliaryField );
338+ if ( mAuxiliaryStorageEnabled )
339+ {
340+ mDefineMenu ->addAction ( mActionCreateAuxiliaryField );
338341
339- const QgsAuxiliaryLayer *alayer = mVectorLayer ->auxiliaryLayer ();
342+ const QgsAuxiliaryLayer *alayer = mVectorLayer ->auxiliaryLayer ();
340343
341- mActionCreateAuxiliaryField ->setEnabled ( true );
342- mActionCreateAuxiliaryField ->setChecked ( false );
343- if ( alayer && alayer->exists ( mDefinition ) )
344- {
345- if ( mProperty .field () == QgsAuxiliaryField::nameFromProperty ( mDefinition , true ) )
344+ mActionCreateAuxiliaryField ->setEnabled ( true );
345+ mActionCreateAuxiliaryField ->setChecked ( false );
346+ if ( alayer && alayer->exists ( mDefinition ) )
346347 {
347- mActionCreateAuxiliaryField ->setEnabled ( false );
348- mActionCreateAuxiliaryField ->setChecked ( true );
348+ if ( mProperty .field () == QgsAuxiliaryField::nameFromProperty ( mDefinition , true ) )
349+ {
350+ mActionCreateAuxiliaryField ->setEnabled ( false );
351+ mActionCreateAuxiliaryField ->setChecked ( true );
352+ }
349353 }
350354 }
351355
0 commit comments