Skip to content
Permalink
Browse files

Save collapsed state for relation editor widgets individually

  • Loading branch information
m-kuhn committed Jun 1, 2015
1 parent 5d38bd1 commit b2846688529251b6c1469acb6fe08edb30764231
Showing with 12 additions and 1 deletion.
  1. +11 −0 src/gui/qgsrelationeditorwidget.cpp
  2. +1 −1 src/gui/qgsrelationeditorwidget.h
@@ -153,6 +153,9 @@ void QgsRelationEditorWidget::setRelationFeature( const QgsRelation& relation, c
mToggleEditingButton->setEnabled( false );
}

setObjectName( mRelation.name() );
loadState();

// If not yet initialized, it is not (yet) visible, so we don't load it to be faster (lazy loading)
// If it is already initialized, it has been set visible before and the currently shown feature is changing
// and the widget needs updating
@@ -176,6 +179,14 @@ void QgsRelationEditorWidget::setViewMode( QgsDualView::ViewMode mode )
mViewMode = mode;
}

void QgsRelationEditorWidget::setQgisRelation( QString qgisRelationId )
{
mRelationId = qgisRelationId;
// by setting the object name appropriately we can properly save the collapsed state
setObjectName( qgisRelationId );
loadState();
}

void QgsRelationEditorWidget::referencingLayerEditingToggled()
{
bool editable = false;
@@ -49,7 +49,7 @@ class GUI_EXPORT QgsRelationEditorWidget : public QgsCollapsibleGroupBox

//! Defines the relation ID (from project relations)
//! @note use a widget's property to keep compatibility with using basic widget instead of QgsRelationEditorWidget
void setQgisRelation( QString qgisRelationId ) { mRelationId = qgisRelationId; }
void setQgisRelation( QString qgisRelationId );
QString qgisRelation() { return mRelationId; } //property( "qgisRelation" ).toString()

void setRelationFeature( const QgsRelation& relation, const QgsFeature& feature );

0 comments on commit b284668

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