Qt: Add controller (overview) window

This commit is contained in:
spycrab
2017-05-09 18:49:10 +02:00
parent a11775396f
commit c8d0b647ac
14 changed files with 708 additions and 27 deletions

View File

@ -39,6 +39,7 @@
#include "DolphinWX/Input/WiimoteInputConfigDiag.h"
#include "DolphinWX/WxUtils.h"
#include "InputCommon/GCAdapter.h"
#include "UICommon/UICommon.h"
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#include "UICommon/X11Utils.h"
@ -394,7 +395,7 @@ void ControllerConfigDiag::OnClose(wxCloseEvent& event)
{
// Save all settings
SConfig::GetInstance().SaveSettings();
SaveWiimoteSource();
UICommon::SaveWiimoteSources();
EndModal(wxID_OK);
}
@ -591,26 +592,3 @@ void ControllerConfigDiag::OnEnableSpeaker(wxCommandEvent& event)
{
SConfig::GetInstance().m_WiimoteEnableSpeaker = event.IsChecked();
}
void ControllerConfigDiag::SaveWiimoteSource()
{
std::string ini_filename = File::GetUserPath(D_CONFIG_IDX) + WIIMOTE_INI_NAME ".ini";
IniFile inifile;
inifile.Load(ini_filename);
for (unsigned int i = 0; i < MAX_WIIMOTES; ++i)
{
std::string secname("Wiimote");
secname += (char)('1' + i);
IniFile::Section& sec = *inifile.GetOrCreateSection(secname);
sec.Set("Source", (int)g_wiimote_sources[i]);
}
std::string secname("BalanceBoard");
IniFile::Section& sec = *inifile.GetOrCreateSection(secname);
sec.Set("Source", (int)g_wiimote_sources[WIIMOTE_BALANCE_BOARD]);
inifile.Save(ini_filename);
}