BibleTime
btshortcutseditor.h
Go to the documentation of this file.
1 /*********
2 *
3 * In the name of the Father, and of the Son, and of the Holy Spirit.
4 *
5 * This file is part of BibleTime's source code, https://bibletime.info/
6 *
7 * Copyright 1999-2021 by the BibleTime developers.
8 * The BibleTime source code is licensed under the GNU General Public License
9 * version 2.0.
10 *
11 **********/
12 
13 #pragma once
14 
15 #include <QWidget>
16 
17 #include <QKeySequence>
18 #include <QObject>
19 #include <QString>
20 
21 
22 class BtActionCollection;
23 class BtShortcutsDialog;
24 class QGroupBox;
25 class QLabel;
26 class QPushButton;
27 class QRadioButton;
28 class QTableWidget;
29 
30 // This class is the table in the center of the Shortcuts page of the config dialog
31 class BtShortcutsEditor : public QWidget {
32  Q_OBJECT
33  public:
34  BtShortcutsEditor(BtActionCollection * collection, QWidget * parent);
35 
36  // saves shortcut keys into the QAction
37  void commitChanges();
38 
39  // clears any shortcut keys in the table matching the specified keys
40  void clearConflictWithKeys(QKeySequence const & keys);
41 
42  // finds any shortcut keys in the table matching the specified keys - returns the Action Name for it.
43  QString findConflictWithKeys(QKeySequence const & keys) const;
44 
45  // used by application to complete the keyChangeRequest signal
46  // stores "keys" into the custom shortcuts dialog field
47  void changeShortcutInDialog(QKeySequence const & keys);
48 
49  Q_SIGNALS:
50 
51  void keyChangeRequest(QString const & actionName,
52  QKeySequence const & keys);
53 
54  private Q_SLOTS:
55 
56  // called when a different action name row is selected
57  void slotSelectionChanged();
58 
59  // called when the none radio button is clicked
60  void noneButtonClicked(bool checked);
61 
62  // called when the default radio button is clicked
63  void defaultButtonClicked(bool checked);
64 
65  // called when the custom radio button is clicked
66  void customButtonClicked(bool checked);
67 
68  private:
69 
71  QTableWidget* m_table;
72  QGroupBox * m_shortcutChooser;
73  QRadioButton* m_noneButton;
74  QRadioButton* m_defaultButton;
75  QRadioButton* m_customButton;
76  QPushButton* m_customPushButton;
79 };
BtShortcutsEditor(BtActionCollection *collection, QWidget *parent)
void customButtonClicked(bool checked)
void clearConflictWithKeys(QKeySequence const &keys)
void keyChangeRequest(QString const &actionName, QKeySequence const &keys)
void defaultButtonClicked(bool checked)
QRadioButton * m_noneButton
QTableWidget * m_table
QString findConflictWithKeys(QKeySequence const &keys) const
QRadioButton * m_customButton
void changeShortcutInDialog(QKeySequence const &keys)
QPushButton * m_customPushButton
QRadioButton * m_defaultButton
QGroupBox * m_shortcutChooser
QLabel * m_defaultLabelValue
void noneButtonClicked(bool checked)
BtShortcutsDialog * m_dlg