1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
3 |
|
---|
4 | This program is free software; you can redistribute it and/or modify
|
---|
5 | it under the terms of the GNU General Public License as published by
|
---|
6 | the Free Software Foundation; either version 2 of the License, or
|
---|
7 | (at your option) any later version.
|
---|
8 |
|
---|
9 | This program is distributed in the hope that it will be useful,
|
---|
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | GNU General Public License for more details.
|
---|
13 |
|
---|
14 | You should have received a copy of the GNU General Public License
|
---|
15 | along with this program; if not, write to the Free Software
|
---|
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
17 |
|
---|
18 | Note: The ShortcutGetter class is taken from the source code of Edyuk
|
---|
19 | (http://www.edyuk.org/), from file 3rdparty/qcumber/qshortcutdialog.cpp
|
---|
20 |
|
---|
21 | Copyright (C) 2006 FullMetalCoder
|
---|
22 | License: GPL
|
---|
23 |
|
---|
24 | I modified it to support multiple shortcuts and some other few changes.
|
---|
25 | */
|
---|
26 |
|
---|
27 |
|
---|
28 | #ifndef SHORTCUTGETTER_H
|
---|
29 | #define SHORTCUTGETTER_H
|
---|
30 |
|
---|
31 | #include <QDialog>
|
---|
32 | #include <QListWidget>
|
---|
33 |
|
---|
34 | class QLineEdit;
|
---|
35 |
|
---|
36 | class ShortcutGetter : public QDialog
|
---|
37 | {
|
---|
38 | Q_OBJECT
|
---|
39 |
|
---|
40 | public:
|
---|
41 | ShortcutGetter(QWidget *parent = 0);
|
---|
42 |
|
---|
43 | QString exec(const QString& s);
|
---|
44 |
|
---|
45 | protected slots:
|
---|
46 | void setCaptureKeyboard(bool b);
|
---|
47 | void rowChanged(int row);
|
---|
48 | void textChanged(const QString & text);
|
---|
49 |
|
---|
50 | void addItemClicked();
|
---|
51 | void removeItemClicked();
|
---|
52 |
|
---|
53 | protected:
|
---|
54 | bool captureKeyboard() { return capture; };
|
---|
55 |
|
---|
56 | bool event(QEvent *e);
|
---|
57 | bool eventFilter(QObject *o, QEvent *e);
|
---|
58 | void setText();
|
---|
59 |
|
---|
60 | private:
|
---|
61 | bool bStop;
|
---|
62 | QLineEdit *leKey;
|
---|
63 | QStringList lKeys;
|
---|
64 | bool capture;
|
---|
65 |
|
---|
66 | QListWidget * list;
|
---|
67 | QPushButton * addItem;
|
---|
68 | QPushButton * removeItem;
|
---|
69 | };
|
---|
70 |
|
---|
71 | #endif
|
---|