[112] | 1 | /* smplayer, GUI front-end for mplayer.
|
---|
[188] | 2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
[112] | 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
|
---|
[176] | 19 | (http://www.edyuk.org/), from file 3rdparty/qcumber/qshortcutdialog.cpp
|
---|
[112] | 20 |
|
---|
| 21 | Copyright (C) 2006 FullMetalCoder
|
---|
| 22 | License: GPL
|
---|
[176] | 23 |
|
---|
| 24 | I modified it to support multiple shortcuts and some other few changes.
|
---|
[112] | 25 | */
|
---|
| 26 |
|
---|
| 27 |
|
---|
[176] | 28 | #ifndef SHORTCUTGETTER_H
|
---|
| 29 | #define SHORTCUTGETTER_H
|
---|
[112] | 30 |
|
---|
| 31 | #include <QDialog>
|
---|
[176] | 32 | #include <QListWidget>
|
---|
[112] | 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);
|
---|
[176] | 47 | void rowChanged(int row);
|
---|
| 48 | void textChanged(const QString & text);
|
---|
[112] | 49 |
|
---|
[176] | 50 | void addItemClicked();
|
---|
| 51 | void removeItemClicked();
|
---|
| 52 |
|
---|
[112] | 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;
|
---|
[176] | 65 |
|
---|
| 66 | QListWidget * list;
|
---|
| 67 | QPushButton * addItem;
|
---|
| 68 | QPushButton * removeItem;
|
---|
[112] | 69 | };
|
---|
| 70 |
|
---|
| 71 | #endif
|
---|