diff options
author | Gehad <gehadelrobey@gmail.com> | 2014-04-25 20:32:02 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-04-25 13:24:39 -0700 |
commit | 1306c0fecbd958656ba312be7e8ba1428f876183 (patch) | |
tree | 11b5112201a81251eac80953cc2d0c97dd23f4b9 /qt-ui/preferences.cpp | |
parent | b4a04074c240f8c337dd1423950e1da7eb66f9f4 (diff) | |
download | subsurface-1306c0fecbd958656ba312be7e8ba1428f876183.tar.gz |
Fixing Hotkeys inconsistency for divecomputer/pref/numbering windows
Fixing the Hotkeys inconsistencies in subsurface, All the popups should
react to 'esc' and 'ctrl-w'/'cmd-w' as 'cancel'. also 'ctrl-q'/'cmd-q'
should quit subsurface.
Fixes #489
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/preferences.cpp')
-rw-r--r-- | qt-ui/preferences.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index c93dd3628..c7aec14a6 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -5,6 +5,7 @@ #include <QFileDialog> #include <QMessageBox> #include <QSortFilterProxyModel> +#include <QShortcut> PreferencesDialog *PreferencesDialog::instance() { @@ -20,6 +21,10 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WindowFlags f) : QDial connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *))); connect(ui.gflow, SIGNAL(valueChanged(int)), this, SLOT(gflowChanged(int))); connect(ui.gfhigh, SIGNAL(valueChanged(int)), this, SLOT(gfhighChanged(int))); + QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this); + connect(close, SIGNAL(activated()), this, SLOT(close())); + QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this); + connect(quit, SIGNAL(activated()), parent, SLOT(close())); loadSettings(); setUiFromPrefs(); rememberPrefs(); |