mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-18 18:58:55 +02:00
DolphinQt2: replace Settings with SConfig where possible
Changes: - `ShowDevelopmentWarning` is now under the '[Interface]' group in Dolphin.ini, with other interface-related settings. So, whoever uses DolphinQt will have to edit that manually again. Sorry! - Game search paths and the last file are now shared properly with DolphinWX - Qt-only preferences like "Preferred View: list/table" are now stored using the platform's native settings storage, rather than in UI.ini
This commit is contained in:
@ -378,7 +378,7 @@ void ControllersWindow::OnWiimoteRefreshPressed()
|
||||
|
||||
void ControllersWindow::OnEmulationStateChanged(bool running)
|
||||
{
|
||||
if (!Settings::Instance().IsWiiGameRunning() || NetPlay::IsNetPlayRunning())
|
||||
if (!SConfig::GetInstance().bWii || NetPlay::IsNetPlayRunning())
|
||||
{
|
||||
m_wiimote_sync->setEnabled(!running);
|
||||
m_wiimote_reset->setEnabled(!running);
|
||||
@ -390,7 +390,7 @@ void ControllersWindow::OnEmulationStateChanged(bool running)
|
||||
m_wiimote_emu->setEnabled(!running);
|
||||
m_wiimote_passthrough->setEnabled(!running);
|
||||
|
||||
if (!Settings::Instance().IsWiiGameRunning())
|
||||
if (!SConfig::GetInstance().bWii)
|
||||
{
|
||||
m_wiimote_real_balance_board->setEnabled(!running);
|
||||
m_wiimote_continuous_scanning->setEnabled(!running);
|
||||
@ -478,35 +478,32 @@ void ControllersWindow::UnimplementedButton()
|
||||
|
||||
void ControllersWindow::LoadSettings()
|
||||
{
|
||||
auto& settings = Settings::Instance();
|
||||
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
|
||||
{
|
||||
m_gc_controller_boxes[i]->setCurrentIndex(ToGCMenuIndex(settings.GetSIDevice(i)));
|
||||
m_gc_controller_boxes[i]->setCurrentIndex(ToGCMenuIndex(SConfig::GetInstance().m_SIDevice[i]));
|
||||
m_wiimote_boxes[i]->setCurrentIndex(ToWiimoteMenuIndex(g_wiimote_sources[i]));
|
||||
}
|
||||
m_wiimote_real_balance_board->setChecked(g_wiimote_sources[WIIMOTE_BALANCE_BOARD] ==
|
||||
WIIMOTE_SRC_REAL);
|
||||
m_wiimote_speaker_data->setChecked(settings.IsWiimoteSpeakerEnabled());
|
||||
m_wiimote_continuous_scanning->setChecked(settings.IsContinuousScanningEnabled());
|
||||
m_wiimote_speaker_data->setChecked(SConfig::GetInstance().m_WiimoteEnableSpeaker);
|
||||
m_wiimote_continuous_scanning->setChecked(SConfig::GetInstance().m_WiimoteContinuousScanning);
|
||||
|
||||
m_advanced_bg_input->setChecked(settings.IsBackgroundInputEnabled());
|
||||
m_advanced_bg_input->setChecked(SConfig::GetInstance().m_BackgroundInput);
|
||||
|
||||
if (settings.IsBluetoothPassthroughEnabled())
|
||||
if (SConfig::GetInstance().m_bt_passthrough_enabled)
|
||||
m_wiimote_passthrough->setChecked(true);
|
||||
else
|
||||
m_wiimote_emu->setChecked(true);
|
||||
|
||||
OnWiimoteModeChanged(settings.IsBluetoothPassthroughEnabled());
|
||||
OnWiimoteModeChanged(SConfig::GetInstance().m_bt_passthrough_enabled);
|
||||
}
|
||||
|
||||
void ControllersWindow::SaveSettings()
|
||||
{
|
||||
auto& settings = Settings::Instance();
|
||||
settings.SetWiimoteSpeakerEnabled(m_wiimote_speaker_data->isChecked());
|
||||
settings.SetContinuousScanningEnabled(m_wiimote_continuous_scanning->isChecked());
|
||||
|
||||
settings.SetBluetoothPassthroughEnabled(m_wiimote_passthrough->isChecked());
|
||||
settings.SetBackgroundInputEnabled(m_advanced_bg_input->isChecked());
|
||||
SConfig::GetInstance().m_WiimoteEnableSpeaker = m_wiimote_speaker_data->isChecked();
|
||||
SConfig::GetInstance().m_WiimoteContinuousScanning = m_wiimote_continuous_scanning->isChecked();
|
||||
SConfig::GetInstance().m_bt_passthrough_enabled = m_wiimote_passthrough->isChecked();
|
||||
SConfig::GetInstance().m_BackgroundInput = m_advanced_bg_input->isChecked();
|
||||
|
||||
WiimoteReal::ChangeWiimoteSource(WIIMOTE_BALANCE_BOARD,
|
||||
m_wiimote_real_balance_board->isChecked() ? WIIMOTE_SRC_REAL :
|
||||
@ -524,8 +521,8 @@ void ControllersWindow::SaveSettings()
|
||||
for (size_t i = 0; i < m_gc_groups.size(); i++)
|
||||
{
|
||||
const int index = m_gc_controller_boxes[i]->currentIndex();
|
||||
settings.SetSIDevice(i, FromGCMenuIndex(index));
|
||||
SConfig::GetInstance().m_SIDevice[i] = FromGCMenuIndex(index);
|
||||
m_gc_buttons[i]->setEnabled(index != 0 && index != 6);
|
||||
}
|
||||
settings.Save();
|
||||
SConfig::GetInstance().SaveSettings();
|
||||
}
|
||||
|
Reference in New Issue
Block a user