Skip to content
Permalink
Browse files

apply enableAutoGeometryRestore to config shortcut dialog

  • Loading branch information
slarosa committed Jan 28, 2018
1 parent bcbc46b commit 3ca5d72455b8832beabd56e3f454f89596ed4081
@@ -33,8 +33,6 @@ Constructor for QgsConfigureShortcutsDialog.
singleton QgsShortcutsManager instance.
%End

~QgsConfigureShortcutsDialog();

protected:
virtual void keyPressEvent( QKeyEvent *event );

@@ -34,6 +34,7 @@ QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget *parent, QgsSh
, mManager( manager )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( mLeFilter, &QgsFilterLineEdit::textChanged, this, &QgsConfigureShortcutsDialog::mLeFilter_textChanged );

if ( !mManager )
@@ -50,25 +51,6 @@ QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget *parent, QgsSh
this, &QgsConfigureShortcutsDialog::actionChanged );

populateActions();

restoreState();
}

QgsConfigureShortcutsDialog::~QgsConfigureShortcutsDialog()
{
saveState();
}

void QgsConfigureShortcutsDialog::saveState()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/ShortcutsDialog/geometry" ), saveGeometry() );
}

void QgsConfigureShortcutsDialog::restoreState()
{
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/ShortcutsDialog/geometry" ) ).toByteArray() );
}

void QgsConfigureShortcutsDialog::populateActions()
@@ -47,8 +47,6 @@ class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsCo
*/
QgsConfigureShortcutsDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsShortcutsManager *manager = nullptr );

~QgsConfigureShortcutsDialog() override;

protected:
void keyPressEvent( QKeyEvent *event ) override;
void keyReleaseEvent( QKeyEvent *event ) override;
@@ -68,12 +66,6 @@ class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsCo

private:

//! Saves the dialog window state
void saveState();

//! Restores the dialog window state
void restoreState();

//! Populates the dialog with all actions from the manager
void populateActions();

0 comments on commit 3ca5d72

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