mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Merge pull request #36 from spilth/master
Shortcuts dialog now remembers window state between uses
This commit is contained in:
commit
2de610b350
@ -43,8 +43,33 @@ QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget* parent )
|
||||
this, SLOT( actionChanged( QTreeWidgetItem*, QTreeWidgetItem* ) ) );
|
||||
|
||||
populateActions();
|
||||
|
||||
restoreState();
|
||||
}
|
||||
|
||||
QgsConfigureShortcutsDialog::~QgsConfigureShortcutsDialog()
|
||||
{
|
||||
saveState();
|
||||
}
|
||||
|
||||
/*!
|
||||
* Function to save dialog window state
|
||||
*/
|
||||
void QgsConfigureShortcutsDialog::saveState()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue( "/Windows/ShortcutsDialog/geometry", saveGeometry() );
|
||||
}
|
||||
|
||||
/*!
|
||||
* Function to restore dialog window state
|
||||
*/
|
||||
void QgsConfigureShortcutsDialog::restoreState()
|
||||
{
|
||||
QSettings settings;
|
||||
restoreGeometry( settings.value( "/Windows/ShortcutsDialog/geometry" ).toByteArray() );
|
||||
}
|
||||
|
||||
void QgsConfigureShortcutsDialog::populateActions()
|
||||
{
|
||||
QList<QAction*> actions = QgsShortcutsManager::instance()->listActions();
|
||||
|
@ -26,7 +26,8 @@ class QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShor
|
||||
|
||||
public:
|
||||
QgsConfigureShortcutsDialog( QWidget* parent = NULL );
|
||||
|
||||
~QgsConfigureShortcutsDialog();
|
||||
|
||||
void populateActions();
|
||||
|
||||
protected:
|
||||
@ -51,6 +52,18 @@ class QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShor
|
||||
protected:
|
||||
bool mGettingShortcut;
|
||||
int mModifiers, mKey;
|
||||
|
||||
private:
|
||||
/*!
|
||||
* Function to save dialog window state
|
||||
*/
|
||||
void saveState();
|
||||
|
||||
/*!
|
||||
* Function to restore dialog window state
|
||||
*/
|
||||
void restoreState();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user