Commit c8540099 authored by Yoann Peronneau's avatar Yoann Peronneau

* QT prefs: escape key closes the dialog

parent c6e9c5ac
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <QCheckBox> #include <QCheckBox>
#include <QScrollArea> #include <QScrollArea>
#include <QMessageBox> #include <QMessageBox>
#include <QKeyEvent>
PrefsDialog *PrefsDialog::instance = NULL; PrefsDialog *PrefsDialog::instance = NULL;
...@@ -268,3 +269,11 @@ void PrefsDialog::reset() ...@@ -268,3 +269,11 @@ void PrefsDialog::reset()
config_SaveConfigFile( p_intf, NULL ); config_SaveConfigFile( p_intf, NULL );
} }
} }
void PrefsDialog::keyPressEvent( QKeyEvent *e )
{
if( e->key() == Qt::Key_Escape )
{
cancel();
}
}
...@@ -79,13 +79,14 @@ private: ...@@ -79,13 +79,14 @@ private:
static PrefsDialog *instance; static PrefsDialog *instance;
private slots: private slots:
void changePanel( QTreeWidgetItem *); void changePanel( QTreeWidgetItem * );
void changeSimplePanel( QListWidgetItem *); void changeSimplePanel( QListWidgetItem * );
void setAll(); void setAll();
void setSmall(); void setSmall();
void save(); void save();
void cancel(); void cancel();
void reset(); void reset();
void keyPressEvent( QKeyEvent * );
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment