Skip to content
Permalink
Browse files
Save dialog geometry on attribute form reject
  • Loading branch information
NathanW2 committed May 21, 2014
1 parent 885a303 commit 2e8ba8b13c45aca78de543d70f54c5e687021e03
Showing with 12 additions and 1 deletion.
  1. +11 −1 src/gui/qgsattributedialog.cpp
  2. +1 −0 src/gui/qgsattributedialog.h
@@ -444,7 +444,7 @@ void QgsAttributeDialog::init()
buttonBox->setStandardButtons( QDialogButtonBox::Cancel );
}

connect( buttonBox, SIGNAL( rejected() ), mDialog, SLOT( reject() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
}
}
else
@@ -557,6 +557,16 @@ QgsAttributeDialog::~QgsAttributeDialog()
}
}

void QgsAttributeDialog::reject()
{
// Only save the geometry of the dialog if it's not a custom one.
if ( mLayer->editorLayout() != QgsVectorLayer::UiFileLayout )
{
saveGeometry();
}
mDialog->reject();
}

void QgsAttributeDialog::accept()
{
if ( !mLayer->isEditable() || !mFeature )
@@ -88,6 +88,7 @@ class GUI_EXPORT QgsAttributeDialog : public QObject
bool editable() { return mEditable; }

public slots:
void reject();
void accept();

int exec();

0 comments on commit 2e8ba8b

Please sign in to comment.