2010-08-29 17:21:50 +02:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-08-29 17:21:50 +02:00
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WIIMOTEDEVSHORTCUTGRABBER_H
|
|
|
|
#define WIIMOTEDEVSHORTCUTGRABBER_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2010-08-31 23:56:20 +02:00
|
|
|
#include <QTimeLine>
|
|
|
|
|
2010-08-31 01:57:31 +02:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
#include "dbus/wiimotedev.h"
|
2010-08-31 22:35:11 +02:00
|
|
|
#include "ui/wiimotedevshortcutsconfig.h"
|
|
|
|
|
2010-08-29 17:21:50 +02:00
|
|
|
class Ui_WiimotedevShortcutGrabber;
|
|
|
|
|
|
|
|
class WiimotedevShortcutGrabber : public QDialog {
|
2010-09-01 00:48:16 +02:00
|
|
|
Q_OBJECT
|
2010-08-31 21:57:53 +02:00
|
|
|
public:
|
2010-09-11 03:23:44 +02:00
|
|
|
WiimotedevShortcutGrabber(quint32 action = 0, quint32 device = 1, QWidget* parent = 0);
|
2010-08-29 17:21:50 +02:00
|
|
|
~WiimotedevShortcutGrabber();
|
|
|
|
|
2010-08-31 21:57:53 +02:00
|
|
|
private slots:
|
2010-08-31 01:57:31 +02:00
|
|
|
void DbusWiimoteGeneralButtons(uint id, qulonglong value);
|
2010-08-31 21:57:53 +02:00
|
|
|
void RememberSwingChecked(bool checked);
|
2010-08-31 23:56:20 +02:00
|
|
|
void Timeout(int);
|
2010-08-29 17:21:50 +02:00
|
|
|
|
2010-08-31 21:57:53 +02:00
|
|
|
private:
|
2010-09-01 00:48:16 +02:00
|
|
|
QTimeLine line_;
|
2010-08-31 22:35:11 +02:00
|
|
|
quint32 pref_action_;
|
|
|
|
|
2010-08-29 17:21:50 +02:00
|
|
|
Ui_WiimotedevShortcutGrabber* ui_;
|
2010-08-29 18:24:19 +02:00
|
|
|
WiimotedevShortcutsConfig* config_;
|
2010-08-31 01:57:31 +02:00
|
|
|
boost::scoped_ptr<OrgWiimotedevDeviceEventsInterface> wiimotedev_iface_;
|
2010-08-29 17:21:50 +02:00
|
|
|
quint32 wiimotedev_device_;
|
|
|
|
quint64 wiimotedev_buttons_;
|
|
|
|
|
2010-08-31 21:57:53 +02:00
|
|
|
quint64 remember_wiimote_shifts_;
|
|
|
|
quint64 remember_nunchuk_shifts_;
|
|
|
|
|
2010-09-01 01:17:38 +02:00
|
|
|
signals:
|
|
|
|
void AddShortcut(quint64 buttons, quint32 action);
|
|
|
|
|
2010-08-29 17:21:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WIIMOTEDEVSHORTCUTGRABBER_H
|