Skip to content
Permalink
Browse files

help and suppress form

help from attributetypedialog is handled over the help of vectorlayerproperties
suppress form combo takes the default value from the settings
fixed troubles on loading gui
  • Loading branch information
signedav committed Nov 6, 2017
1 parent 52240ad commit 7e2ee74da806d932e8b92a0e096d6f69c0cea364
@@ -78,6 +78,7 @@ void QgsAttributesFormProperties::init()

initLayoutConfig();
initInitPython();
initSuppressCombo();

mAttributeTypeDialog->setEnabled( false );
mAttributeRelationEdit->setEnabled( false );
@@ -158,10 +159,19 @@ void QgsAttributesFormProperties::initFormLayoutTree()

void QgsAttributesFormProperties::initSuppressCombo()
{
//mFormSuppressCmbBx->addItem( tr( "" ) );
//mFormSuppressCmbBx->addItem( tr( "Load from external file" ) );
//mFormSuppressCmbBx->addItem( tr( "Provide code in this dialog" ) );
//mFormSuppressCmbBx->addItem( tr( "Load from the environment" ) );
QgsSettings settings;

if ( settings.value( QStringLiteral( "qgis/digitizing/disable_enter_attribute_values_dialog" ), false ).toBool() )
{
mFormSuppressCmbBx->addItem( tr( "Hide form on add feature (global settings)" ) );
}
else
{
mFormSuppressCmbBx->addItem( tr( "Show form on add feature (global settings)" ) );
}
mFormSuppressCmbBx->addItem( tr( "Hide form on add feature" ) );
mFormSuppressCmbBx->addItem( tr( "Show form on add feature" ) );

mFormSuppressCmbBx->setCurrentIndex( mLayer->editFormConfig().suppress() );


@@ -400,8 +400,3 @@ QStandardItem *QgsAttributeTypeDialog::currentItem() const
QStandardItemModel *widgetTypeModel = qobject_cast<QStandardItemModel *>( mWidgetTypeComboBox->model() );
return widgetTypeModel->item( mWidgetTypeComboBox->currentIndex() );
}

void QgsAttributeTypeDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#configure-the-field-behavior" ) );
}
@@ -200,8 +200,6 @@ class APP_EXPORT QgsAttributeTypeDialog: public QWidget, private Ui::QgsAttribut

void defaultExpressionChanged();

void showHelp();

private:
QgsVectorLayer *mLayer = nullptr;
int mFieldIdx;
@@ -1528,7 +1528,14 @@ void QgsVectorLayerProperties::updateFieldsPropertiesDialog()

void QgsVectorLayerProperties::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html" ) );
if ( mOptionsListWidget->currentIndex().data().toString() == "Form" )
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#configure-the-field-behavior" ) );
}
else
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html" ) );
}
}

void QgsVectorLayerProperties::updateAuxiliaryStoragePage( bool reset )
@@ -65,21 +65,6 @@ Use this function to add extra logic to your forms.</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Use default show form config</string>
</property>
</item>
<item>
<property name="text">
<string>Show form on add feature</string>
</property>
</item>
<item>
<property name="text">
<string>Hide form on add feature</string>
</property>
</item>
</widget>
</item>
</layout>

0 comments on commit 7e2ee74

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