aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/divecomputermanagementdialog.cpp9
-rw-r--r--qt-ui/preferences.cpp5
-rw-r--r--qt-ui/simplewidgets.cpp4
3 files changed, 16 insertions, 2 deletions
diff --git a/qt-ui/divecomputermanagementdialog.cpp b/qt-ui/divecomputermanagementdialog.cpp
index 238830bd0..7d52e838b 100644
--- a/qt-ui/divecomputermanagementdialog.cpp
+++ b/qt-ui/divecomputermanagementdialog.cpp
@@ -1,9 +1,10 @@
#include "divecomputermanagementdialog.h"
#include "models.h"
#include "mainwindow.h"
+#include "qthelper.h"
+#include "helpers.h"
#include <QMessageBox>
-#include "../qthelper.h"
-#include "../helpers.h"
+#include <QShortcut>
DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f),
model(0)
@@ -11,6 +12,10 @@ DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::
ui.setupUi(this);
init();
connect(ui.tableView, SIGNAL(clicked(QModelIndex)), this, SLOT(tryRemove(QModelIndex)));
+ 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()));
}
void DiveComputerManagementDialog::init()
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();
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index 475276875..e6720509f 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -129,6 +129,10 @@ RenumberDialog::RenumberDialog(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
+ 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()));
}
ShiftTimesDialog *ShiftTimesDialog::instance()