Skip to content

Commit 7e2ee74

Browse files
committedNov 6, 2017
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
1 parent 52240ad commit 7e2ee74

File tree

5 files changed

+22
-27
lines changed

5 files changed

+22
-27
lines changed
 

‎src/app/qgsattributesformproperties.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void QgsAttributesFormProperties::init()
7878

7979
initLayoutConfig();
8080
initInitPython();
81+
initSuppressCombo();
8182

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

159160
void QgsAttributesFormProperties::initSuppressCombo()
160161
{
161-
//mFormSuppressCmbBx->addItem( tr( "" ) );
162-
//mFormSuppressCmbBx->addItem( tr( "Load from external file" ) );
163-
//mFormSuppressCmbBx->addItem( tr( "Provide code in this dialog" ) );
164-
//mFormSuppressCmbBx->addItem( tr( "Load from the environment" ) );
162+
QgsSettings settings;
163+
164+
if ( settings.value( QStringLiteral( "qgis/digitizing/disable_enter_attribute_values_dialog" ), false ).toBool() )
165+
{
166+
mFormSuppressCmbBx->addItem( tr( "Hide form on add feature (global settings)" ) );
167+
}
168+
else
169+
{
170+
mFormSuppressCmbBx->addItem( tr( "Show form on add feature (global settings)" ) );
171+
}
172+
mFormSuppressCmbBx->addItem( tr( "Hide form on add feature" ) );
173+
mFormSuppressCmbBx->addItem( tr( "Show form on add feature" ) );
174+
165175
mFormSuppressCmbBx->setCurrentIndex( mLayer->editFormConfig().suppress() );
166176

167177

‎src/app/qgsattributetypedialog.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,3 @@ QStandardItem *QgsAttributeTypeDialog::currentItem() const
400400
QStandardItemModel *widgetTypeModel = qobject_cast<QStandardItemModel *>( mWidgetTypeComboBox->model() );
401401
return widgetTypeModel->item( mWidgetTypeComboBox->currentIndex() );
402402
}
403-
404-
void QgsAttributeTypeDialog::showHelp()
405-
{
406-
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#configure-the-field-behavior" ) );
407-
}

‎src/app/qgsattributetypedialog.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ class APP_EXPORT QgsAttributeTypeDialog: public QWidget, private Ui::QgsAttribut
200200

201201
void defaultExpressionChanged();
202202

203-
void showHelp();
204-
205203
private:
206204
QgsVectorLayer *mLayer = nullptr;
207205
int mFieldIdx;

‎src/app/qgsvectorlayerproperties.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,14 @@ void QgsVectorLayerProperties::updateFieldsPropertiesDialog()
15281528

15291529
void QgsVectorLayerProperties::showHelp()
15301530
{
1531-
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html" ) );
1531+
if ( mOptionsListWidget->currentIndex().data().toString() == "Form" )
1532+
{
1533+
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#configure-the-field-behavior" ) );
1534+
}
1535+
else
1536+
{
1537+
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html" ) );
1538+
}
15321539
}
15331540

15341541
void QgsVectorLayerProperties::updateAuxiliaryStoragePage( bool reset )

‎src/ui/qgsattributesformproperties.ui

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,6 @@ Use this function to add extra logic to your forms.</string>
6565
<verstretch>0</verstretch>
6666
</sizepolicy>
6767
</property>
68-
<item>
69-
<property name="text">
70-
<string>Use default show form config</string>
71-
</property>
72-
</item>
73-
<item>
74-
<property name="text">
75-
<string>Show form on add feature</string>
76-
</property>
77-
</item>
78-
<item>
79-
<property name="text">
80-
<string>Hide form on add feature</string>
81-
</property>
82-
</item>
8368
</widget>
8469
</item>
8570
</layout>

0 commit comments

Comments
 (0)
Please sign in to comment.