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:
Michael Maltese
2017-06-22 15:11:53 -07:00
parent 898bbffaa7
commit d0fdb9f149
16 changed files with 132 additions and 448 deletions

View File

@ -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();
}

View File

@ -8,7 +8,7 @@
#include "DolphinQt2/Config/Mapping/GCPadWiiU.h"
#include "DolphinQt2/Settings.h"
#include "Core/ConfigManager.h"
#include "InputCommon/GCAdapter.h"
GCPadWiiU::GCPadWiiU(MappingWindow* window) : MappingWidget(window)
@ -48,14 +48,14 @@ void GCPadWiiU::ConnectWidgets()
void GCPadWiiU::LoadSettings()
{
m_rumble->setChecked(Settings::Instance().IsGCAdapterRumbleEnabled(GetPort()));
m_simulate_bongos->setChecked(Settings::Instance().IsGCAdapterSimulatingDKBongos(GetPort()));
m_rumble->setChecked(SConfig::GetInstance().m_AdapterRumble[GetPort()]);
m_simulate_bongos->setChecked(SConfig::GetInstance().m_AdapterKonga[GetPort()]);
}
void GCPadWiiU::SaveSettings()
{
Settings::Instance().SetGCAdapterRumbleEnabled(GetPort(), m_rumble->isChecked());
Settings::Instance().SetGCAdapterSimulatingDKBongos(GetPort(), m_simulate_bongos->isChecked());
SConfig::GetInstance().m_AdapterRumble[GetPort()] = m_rumble->isChecked();
SConfig::GetInstance().m_AdapterKonga[GetPort()] = m_simulate_bongos->isChecked();
}
InputConfig* GCPadWiiU::GetConfig()

View File

@ -72,7 +72,6 @@ void SettingsWindow::SetupSettingsWidget()
void SettingsWindow::AddCategoryToList(const QString& title, const std::string& icon_name)
{
QString dir = Settings::Instance().GetThemeDir();
QListWidgetItem* button = new QListWidgetItem();
button->setText(title);
button->setTextAlignment(Qt::AlignVCenter);