Skip to content

Commit

Permalink
Save dialog geometry on attribute form reject
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed May 21, 2014
1 parent 885a303 commit 2e8ba8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/gui/qgsattributedialog.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsattributedialog.h
Expand Up @@ -88,6 +88,7 @@ class GUI_EXPORT QgsAttributeDialog : public QObject
bool editable() { return mEditable; }

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

int exec();
Expand Down

0 comments on commit 2e8ba8b

Please sign in to comment.