Esempio n. 1
0
void COptionPluginPage::ApplyComboBoxes(void)
{
    for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
    {
        CModifiedComboBox * ComboBox = cb_iter->second;
        if (ComboBox->IsChanged())
        {
            int index = ComboBox->GetCurSel();
            if (index == CB_ERR)
            {
                return;
            }

            const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index);
            if (PluginPtr == NULL)
            {
                return;
            }

            const CPluginList::PLUGIN * Plugin = *PluginPtr;

            g_Settings->SaveString(cb_iter->first, Plugin->FileName.c_str());
        }
        if (ComboBox->IsReset())
        {
            g_Settings->DeleteSetting(cb_iter->first);
            ComboBox->SetReset(false);
        }
    }
}
Esempio n. 2
0
bool COptionPluginPage::ResetComboBox(CModifiedComboBox & ComboBox, SettingID Type)
{
    if (!ComboBox.IsChanged())
    {
        return false;
    }

    ComboBox.SetReset(true);
    stdstr Value = g_Settings->LoadDefaultString(Type);
    for (int i = 0, n = ComboBox.GetCount(); i < n; i++)
    {
        const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox.GetItemDataPtr(i);
        if (PluginPtr == NULL)
        {
            continue;
        }

        const CPluginList::PLUGIN * Plugin = *PluginPtr;
        if (Plugin->FileName != Value)
        {
            continue;
        }
        ComboBox.SetCurSel(i);
        return true;
    }
    return false;
}
Esempio n. 3
0
void COptionPluginPage::ApplyComboBoxes ( void )
{
	for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
	{
		CModifiedComboBox * ComboBox = cb_iter->second;
		if (ComboBox->IsChanged())
		{
			int index = ComboBox->GetCurSel();
			if (index == CB_ERR) 
			{
				return; 
			}

			const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index);
			if (PluginPtr == NULL)
			{
				return;
			}

			const CPluginList::PLUGIN * Plugin = *PluginPtr;

			g_Settings->SaveString(cb_iter->first,Plugin->FileName.c_str());
			switch (Plugin->Info.Type)
			{
			case PLUGIN_TYPE_RSP:        g_Settings->SaveBool(Plugin_RSP_Changed,true); break;
			case PLUGIN_TYPE_GFX:        g_Settings->SaveBool(Plugin_GFX_Changed,true); break;
			case PLUGIN_TYPE_AUDIO:      g_Settings->SaveBool(Plugin_AUDIO_Changed,true); break;
			case PLUGIN_TYPE_CONTROLLER: g_Settings->SaveBool(Plugin_CONT_Changed,true); break;
			default:
				g_Notify->BreakPoint(__FILE__,__LINE__);
			}
		}
		if (ComboBox->IsReset())
		{
			g_Settings->DeleteSetting(cb_iter->first);
			ComboBox->SetReset(false);
		}
	}
}