| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef KEYBOARDSHORTCUTS_H |
| 24 |
#define KEYBOARDSHORTCUTS_H |
| 25 |
|
| 26 |
#include <QtWidgets> |
| 27 |
|
| 28 |
#include "ui_keyboardshortcuts.h" |
| 29 |
#include "ui_keyselector.h" |
| 30 |
|
| 31 |
class QAction; |
| 32 |
|
| 33 |
class KeyboardShortcuts : public QDialog, private Ui::KeyboardShortcuts |
| 34 |
{ |
| 35 |
Q_OBJECT |
| 36 |
|
| 37 |
public: |
| 38 |
KeyboardShortcuts(QWidget *parent, const QVector<QAction *> keyActions); |
| 39 |
~KeyboardShortcuts(); |
| 40 |
|
| 41 |
void refreshTable(); |
| 42 |
bool shortcutTaken(QString shortcut); |
| 43 |
bool needsSave() { return m_modified; } |
| 44 |
|
| 45 |
private: |
| 46 |
QVector<QAction *> m_keyActions; |
| 47 |
bool m_modified; |
| 48 |
|
| 49 |
private slots: |
| 50 |
void restoreDefaults(); |
| 51 |
void assignShortcut(int row, int column); |
| 52 |
QString getShortcut(QString action); |
| 53 |
|
| 54 |
signals: |
| 55 |
void restoreDefaultShortcuts(); |
| 56 |
}; |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
class KeySelector : public QDialog, private Ui::KeySelectorDialog |
| 61 |
{ |
| 62 |
Q_OBJECT |
| 63 |
|
| 64 |
public: |
| 65 |
KeySelector(QWidget *parent, QString command, QString currentShortcut); |
| 66 |
~KeySelector(); |
| 67 |
QString newShortcut; |
| 68 |
|
| 69 |
protected: |
| 70 |
virtual void keyPressEvent(QKeyEvent *event); |
| 71 |
}; |
| 72 |
|
| 73 |
#endif |