Sayonara Player
GUI_ShortcutEntry.h
1 
2 /* Copyright (C) 2011-2016 Lucio Carreras
3  *
4  * This file is part of sayonara player
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15 
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 
21 
22 #ifndef GUI_SHORTCUTENTRY_H
23 #define GUI_SHORTCUTENTRY_H
24 
25 #include "GUI/Helper/SayonaraWidget/SayonaraWidget.h"
26 #include "GUI/Helper/Shortcuts/ShortcutHandler.h"
27 #include "GUI/Preferences/ui_GUI_ShortcutEntry.h"
28 
29 
35  public SayonaraWidget,
36  private Ui::GUI_ShortcutEntry
37 {
38  Q_OBJECT
39 
40 signals:
45  void sig_test_pressed(const QList<QKeySequence>& sequences);
46 
47  void sig_sequence_entered();
48 
49 public:
50  GUI_ShortcutEntry(const Shortcut& shortcut, QWidget* parent=nullptr);
51 
52  QList<QKeySequence> get_sequences() const;
53  void show_sequence_error();
54 
55 public slots:
56  void commit();
57  void clear();
58  void revert();
59 
60 
61 private slots:
62  void edit_clicked();
63  void default_clicked();
64  void test_clicked();
65 
66  void language_changed() override;
67  void skin_changed() override;
68 
69 
70 
71 private:
72  ShortcutHandler* _sch=nullptr;
73  QString _key;
74  Shortcut _shortcut;
75 };
76 
77 
78 #endif // GUI_SHORTCUTENTRY_H
The delegate class for displaying a shortcut.
Definition: GUI_ShortcutEntry.h:34
Definition: ui_GUI_ShortcutEntry.h:106
A singleton class for retrieving shortcuts.
Definition: ShortcutHandler.h:41
void sig_test_pressed(const QList< QKeySequence > &sequences)
signal is emitted when the test button is pressed
A single shortcut managed by ShortcutHandler. This class holds information about the default shortcut...
Definition: Shortcut.h:42
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() wi...
Definition: SayonaraWidget.h:41
Definition: org_mpris_media_player2_adaptor.h:20