Skip to content
Permalink
Browse files

Fixed save/load from DB sync init

  • Loading branch information
elpaso committed Nov 5, 2015
1 parent 42239bc commit 322496a704394c0d02295793dd6852d107c1f5dc
@@ -211,6 +211,15 @@ QTreeWidgetItem *QgsFieldsProperties::loadAttributeEditorTreeItem( QgsAttributeE
return newWidget;
}

void QgsFieldsProperties::setEditFormInit( const QString &editForm, const QString &editFormInit, const QString &editFormInitCode, const bool editFormInitUseCode )
{
leEditForm->setText( editForm );
leEditFormInit->setText( editFormInit );
leEditFormInitCode->setText( editFormInitCode );
leEditFormInitUseCode->setChecked( editFormInitUseCode );
}


void QgsFieldsProperties::loadAttributeEditorTree()
{
// tabs and groups info
@@ -160,6 +160,15 @@ class APP_EXPORT QgsFieldsProperties : public QWidget, private Ui_QgsFieldsPrope
void loadAttributeEditorTree();
QTreeWidgetItem *loadAttributeEditorTreeItem( QgsAttributeEditorElement* const widgetDef, QTreeWidgetItem* parent );

/**
* @brief setEditFormInit set the private ui fields
* @param editForm
* @param editFormInit
* @param editFormInitCode
* @param editFormInitUseCode
*/
void setEditFormInit( const QString &editForm, const QString &editFormInit, const QString &editFormInitCode, const bool editFormInitUseCode );

signals:
void toggleEditing();

@@ -505,6 +505,10 @@ void QgsVectorLayerProperties::syncToLayer( void )

// set initial state for variable editor
updateVariableEditor();

// updates the init python code and ui
updateFieldsPropertiesDialog();

} // syncToLayer()


@@ -1299,3 +1303,8 @@ void QgsVectorLayerProperties::updateVariableEditor()
mVariableEditor->reloadContext();
mVariableEditor->setEditableScopeIndex( 2 );
}

void QgsVectorLayerProperties::updateFieldsPropertiesDialog()
{
mFieldsPropertiesDialog->setEditFormInit( layer->editForm(), layer->editFormInit(), layer->editFormInitCode(), layer->editFormInitUseCode() );
}
@@ -145,6 +145,11 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
*/
void updateVariableEditor();

/**
* @brief updates the FieldsPropertiesDialog when syncing the layer properties
*/
void updateFieldsPropertiesDialog();

protected:

void saveStyleAs( StyleType styleType );
@@ -1635,6 +1635,7 @@ bool QgsVectorLayer::writeXml( QDomNode & layer_node,
return writeSymbology( layer_node, document, errorMsg );
} // bool QgsVectorLayer::writeXml


bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage )
{
emit readCustomSymbology( node.toElement(), errorMessage );
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>742</width>
<width>965</width>
<height>634</height>
</rect>
</property>
@@ -250,8 +250,6 @@ MyForms.py must live on PYTHONPATH, .qgis/python, or inside the project folder.<
<bool>true</bool>
</property>
<layout class="QGridLayout" name="mRelationsFrameLayout"/>
<zorder>leEditFormInitCode</zorder>
<zorder>mPythonInitCodeGroupBox</zorder>
</widget>
<widget class="QgsCollapsibleGroupBox" name="mPythonInitCodeGroupBox">
<property name="enabled">

0 comments on commit 322496a

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