void ExtArgSelector::onReloadTriggered()
{
    int counter = 0;
    int selected = -1;

    QString call = boxSelection->currentData().toString();
    const char *prefval = _argument->pref_valptr ? *_argument->pref_valptr : NULL;
    QString stored(prefval ? prefval : "");
    if ( call != stored )
        stored = call;

    if ( reloadValues() && values.length() > 0 )
    {
        boxSelection->clear();

        ExtcapValueList::const_iterator iter = values.constBegin();

        while ( iter != values.constEnd() )
        {
            boxSelection->addItem((*iter).value(), (*iter).call());

            if ( stored.compare((*iter).call()) == 0 )
                selected = counter;
            else if ( (*iter).isDefault() && selected == -1 )
                selected = counter;

            counter++;
            ++iter;
        }

        if ( selected > -1 && selected < boxSelection->count() )
            boxSelection->setCurrentIndex(selected);
    }
}
Beispiel #2
0
GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName)
    : QSettings(fileName, QSettings::IniFormat, FormWidgets)
{
    Form = FormWidgets;

    setIniCodec("UTF-8");

    connect(Form->ui.pageOptions->CBFrontendMusic, SIGNAL(toggled(bool)), Form, SLOT(Music(bool)));

    for(int i = 0; i < BINDS_NUMBER; i++)
    {
        m_binds.append(BindAction());
        m_binds[i].action = cbinds[i].action;
        m_binds[i].strbind = cbinds[i].strbind;
    }

    //Form->resize(value("frontend/width", 640).toUInt(), value("frontend/height", 450).toUInt());
    resizeToConfigValues();

    reloadValues();
#ifdef VIDEOREC
    reloadVideosValues();
#endif
}