void SetJoystick::propogateSetStickNameChange() { JoyControlStick *stick = static_cast<JoyControlStick*>(sender()); disconnect(stick, SIGNAL(stickNameChanged()), this, SLOT(propogateSetStickNameChange())); emit setStickNameChange(stick->getIndex()); connect(stick, SIGNAL(stickNameChanged()), this, SLOT(propogateSetStickNameChange())); }
void JoyControlStick::setStickName(QString tempName) { if (tempName.length() <= 20 && tempName != stickName) { stickName = tempName; emit stickNameChanged(); } }
JoyControlStickPushButton::JoyControlStickPushButton(JoyControlStick *stick, bool displayNames, QWidget *parent) : FlashButtonWidget(displayNames, parent) { this->stick = stick; refreshLabel(); connect(stick, SIGNAL(active(int, int)), this, SLOT(flash())); connect(stick, SIGNAL(released(int, int)), this, SLOT(unflash())); connect(stick, SIGNAL(stickNameChanged()), this, SLOT(refreshLabel())); }
void SetJoystick::addControlStick(int index, JoyControlStick *stick) { sticks.insert(index, stick); connect(stick, SIGNAL(stickNameChanged()), this, SLOT(propogateSetStickNameChange())); QHashIterator<JoyStickDirectionsType::JoyStickDirections, JoyControlStickButton*> iter(*stick->getButtons()); while (iter.hasNext()) { JoyControlStickButton *button = iter.next().value(); if (button) { connect(button, SIGNAL(clicked(int)), this, SLOT(propogateSetStickButtonClick(int))); connect(button, SIGNAL(released(int)), this, SLOT(propogateSetStickButtonRelease(int))); connect(button, SIGNAL(buttonNameChanged()), this, SLOT(propogateSetStickButtonNameChange())); } } }
void JoyControlStick::setDefaultStickName(QString tempname) { defaultStickName = tempname; emit stickNameChanged(); }