Skip to content
Permalink
Browse files

apply enableAutoGeometryRestore to feature form dialog

  • Loading branch information
slarosa committed Feb 1, 2018
1 parent d653fb5 commit 5b9be7a96617cc77fb9aeea6445c6096199d6aa2
Showing with 2 additions and 37 deletions.
  1. +0 −12 python/gui/qgsattributedialog.sip.in
  2. +2 −13 src/gui/qgsattributedialog.cpp
  3. +0 −12 src/gui/qgsattributedialog.h
@@ -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
@@ -17,6 +17,7 @@

#include "qgsattributedialog.h"

#include "qgsgui.h"
#include "qgsattributeform.h"
#include "qgshighlight.h"
#include "qgsapplication.h"
@@ -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 )
@@ -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() );
@@ -114,7 +104,6 @@ void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const
delete menu;
}

restoreGeometry();
focusNextChild();
}

@@ -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.

0 comments on commit 5b9be7a

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