Пример #1
0
void SetJoystick::propogateSetVDPadNameChange()
{
    VDPad *vdpad = static_cast<VDPad*>(sender());
    disconnect(vdpad, SIGNAL(dpadNameChanged()), this, SLOT(propogateSetVDPadNameChange()));
    emit setVDPadNameChange(vdpad->getIndex());
    connect(vdpad, SIGNAL(dpadNameChanged()), this, SLOT(propogateSetVDPadNameChange()));
}
Пример #2
0
void SetJoystick::propogateSetDPadNameChange()
{
    JoyDPad *dpad = static_cast<JoyDPad*>(sender());
    disconnect(dpad, SIGNAL(dpadNameChanged()), this, SLOT(propogateSetDPadButtonNameChange()));
    emit setDPadNameChange(dpad->getIndex());
    connect(dpad, SIGNAL(dpadNameChanged()), this, SLOT(propogateSetDPadButtonNameChange()));
}
Пример #3
0
DPadPushButton::DPadPushButton(JoyDPad *dpad, bool displayNames, QWidget *parent) :
    FlashButtonWidget(displayNames, parent)
{
    this->dpad = dpad;

    refreshLabel();
    enableFlashes();
    connect(dpad, SIGNAL(dpadNameChanged()), this, SLOT(refreshLabel()));
}
Пример #4
0
DPadEditDialog::DPadEditDialog(JoyDPad *dpad, QWidget *parent) :
    QDialog(parent, Qt::Window),
    ui(new Ui::DPadEditDialog)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_DeleteOnClose);

    this->dpad = dpad;

    updateWindowTitleDPadName();

    if (dpad->getJoyMode() == JoyDPad::StandardMode)
    {
        ui->joyModeComboBox->setCurrentIndex(0);
    }
    else if (dpad->getJoyMode() == JoyDPad::EightWayMode)
    {
        ui->joyModeComboBox->setCurrentIndex(1);
    }
    else if (dpad->getJoyMode() == JoyDPad::FourWayCardinal)
    {
        ui->joyModeComboBox->setCurrentIndex(2);
    }
    else if (dpad->getJoyMode() == JoyDPad::FourWayDiagonal)
    {
        ui->joyModeComboBox->setCurrentIndex(3);
    }

    selectCurrentPreset();

    ui->dpadNameLineEdit->setText(dpad->getDpadName());

    unsigned int dpadDelay = dpad->getDPadDelay();
    ui->dpadDelaySlider->setValue(dpadDelay * .1);
    ui->dpadDelayDoubleSpinBox->setValue(dpadDelay * .001);

    connect(ui->presetsComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(implementPresets(int)));
    connect(ui->joyModeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(implementModes(int)));
    connect(ui->mouseSettingsPushButton, SIGNAL(clicked()), this, SLOT(openMouseSettingsDialog()));
    connect(ui->dpadNameLineEdit, SIGNAL(textEdited(QString)), dpad, SLOT(setDPadName(QString)));

    connect(ui->dpadDelaySlider, SIGNAL(valueChanged(int)), this, SLOT(updateJoyDPadDelay(int)));
    connect(dpad, SIGNAL(dpadDelayChanged(int)), this, SLOT(updateDPadDelaySpinBox(int)));
    connect(ui->dpadDelayDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateDPadDelaySlider(double)));

    connect(dpad, SIGNAL(dpadNameChanged()), this, SLOT(updateWindowTitleDPadName()));
}
Пример #5
0
void SetJoystick::addVDPad(int index, VDPad *vdpad)
{
    vdpads.insert(index, vdpad);
    connect(vdpad, SIGNAL(dpadNameChanged()), this, SLOT(propogateSetVDPadNameChange()));

    QHashIterator<int, JoyDPadButton*> iter(*vdpad->getButtons());
    while (iter.hasNext())
    {
        JoyDPadButton *button = iter.next().value();
        if (button)
        {
            connect(button, SIGNAL(clicked(int)), this, SLOT(propogateSetDPadButtonClick(int)));
            connect(button, SIGNAL(released(int)), this, SLOT(propogateSetDPadButtonRelease(int)));
            connect(button, SIGNAL(buttonNameChanged()), this, SLOT(propogateSetVDPadButtonNameChange()));
        }
    }
}
Пример #6
0
void SetJoystick::enableHatConnections(JoyDPad *dpad)
{
    connect(dpad, SIGNAL(dpadNameChanged()), this, SLOT(propogateSetDPadNameChange()));

    QHash<int, JoyDPadButton*> *buttons = dpad->getJoyButtons();
    QHashIterator<int, JoyDPadButton*> iter(*buttons);
    while (iter.hasNext())
    {
        JoyDPadButton *button = iter.next().value();
        connect(button, SIGNAL(setChangeActivated(int)), this, SLOT(propogateSetChange(int)));
        connect(button, SIGNAL(setAssignmentChanged(int,int,int,int)), this, SLOT(propogateSetDPadButtonAssociation(int,int,int,int)));

        connect(button, SIGNAL(clicked(int)), this, SLOT(propogateSetDPadButtonClick(int)));
        connect(button, SIGNAL(clicked(int)), device, SLOT(dpadButtonClickEvent(int)));
        connect(button, SIGNAL(released(int)), this, SLOT(propogateSetDPadButtonRelease(int)));
        connect(button, SIGNAL(released(int)), device, SLOT(dpadButtonReleaseEvent(int)));
        connect(button, SIGNAL(buttonNameChanged()), this, SLOT(propogateSetDPadButtonNameChange()));
    }
}