mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									b4a04074c2
								
							
						
					
					
						commit
						1306c0fecb
					
				
					 3 changed files with 16 additions and 2 deletions
				
			
		|  | @ -1,9 +1,10 @@ | ||||||
| #include "divecomputermanagementdialog.h" | #include "divecomputermanagementdialog.h" | ||||||
| #include "models.h" | #include "models.h" | ||||||
| #include "mainwindow.h" | #include "mainwindow.h" | ||||||
|  | #include "qthelper.h" | ||||||
|  | #include "helpers.h" | ||||||
| #include <QMessageBox> | #include <QMessageBox> | ||||||
| #include "../qthelper.h" | #include <QShortcut> | ||||||
| #include "../helpers.h" |  | ||||||
| 
 | 
 | ||||||
| DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), | DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), | ||||||
| 	model(0) | 	model(0) | ||||||
|  | @ -11,6 +12,10 @@ DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt:: | ||||||
| 	ui.setupUi(this); | 	ui.setupUi(this); | ||||||
| 	init(); | 	init(); | ||||||
| 	connect(ui.tableView, SIGNAL(clicked(QModelIndex)), this, SLOT(tryRemove(QModelIndex))); | 	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() | void DiveComputerManagementDialog::init() | ||||||
|  |  | ||||||
|  | @ -5,6 +5,7 @@ | ||||||
| #include <QFileDialog> | #include <QFileDialog> | ||||||
| #include <QMessageBox> | #include <QMessageBox> | ||||||
| #include <QSortFilterProxyModel> | #include <QSortFilterProxyModel> | ||||||
|  | #include <QShortcut> | ||||||
| 
 | 
 | ||||||
| PreferencesDialog *PreferencesDialog::instance() | 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.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *))); | ||||||
| 	connect(ui.gflow, SIGNAL(valueChanged(int)), this, SLOT(gflowChanged(int))); | 	connect(ui.gflow, SIGNAL(valueChanged(int)), this, SLOT(gflowChanged(int))); | ||||||
| 	connect(ui.gfhigh, SIGNAL(valueChanged(int)), this, SLOT(gfhighChanged(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(); | 	loadSettings(); | ||||||
| 	setUiFromPrefs(); | 	setUiFromPrefs(); | ||||||
| 	rememberPrefs(); | 	rememberPrefs(); | ||||||
|  |  | ||||||
|  | @ -129,6 +129,10 @@ RenumberDialog::RenumberDialog(QWidget *parent) : QDialog(parent) | ||||||
| { | { | ||||||
| 	ui.setupUi(this); | 	ui.setupUi(this); | ||||||
| 	connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *))); | 	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() | ShiftTimesDialog *ShiftTimesDialog::instance() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue