2010-08-24 21:57:43 +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-24 21:57:43 +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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
#include "wiimotesettingspage.h"
|
2010-08-24 21:57:43 +02:00
|
|
|
|
|
2010-09-01 17:46:22 +02:00
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
2020-09-18 16:15:19 +02:00
|
|
|
|
#include "consts.h"
|
|
|
|
|
#include "shortcuts.h"
|
|
|
|
|
#include "ui/iconloader.h"
|
|
|
|
|
#include "ui_wiimotesettingspage.h"
|
|
|
|
|
#include "wiimoteshortcutgrabber.h"
|
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
WiimoteSettingsPage::WiimoteSettingsPage(SettingsDialog* dialog)
|
2014-02-07 16:34:20 +01:00
|
|
|
|
: SettingsPage(dialog), ui_(new Ui_WiimoteSettingsPage) {
|
2010-08-24 21:57:43 +02:00
|
|
|
|
ui_->setupUi(this);
|
2015-04-15 18:26:09 +02:00
|
|
|
|
ui_->list->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
2015-10-14 03:01:08 +02:00
|
|
|
|
setWindowIcon(IconLoader::Load("wiimotedev", IconLoader::Base));
|
2020-09-18 16:15:19 +02:00
|
|
|
|
ui_->wiimotedev_add_action->setIcon(
|
|
|
|
|
IconLoader::Load("list-add", IconLoader::Base));
|
|
|
|
|
ui_->wiimotedev_delete_action->setIcon(
|
|
|
|
|
IconLoader::Load("list-remove", IconLoader::Base));
|
|
|
|
|
ui_->wiimotedev_reload->setIcon(
|
|
|
|
|
IconLoader::Load("view-refresh", IconLoader::Base));
|
2010-08-25 18:19:54 +02:00
|
|
|
|
|
2017-08-29 14:01:48 +02:00
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_1, "Wii Remote 1");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_2, "Wii Remote 2");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_A, "Wii Remote A");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_B, "Wii Remote B");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_PLUS, "Wii Remote ⊕");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_MINUS, "Wii Remote ⊖");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_HOME, "Wii Remote ⌂");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_UP, "Wii Remote ↑");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_DOWN, "Wii Remote ↓");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_LEFT, "Wii Remote ←");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_RIGHT, "Wii Remote →");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_SHIFT_UP, "Wii Remote Shift ↑");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_SHIFT_DOWN, "Wii Remote Shift ↓");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_SHIFT_LEFT, "Wii Remote Shift ←");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_SHIFT_RIGHT, "Wii Remote Shift →");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_SHIFT_FORWARD, "Wii Remote Shift Forward");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_SHIFT_BACKWARD, "Wii Remote Shift Backward");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_TILT_FRONT, "Wii Remote Tilt Frontwards");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_TILT_BACK, "Wii Remote Tilt Backwards");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_TILT_LEFT, "Wii Remote Tilt Leftwards");
|
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_TILT_RIGHT, "Wii Remote Tilt Rightwards");
|
2010-08-29 17:21:50 +02:00
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_Z, "Nunchuk Z");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_C, "Nunchuk B");
|
2017-08-29 14:01:48 +02:00
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_STICK_UP, "Nunchuk Stick ↑");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_STICK_DOWN, "Nunchuk Stick ↓");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_STICK_LEFT, "Nunchuk Stick ←");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_STICK_RIGHT, "Nunchuk Stick →");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_SHIFT_UP, "Nunchuk Shift ↑");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_SHIFT_DOWN, "Nunchuk Shift ↓");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_SHIFT_LEFT, "Nunchuk Shift ←");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_SHIFT_RIGHT, "Nunchuk Shift →");
|
2010-08-29 17:21:50 +02:00
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_SHIFT_FORWARD, "Nunchuk Shift Forward");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_SHIFT_BACKWARD, "Nunchuk Shift Backward");
|
2017-08-29 14:01:48 +02:00
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_TILT_FRONT, "Nunchuk Tilt Frontwards");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_TILT_BACK, "Nunchuk Tilt Backwards");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_TILT_LEFT, "Nunchuk Tilt Leftwards");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_TILT_RIGHT, "Nunchuk Tilt Rightwards");
|
2010-08-29 17:21:50 +02:00
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_X, "Classic X");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_Y, "Classic Y");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_A, "Classic A");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_B, "Classic B");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_L, "Classic L");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_R, "Classic R");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_ZL, "Classic ZL");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_ZR, "Classic ZR");
|
2017-08-29 14:01:48 +02:00
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_MINUS, "Classic ⊖");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_PLUS, "Classic ⊕");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_HOME, "Classic ⌂");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_UP, "Classic ↑");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_DOWN, "Classic ↓");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_LEFT, "Classic ←");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_RIGHT, "Classic →");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_LSTICK_UP, "Classic Left-Stick ↑");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_LSTICK_DOWN, "Classic Left-Stick ↓");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_LSTICK_LEFT, "Classic Left-Stick ←");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_LSTICK_RIGHT, "Classic Left-Stick →");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_RSTICK_UP, "Classic Right-Stick ↑");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_RSTICK_DOWN, "Classic Right-Stick ↓");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_RSTICK_LEFT, "Classic Right-Stick ←");
|
|
|
|
|
text_buttons_.insert(CLASSIC_BTN_RSTICK_RIGHT, "Classic Right-Stick →");
|
2010-08-29 17:21:50 +02:00
|
|
|
|
text_buttons_.insert(WIIMOTE_BTN_SHIFT_SHAKE, "Wiiremote Shift Shake");
|
|
|
|
|
text_buttons_.insert(NUNCHUK_BTN_SHIFT_SHAKE, "Nunchuk Shift Shake");
|
2010-08-25 20:10:44 +02:00
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::WiimotedevActiveDeactive,
|
2017-08-29 14:01:48 +02:00
|
|
|
|
tr("Activate/Deactivate Wii Remote"));
|
2010-08-25 20:10:44 +02:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerNextTrack, tr("Next track"));
|
2014-02-07 16:34:20 +01:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerPreviousTrack,
|
|
|
|
|
tr("Previous track"));
|
2010-09-01 00:48:16 +02:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerPlay, tr("Play"));
|
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerStop, tr("Stop"));
|
2014-02-07 16:34:20 +01:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerIncVolume,
|
|
|
|
|
tr("Increase volume"));
|
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerDecVolume,
|
|
|
|
|
tr("Decrease volume"));
|
2010-08-25 20:10:44 +02:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerMute, tr("Mute"));
|
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerPause, tr("Pause"));
|
2014-02-07 16:34:20 +01:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerTogglePause,
|
|
|
|
|
tr("Play/Pause"));
|
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerSeekBackward,
|
|
|
|
|
tr("Seek backward"));
|
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerSeekForward,
|
|
|
|
|
tr("Seek forward"));
|
2011-07-05 22:11:21 +02:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerStopAfter, tr("Stop after"));
|
2010-08-25 20:10:44 +02:00
|
|
|
|
text_actions_.insert(WiimotedevShortcuts::PlayerShowOSD, tr("Show OSD"));
|
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
|
connect(ui_->list,
|
|
|
|
|
SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
|
|
|
|
|
SLOT(ItemClicked(QTreeWidgetItem*)));
|
2010-09-01 01:50:21 +02:00
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
|
connect(ui_->wiimotedev_add_action, SIGNAL(clicked()), this,
|
|
|
|
|
SLOT(AddAction()));
|
|
|
|
|
connect(ui_->wiimotedev_delete_action, SIGNAL(clicked()), this,
|
|
|
|
|
SLOT(DeleteAction()));
|
|
|
|
|
connect(ui_->wiimotedev_reload, SIGNAL(clicked()), this,
|
|
|
|
|
SLOT(DefaultSettings()));
|
2010-08-26 17:37:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
void WiimoteSettingsPage::AddShortcut(quint64 button, quint32 action) {
|
2014-02-10 14:29:07 +01:00
|
|
|
|
for (const Shortcut& shortcut : actions_) {
|
2010-09-01 17:46:22 +02:00
|
|
|
|
if (shortcut.button == button) {
|
2014-02-07 16:34:20 +01:00
|
|
|
|
QMessageBox::information(this, tr("Information"),
|
|
|
|
|
QString(tr("Shortcut for %1 already exists"))
|
|
|
|
|
.arg(GetReadableWiiremoteSequence(button)),
|
|
|
|
|
QMessageBox::Ok);
|
2010-09-01 17:46:22 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-31 03:37:17 +02:00
|
|
|
|
Shortcut s;
|
2014-02-07 16:34:20 +01:00
|
|
|
|
s.object = new QTreeWidgetItem(
|
|
|
|
|
ui_->list, QStringList() << GetReadableWiiremoteSequence(button)
|
|
|
|
|
<< text_actions_[action]);
|
2010-08-31 03:37:17 +02:00
|
|
|
|
s.button = button;
|
|
|
|
|
s.action = action;
|
|
|
|
|
actions_ << s;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
void WiimoteSettingsPage::Load() {
|
|
|
|
|
QSettings s;
|
|
|
|
|
s.beginGroup(WiimotedevShortcuts::kSettingsGroup);
|
|
|
|
|
ui_->wiimotedev_enable->setChecked(s.value("enabled", false).toBool());
|
2014-02-07 16:34:20 +01:00
|
|
|
|
ui_->wiimotedev_active->setChecked(
|
|
|
|
|
s.value("use_active_action", true).toBool());
|
|
|
|
|
ui_->wiimotedev_focus->setChecked(
|
|
|
|
|
s.value("only_when_focused", false).toBool());
|
|
|
|
|
ui_->wiimotedev_notification->setChecked(
|
|
|
|
|
s.value("use_notification", true).toBool());
|
2011-08-14 01:07:10 +02:00
|
|
|
|
ui_->wiimotedev_device->setValue(s.value("device", 1).toUInt());
|
|
|
|
|
bool first_conf = s.value("first_conf", true).toBool();
|
|
|
|
|
s.endGroup();
|
2010-09-01 01:35:39 +02:00
|
|
|
|
|
|
|
|
|
if (first_conf) {
|
|
|
|
|
DefaultSettings();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
s.beginGroup(WiimotedevShortcuts::kActionsGroup);
|
2010-08-26 17:37:07 +02:00
|
|
|
|
ui_->list->clear();
|
2010-08-31 03:37:17 +02:00
|
|
|
|
actions_.clear();
|
2010-08-26 17:37:07 +02:00
|
|
|
|
|
2010-08-25 20:10:44 +02:00
|
|
|
|
quint64 fvalue, svalue;
|
|
|
|
|
bool fvalid, svalid;
|
|
|
|
|
|
2014-02-10 14:29:07 +01:00
|
|
|
|
for (const QString& str : s.allKeys()) {
|
2010-08-25 20:10:44 +02:00
|
|
|
|
fvalue = str.toULongLong(&fvalid, 10);
|
2011-08-14 01:07:10 +02:00
|
|
|
|
svalue = s.value(str, 0).toULongLong(&svalid);
|
2014-02-07 16:34:20 +01:00
|
|
|
|
if (fvalid && svalid) AddShortcut(fvalue, svalue);
|
2010-08-25 20:10:44 +02:00
|
|
|
|
}
|
2011-08-14 01:07:10 +02:00
|
|
|
|
s.endGroup();
|
2010-08-31 03:37:17 +02:00
|
|
|
|
|
|
|
|
|
ui_->list->sortItems(1, Qt::AscendingOrder);
|
2010-08-26 17:37:07 +02:00
|
|
|
|
}
|
2010-08-25 20:10:44 +02:00
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
void WiimoteSettingsPage::Save() {
|
|
|
|
|
QSettings s;
|
|
|
|
|
|
|
|
|
|
s.beginGroup(WiimotedevShortcuts::kActionsGroup);
|
|
|
|
|
s.remove("");
|
2014-02-10 14:29:07 +01:00
|
|
|
|
for (const Shortcut& shortcut : actions_)
|
|
|
|
|
s.setValue(QString::number(shortcut.button), shortcut.action);
|
2011-08-14 01:07:10 +02:00
|
|
|
|
s.endGroup();
|
|
|
|
|
|
|
|
|
|
s.beginGroup(WiimotedevShortcuts::kSettingsGroup);
|
|
|
|
|
s.setValue("first_conf", false);
|
|
|
|
|
s.setValue("enabled", ui_->wiimotedev_enable->isChecked());
|
|
|
|
|
s.setValue("only_when_focused", ui_->wiimotedev_focus->isChecked());
|
|
|
|
|
s.setValue("use_active_action", ui_->wiimotedev_active->isChecked());
|
|
|
|
|
s.setValue("use_notification", ui_->wiimotedev_notification->isChecked());
|
|
|
|
|
s.setValue("device", ui_->wiimotedev_device->value());
|
|
|
|
|
s.endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WiimoteSettingsPage::DefaultSettings() {
|
2010-08-31 03:37:17 +02:00
|
|
|
|
ui_->list->clear();
|
|
|
|
|
actions_.clear();
|
|
|
|
|
|
|
|
|
|
AddShortcut(WIIMOTE_BTN_LEFT, WiimotedevShortcuts::PlayerPreviousTrack);
|
|
|
|
|
AddShortcut(WIIMOTE_BTN_RIGHT, WiimotedevShortcuts::PlayerNextTrack);
|
|
|
|
|
AddShortcut(WIIMOTE_BTN_SHIFT_LEFT, WiimotedevShortcuts::PlayerPreviousTrack);
|
|
|
|
|
AddShortcut(WIIMOTE_BTN_SHIFT_RIGHT, WiimotedevShortcuts::PlayerNextTrack);
|
|
|
|
|
AddShortcut(WIIMOTE_BTN_PLUS, WiimotedevShortcuts::PlayerIncVolume);
|
|
|
|
|
AddShortcut(WIIMOTE_BTN_MINUS, WiimotedevShortcuts::PlayerDecVolume);
|
|
|
|
|
AddShortcut(WIIMOTE_BTN_1, WiimotedevShortcuts::PlayerTogglePause);
|
|
|
|
|
AddShortcut(WIIMOTE_BTN_2, WiimotedevShortcuts::PlayerShowOSD);
|
2010-09-01 17:37:09 +02:00
|
|
|
|
AddShortcut(WIIMOTE_BTN_A, WiimotedevShortcuts::WiimotedevActiveDeactive);
|
2010-08-31 03:37:17 +02:00
|
|
|
|
|
|
|
|
|
ui_->list->sortItems(1, Qt::AscendingOrder);
|
2010-08-25 18:19:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
void WiimoteSettingsPage::ItemClicked(QTreeWidgetItem* selected_item) {
|
2010-08-26 17:37:07 +02:00
|
|
|
|
selected_item_ = selected_item;
|
2010-08-25 20:10:44 +02:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
QString WiimoteSettingsPage::GetReadableWiiremoteSequence(quint64 value) {
|
2010-08-25 20:10:44 +02:00
|
|
|
|
QMapIterator<quint64, QString> text(text_buttons_);
|
|
|
|
|
|
|
|
|
|
QStringList list;
|
|
|
|
|
while (text.hasNext()) {
|
|
|
|
|
text.next();
|
2014-02-07 16:34:20 +01:00
|
|
|
|
if ((text.key() & value) == text.key()) list << text.value();
|
2010-08-25 20:10:44 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-26 17:37:07 +02:00
|
|
|
|
QString output;
|
2010-08-29 17:21:50 +02:00
|
|
|
|
if (!list.isEmpty()) {
|
2014-02-07 16:34:20 +01:00
|
|
|
|
for (int i = 0; i < (list.count() - 1); ++i) output += list.at(i) + " + ";
|
2010-08-29 17:21:50 +02:00
|
|
|
|
output += list.last();
|
2010-08-31 03:37:17 +02:00
|
|
|
|
} else
|
2017-08-29 14:01:48 +02:00
|
|
|
|
output = tr("Push Wii Remote button");
|
2010-08-25 20:10:44 +02:00
|
|
|
|
|
|
|
|
|
return output;
|
|
|
|
|
}
|
2010-08-26 17:37:07 +02:00
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
void WiimoteSettingsPage::AddAction() {
|
2010-08-31 22:35:11 +02:00
|
|
|
|
emit SetWiimotedevInterfaceActived(false);
|
2011-08-14 01:07:10 +02:00
|
|
|
|
WiimoteShortcutGrabber grabber(0, ui_->wiimotedev_device->value(), this);
|
2014-02-07 16:34:20 +01:00
|
|
|
|
connect(&grabber, SIGNAL(AddShortcut(quint64, quint32)), this,
|
|
|
|
|
SLOT(AddShortcut(quint64, quint32)), Qt::QueuedConnection);
|
2010-08-29 18:24:19 +02:00
|
|
|
|
grabber.exec();
|
2010-08-31 22:35:11 +02:00
|
|
|
|
emit SetWiimotedevInterfaceActived(true);
|
2010-09-01 17:37:09 +02:00
|
|
|
|
|
|
|
|
|
ui_->list->sortItems(1, Qt::AscendingOrder);
|
2010-08-29 17:21:50 +02:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-14 01:07:10 +02:00
|
|
|
|
void WiimoteSettingsPage::DeleteAction() {
|
2010-08-26 17:37:07 +02:00
|
|
|
|
for (int i = 0; i < actions_.count(); ++i) {
|
|
|
|
|
if (actions_.at(i).object == selected_item_) {
|
|
|
|
|
delete selected_item_;
|
|
|
|
|
actions_.removeAt(i);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|