Some options in wiimotedev settings page now works
This commit is contained in:
parent
86ad7dc6da
commit
99db59d9dc
@ -1726,6 +1726,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1726,6 +1726,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1747,6 +1747,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1730,6 +1730,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1733,6 +1733,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1752,6 +1752,9 @@ msgstr "Gnome Tastenkürzel verwenden"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Benutze Replay Gain Metadaten wenn verfügbar"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1756,6 +1756,9 @@ msgstr "Χρήση πλήκτρων συντόμευσης του Gnome"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Χρήση των μετα δεδομένων Replay Gain αν είναι διαθέσημα"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1731,6 +1731,9 @@ msgstr "Use Gnome's shortcut keys"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Use Replay Gain metadata if it is available"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1728,6 +1728,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1755,6 +1755,9 @@ msgstr "Usar las combinaciones de teclas de Gnome"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Usar metadatos de ganancia de repetición si están disponibles"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1728,6 +1728,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1742,6 +1742,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1728,6 +1728,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1747,6 +1747,9 @@ msgstr "Gnome gyorsbillentyűk használata"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Replay Gain adatok használata, ha elérhetőek"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1765,6 +1765,9 @@ msgstr "Utilizza le scorciatoie di Gnome"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Utilizza i metadati del guadagno di riproduzione se disponibili"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1728,6 +1728,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1726,6 +1726,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1730,6 +1730,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1753,6 +1753,9 @@ msgstr "Gebruik Gnome's sneltoetsen"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Gebruik Replay Gain metadata indien beschikbaar"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1726,6 +1726,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1739,6 +1739,9 @@ msgstr "Używaj skrótów klawiaturowych Gnome"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Używaj metadanych Replay Gain, jeśli są dostępne"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1748,6 +1748,9 @@ msgstr "Usar teclas de atalho Gnome"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Usar Consistência de meta-dados se estiver disponível"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1739,6 +1739,9 @@ msgstr "Usar teclas de atalho do Gnome"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Usar metadados do fator de ganho se ele estiver disponível"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1727,6 +1727,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1744,6 +1744,9 @@ msgstr "Использовать горячие клавиши Gnome"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Использовать метаданные Replay Gain если возможно"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1746,6 +1746,9 @@ msgstr "Použiť klávesové skratky GNOME"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Použiť metadáta na vyrovnanie hlasitosti ak sú dostupné"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1745,6 +1745,9 @@ msgstr "Uporabi Gnome bližnjice"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Uporabi Replay Gain metapodatke, če je možno"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1731,6 +1731,9 @@ msgstr "Користи Гномове пречице"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1744,6 +1744,9 @@ msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
"Använd metadata för uppspelningsförstärkning om de de finns tillgängliga."
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1732,6 +1732,9 @@ msgstr "Gnome kısayol tuşlarını kullan"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1716,6 +1716,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1743,6 +1743,9 @@ msgstr "Використовувати комбінації клавіш Gnome"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr "Використовувати метадані Replay Gain, якщо наявні"
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1726,6 +1726,9 @@ msgstr ""
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1731,6 +1731,9 @@ msgstr "使用Gnome的快速鍵"
|
||||
msgid "Use Replay Gain metadata if it is available"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use Wii remote id"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use notifications to report Wii remote status"
|
||||
msgstr ""
|
||||
|
||||
|
@ -473,6 +473,10 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
||||
ui_->action_about->setMenuRole(QAction::AboutRole);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
wiimotedev_shortcuts_ = new WiimotedevShortcuts(player_, this);
|
||||
#endif
|
||||
|
||||
// Global shortcuts
|
||||
connect(global_shortcuts_, SIGNAL(Play()), player_, SLOT(Play()));
|
||||
connect(global_shortcuts_, SIGNAL(Pause()), player_, SLOT(Pause()));
|
||||
@ -497,6 +501,9 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
||||
connect(settings_dialog_.get(), SIGNAL(accepted()), osd_, SLOT(ReloadSettings()));
|
||||
connect(settings_dialog_.get(), SIGNAL(accepted()), ui_->library_view, SLOT(ReloadSettings()));
|
||||
connect(settings_dialog_.get(), SIGNAL(accepted()), player_->GetEngine(), SLOT(ReloadSettings()));
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
connect(settings_dialog_.get(), SIGNAL(accepted()), wiimotedev_shortcuts_, SLOT(ReloadSettings()));
|
||||
#endif
|
||||
|
||||
// Add stream dialog
|
||||
connect(add_stream_dialog_.get(), SIGNAL(accepted()), SLOT(AddStreamAccepted()));
|
||||
@ -577,10 +584,6 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
||||
|
||||
library_->Init();
|
||||
library_->StartThreads();
|
||||
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
wiimotedev_shortcuts_ = new WiimotedevShortcuts(player_, this);
|
||||
#endif
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
#include "ui/wiimotedevshortcutsconfig.h"
|
||||
#include "ui_wiimotedevshortcutsconfig.h"
|
||||
#include "wiimotedev/shortcuts.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
@ -58,13 +60,13 @@ SettingsDialog::SettingsDialog(QWidget* parent)
|
||||
ui_->list->addItem("Wiimotedev");
|
||||
ui_->list->item(Page_Wiimotedev)->setIcon(QIcon(":/icons/32x32/wiimotedev.png"));
|
||||
|
||||
QWidget *wiimotedev_page = new QWidget(this);
|
||||
QWidget* wiimotedev_page = new QWidget(this);
|
||||
wiimotedev_page->setObjectName(QString::fromUtf8("wiimotedev_page"));
|
||||
QVBoxLayout *wiimotedev_layout = new QVBoxLayout(wiimotedev_page);
|
||||
QVBoxLayout* wiimotedev_layout = new QVBoxLayout(wiimotedev_page);
|
||||
wiimotedev_layout->setObjectName(QString::fromUtf8("wiimotedev_layout"));
|
||||
WiimotedevShortcutsConfig *wiimotedev_config = new WiimotedevShortcutsConfig(wiimotedev_page);
|
||||
wiimotedev_config->setObjectName(QString::fromUtf8("wiimotedev_config"));
|
||||
wiimotedev_layout->addWidget(wiimotedev_config);
|
||||
wiimotedev_config_ = new WiimotedevShortcutsConfig(wiimotedev_page);
|
||||
wiimotedev_config_->setObjectName(QString::fromUtf8("wiimotedev_config"));
|
||||
wiimotedev_layout->addWidget(wiimotedev_config_);
|
||||
|
||||
ui_->stacked_widget->addWidget(wiimotedev_page);
|
||||
#endif
|
||||
@ -221,6 +223,16 @@ void SettingsDialog::accept() {
|
||||
s.endGroup();
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_WIIMOTEDEV
|
||||
s.beginGroup(WiimotedevShortcuts::kSettingsGroup);
|
||||
s.setValue("enabled", wiimotedev_config_->ui_->wiimotedev_enable->isChecked());
|
||||
s.setValue("only_when_focused", wiimotedev_config_->ui_->wiimotedev_focus->isChecked());
|
||||
s.setValue("use_active_action", wiimotedev_config_->ui_->wiimotedev_active->isChecked());
|
||||
s.setValue("use_notification", wiimotedev_config_->ui_->wiimotedev_notification->isChecked());
|
||||
s.setValue("device", wiimotedev_config_->ui_->wiimotedev_device->value());
|
||||
s.endGroup();
|
||||
#endif
|
||||
|
||||
// Notifications
|
||||
OSD::Behaviour osd_behaviour = OSD::Disabled;
|
||||
if (ui_->notifications_none->isChecked()) osd_behaviour = OSD::Disabled;
|
||||
|
@ -14,9 +14,10 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "wiimotedevshortcutsconfig.h"
|
||||
#include "ui/wiimotedevshortcutsconfig.h"
|
||||
#include "ui_wiimotedevshortcutsconfig.h"
|
||||
|
||||
#include "wiimotedev/shortcuts.h"
|
||||
|
||||
WiimotedevShortcutsConfig::WiimotedevShortcutsConfig(QWidget* parent)
|
||||
: QWidget(parent),
|
||||
@ -24,4 +25,19 @@ WiimotedevShortcutsConfig::WiimotedevShortcutsConfig(QWidget* parent)
|
||||
{
|
||||
ui_->setupUi(this);
|
||||
ui_->list->header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
|
||||
settings_.beginGroup(WiimotedevShortcuts::kSettingsGroup);
|
||||
ui_->wiimotedev_enable->setChecked(settings_.value("enabled", true).toBool());
|
||||
ui_->wiimotedev_groupbox->setChecked(settings_.value("enabled", true).toBool());
|
||||
ui_->wiimotedev_active->setChecked(settings_.value("use_active_action", false).toBool());
|
||||
ui_->wiimotedev_focus->setChecked(settings_.value("only_when_focused", false).toBool());
|
||||
ui_->wiimotedev_notification->setChecked(settings_.value("use_notification", false).toBool());
|
||||
ui_->wiimotedev_device->setValue(settings_.value("device", 1).toUInt());
|
||||
settings_.endGroup();
|
||||
|
||||
connect(ui_->wiimotedev_enable, SIGNAL(clicked(bool)), this, SLOT(WiimotedevEnabledChecked(bool)));
|
||||
}
|
||||
|
||||
void WiimotedevShortcutsConfig::WiimotedevEnabledChecked(bool checked) {
|
||||
ui_->wiimotedev_groupbox->setEnabled(checked);
|
||||
}
|
||||
|
@ -17,20 +17,23 @@
|
||||
#ifndef WIIMOTEDEVSHORTCUTSCONFIG_H
|
||||
#define WIIMOTEDEVSHORTCUTSCONFIG_H
|
||||
|
||||
#include <QSettings>
|
||||
#include <QWidget>
|
||||
|
||||
class Ui_WiimotedevShortcutsConfig;
|
||||
|
||||
class WiimotedevShortcutsConfig : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_OBJECT
|
||||
public:
|
||||
WiimotedevShortcutsConfig(QWidget* parent = 0);
|
||||
~WiimotedevShortcutsConfig(){};
|
||||
|
||||
private:
|
||||
Ui_WiimotedevShortcutsConfig* ui_;
|
||||
|
||||
private:
|
||||
QSettings settings_;
|
||||
|
||||
private slots:
|
||||
void WiimotedevEnabledChecked(bool checked);
|
||||
|
||||
};
|
||||
|
||||
#endif // WIIMOTEDEVSHORTCUTSCONFIG_H
|
||||
|
@ -55,12 +55,58 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<widget class="QCheckBox" name="wiimotedev_notification">
|
||||
<property name="text">
|
||||
<string>Use notifications to report Wii remote status</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use Wii remote id</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="wiimotedev_device">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="list">
|
||||
<property name="editTriggers">
|
||||
|
@ -28,7 +28,9 @@ WiimotedevShortcuts::WiimotedevShortcuts(Player* player, QObject* parent)
|
||||
wiimotedev_iface_(NULL),
|
||||
wiimotedev_buttons_(0),
|
||||
wiimotedev_device_(1),
|
||||
wiimotedev_active_(false)
|
||||
wiimotedev_active_(true),
|
||||
wiimotedev_focus_(false),
|
||||
wiimotedev_notification_(true)
|
||||
{
|
||||
ReloadSettings();
|
||||
|
||||
@ -43,10 +45,8 @@ WiimotedevShortcuts::WiimotedevShortcuts(Player* player, QObject* parent)
|
||||
|
||||
void WiimotedevShortcuts::SetEnabled(bool enabled)
|
||||
{
|
||||
if (!enabled) {
|
||||
disconnect(this, 0, player_, 0);
|
||||
return;
|
||||
}
|
||||
disconnect(this, 0, player_, 0);
|
||||
if (!enabled) return;
|
||||
|
||||
connect(this, SIGNAL(Next()), player_, SLOT(Next()));
|
||||
connect(this, SIGNAL(Previous()), player_, SLOT(Previous()));
|
||||
@ -66,8 +66,8 @@ void WiimotedevShortcuts::ReloadSettings() {
|
||||
settings_.beginGroup(WiimotedevShortcuts::kActionsGroup);
|
||||
|
||||
if (!settings_.allKeys().count()) {
|
||||
SetDefaultSettings();
|
||||
settings_.sync();
|
||||
SetDefaultSettings();
|
||||
settings_.sync();
|
||||
}
|
||||
|
||||
quint64 fvalue, svalue;
|
||||
@ -84,33 +84,38 @@ void WiimotedevShortcuts::ReloadSettings() {
|
||||
settings_.beginGroup(WiimotedevShortcuts::kSettingsGroup);
|
||||
SetEnabled(settings_.value("enabled", quint64(true)).toBool());
|
||||
wiimotedev_device_ = settings_.value("device", 1).toInt();
|
||||
wiimotedev_active_ = settings_.value("use_active_action", wiimotedev_active_).toBool();
|
||||
wiimotedev_focus_ = settings_.value("only_when_focused", wiimotedev_focus_).toBool();
|
||||
wiimotedev_notification_ = settings_.value("use_notification", wiimotedev_notification_).toBool();
|
||||
|
||||
settings_.endGroup();
|
||||
}
|
||||
|
||||
void WiimotedevShortcuts::SetDefaultSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.beginGroup(WiimotedevShortcuts::kActionsGroup);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_LEFT), PlayerPreviousTrack);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_RIGHT), PlayerNextTrack);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_SHIFT_LEFT), PlayerPreviousTrack);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_SHIFT_RIGHT), PlayerNextTrack);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_PLUS), PlayerIncVolume);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_MINUS), PlayerDecVolume);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_1), PlayerTogglePause);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_2), PlayerShowOSD);
|
||||
settings.endGroup();
|
||||
QSettings settings;
|
||||
settings.beginGroup(WiimotedevShortcuts::kActionsGroup);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_LEFT), PlayerPreviousTrack);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_RIGHT), PlayerNextTrack);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_SHIFT_LEFT), PlayerPreviousTrack);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_SHIFT_RIGHT), PlayerNextTrack);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_PLUS), PlayerIncVolume);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_MINUS), PlayerDecVolume);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_1), PlayerTogglePause);
|
||||
settings.setValue(QString::number(WIIMOTE_BTN_2), PlayerShowOSD);
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup(WiimotedevShortcuts::kSettingsGroup);
|
||||
settings.setValue("enabled", true);
|
||||
settings.setValue("device", 1);
|
||||
settings.endGroup();
|
||||
settings.beginGroup(WiimotedevShortcuts::kSettingsGroup);
|
||||
settings.setValue("enabled", true);
|
||||
settings.setValue("device", 1);
|
||||
settings.setValue("use_active_action", true);
|
||||
settings.setValue("only_when_focused", false);
|
||||
settings.setValue("use_notification", true);
|
||||
settings.endGroup();
|
||||
|
||||
settings.sync();
|
||||
settings.sync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void WiimotedevShortcuts::EmitRequest(quint32 action) {
|
||||
switch (action) {
|
||||
case PlayerNextTrack: emit Next(); break;
|
||||
@ -140,9 +145,8 @@ void WiimotedevShortcuts::DbusWiimoteGeneralButtons(quint32 id, quint64 value) {
|
||||
|
||||
while (actions.hasNext()) {
|
||||
actions.next();
|
||||
quint64 key = actions.key();
|
||||
if (!key) continue;
|
||||
if ((key & buttons) == key) EmitRequest(actions.value());
|
||||
if (!actions.key()) continue;
|
||||
if ((actions.key() & buttons) == actions.key()) EmitRequest(actions.value());
|
||||
}
|
||||
|
||||
wiimotedev_buttons_ = buttons;
|
||||
|
@ -50,6 +50,8 @@ private:
|
||||
|
||||
quint32 wiimotedev_device_;
|
||||
bool wiimotedev_active_;
|
||||
bool wiimotedev_focus_;
|
||||
bool wiimotedev_notification_;
|
||||
|
||||
private:
|
||||
enum Action {
|
||||
|
Loading…
x
Reference in New Issue
Block a user