Skip to content

Commit

Permalink
help and suppress form
Browse files Browse the repository at this point in the history
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 7e2ee74
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 27 deletions.
18 changes: 14 additions & 4 deletions src/app/qgsattributesformproperties.cpp
Expand Up @@ -78,6 +78,7 @@ void QgsAttributesFormProperties::init()

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

mAttributeTypeDialog->setEnabled( false );
mAttributeRelationEdit->setEnabled( false );
Expand Down Expand Up @@ -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() );


Expand Down
5 changes: 0 additions & 5 deletions src/app/qgsattributetypedialog.cpp
Expand Up @@ -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" ) );
}
2 changes: 0 additions & 2 deletions src/app/qgsattributetypedialog.h
Expand Up @@ -200,8 +200,6 @@ class APP_EXPORT QgsAttributeTypeDialog: public QWidget, private Ui::QgsAttribut

void defaultExpressionChanged();

void showHelp();

private:
QgsVectorLayer *mLayer = nullptr;
int mFieldIdx;
Expand Down
9 changes: 8 additions & 1 deletion src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -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 )
Expand Down
15 changes: 0 additions & 15 deletions src/ui/qgsattributesformproperties.ui
Expand Up @@ -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>
Expand Down

0 comments on commit 7e2ee74

Please sign in to comment.