Skip to content

Commit 2e8ba8b

Browse files
committedMay 21, 2014
Save dialog geometry on attribute form reject
1 parent 885a303 commit 2e8ba8b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
 

‎src/gui/qgsattributedialog.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ void QgsAttributeDialog::init()
444444
buttonBox->setStandardButtons( QDialogButtonBox::Cancel );
445445
}
446446

447-
connect( buttonBox, SIGNAL( rejected() ), mDialog, SLOT( reject() ) );
447+
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
448448
}
449449
}
450450
else
@@ -557,6 +557,16 @@ QgsAttributeDialog::~QgsAttributeDialog()
557557
}
558558
}
559559

560+
void QgsAttributeDialog::reject()
561+
{
562+
// Only save the geometry of the dialog if it's not a custom one.
563+
if ( mLayer->editorLayout() != QgsVectorLayer::UiFileLayout )
564+
{
565+
saveGeometry();
566+
}
567+
mDialog->reject();
568+
}
569+
560570
void QgsAttributeDialog::accept()
561571
{
562572
if ( !mLayer->isEditable() || !mFeature )

‎src/gui/qgsattributedialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class GUI_EXPORT QgsAttributeDialog : public QObject
8888
bool editable() { return mEditable; }
8989

9090
public slots:
91+
void reject();
9192
void accept();
9293

9394
int exec();

0 commit comments

Comments
 (0)
Please sign in to comment.