Sayonara Player
GUI_ShortcutEntry.h
1 
2 /* Copyright (C) 2011-2017 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 #ifndef GUI_SHORTCUTENTRY_H
21 #define GUI_SHORTCUTENTRY_H
22 
23 #include "GUI/Helper/Shortcuts/Shortcut.h"
24 #include "GUI/Helper/SayonaraWidget/SayonaraWidget.h"
25 
26 
27 namespace Ui { class GUI_ShortcutEntry; }
32 class ShortcutHandler;
33 class Shortcut;
35  public SayonaraWidget
36 {
37  Q_OBJECT
38 
39 signals:
44  void sig_test_pressed(const QList<QKeySequence>& sequences);
45 
46  void sig_sequence_entered();
47 
48 public:
49  explicit 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 private:
71  Ui::GUI_ShortcutEntry* ui=nullptr;
72  ShortcutHandler* _sch=nullptr;
73  QString _key;
74  Shortcut _shortcut;
75 };
76 
77 #endif // GUI_SHORTCUTENTRY_H
Definition: GUI_ShortcutEntry.h:34
Definition: ui_GUI_SomaFM.h:216
Definition: ui_GUI_ShortcutEntry.h:106
A singleton class for retrieving shortcuts.
Definition: ShortcutHandler.h:35
A single shortcut managed by ShortcutHandler. This class holds information about the default shortcut...
Definition: Shortcut.h:41
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() wi...
Definition: SayonaraWidget.h:36
Definition: org_mpris_media_player2_adaptor.h:20