Skip to content

Commit

Permalink
apply enableAutoGeometryRestore to feature form dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Feb 1, 2018
1 parent d653fb5 commit 5b9be7a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 37 deletions.
12 changes: 0 additions & 12 deletions python/gui/qgsattributedialog.sip.in
Expand Up @@ -32,18 +32,6 @@ Create an attribute dialog for a given layer and feature

~QgsAttributeDialog();

void saveGeometry();
%Docstring
Saves the size and position for the next time
this dialog box will be used.
%End

void restoreGeometry();
%Docstring
Restores the size and position from the last time
this dialog box was used.
%End

void setHighlight( QgsHighlight *h );
%Docstring
setHighlight
Expand Down
15 changes: 2 additions & 13 deletions src/gui/qgsattributedialog.cpp
Expand Up @@ -17,6 +17,7 @@

#include "qgsattributedialog.h"

#include "qgsgui.h"
#include "qgsattributeform.h"
#include "qgshighlight.h"
#include "qgsapplication.h"
Expand All @@ -40,18 +41,6 @@ QgsAttributeDialog::~QgsAttributeDialog()

if ( mOwnedFeature )
delete mOwnedFeature;

saveGeometry();
}

void QgsAttributeDialog::saveGeometry()
{
QgsSettings().setValue( mSettingsPath + "geometry", QDialog::saveGeometry() );
}

void QgsAttributeDialog::restoreGeometry()
{
QDialog::restoreGeometry( QgsSettings().value( mSettingsPath + "geometry" ).toByteArray() );
}

void QgsAttributeDialog::setHighlight( QgsHighlight *h )
Expand Down Expand Up @@ -85,6 +74,7 @@ void QgsAttributeDialog::reject()

void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const QgsAttributeEditorContext &context, bool showDialogButtons )
{
QgsGui::enableAutoGeometryRestore( this );
QgsAttributeEditorContext trackedContext = context;
setWindowTitle( tr( "%1 - Feature Attributes" ).arg( layer->name() ) );
setLayout( new QGridLayout() );
Expand Down Expand Up @@ -114,7 +104,6 @@ void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const
delete menu;
}

restoreGeometry();
focusNextChild();
}

Expand Down
12 changes: 0 additions & 12 deletions src/gui/qgsattributedialog.h
Expand Up @@ -55,18 +55,6 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog

~QgsAttributeDialog() override;

/**
* Saves the size and position for the next time
* this dialog box will be used.
*/
void saveGeometry();

/**
* Restores the size and position from the last time
* this dialog box was used.
*/
void restoreGeometry();

/**
* \brief setHighlight
* \param h The highlight. Ownership is taken.
Expand Down

0 comments on commit 5b9be7a

Please sign in to comment.