From f8fea83e677c2264fcc23d180b9388132433402a Mon Sep 17 00:00:00 2001 From: Michael M Date: Wed, 2 Aug 2017 16:51:05 -0700 Subject: NetPlayLauncher: store window geometry in native wxConfig --- Source/Core/DolphinWX/NetPlay/NetWindow.cpp | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'Source/Core/DolphinWX/NetPlay/NetWindow.cpp') diff --git a/Source/Core/DolphinWX/NetPlay/NetWindow.cpp b/Source/Core/DolphinWX/NetPlay/NetWindow.cpp index 98aefef953..870851dee1 100644 --- a/Source/Core/DolphinWX/NetPlay/NetWindow.cpp +++ b/Source/Core/DolphinWX/NetPlay/NetWindow.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include "Common/CommonTypes.h" #include "Common/FifoQueue.h" #include "Common/FileUtil.h" -#include "Common/IniFile.h" #include "Common/MsgHandler.h" #include "Common/StringUtil.h" @@ -77,15 +77,11 @@ NetPlayDialog::NetPlayDialog(wxWindow* const parent, const GameListCtrl* const g // Remember the window size and position for NetWindow { - IniFile inifile; - inifile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); - IniFile::Section& netplay_section = *inifile.GetOrCreateSection("NetPlay"); - int winPosX, winPosY, winWidth, winHeight; - netplay_section.Get("NetWindowPosX", &winPosX, std::numeric_limits::min()); - netplay_section.Get("NetWindowPosY", &winPosY, std::numeric_limits::min()); - netplay_section.Get("NetWindowWidth", &winWidth, -1); - netplay_section.Get("NetWindowHeight", &winHeight, -1); + wxConfig::Get()->Read("NetWindowPosX", &winPosX, std::numeric_limits::min()); + wxConfig::Get()->Read("NetWindowPosY", &winPosY, std::numeric_limits::min()); + wxConfig::Get()->Read("NetWindowWidth", &winWidth, -1); + wxConfig::Get()->Read("NetWindowHeight", &winHeight, -1); WxUtils::SetWindowSizeAndFitToScreen(this, wxPoint(winPosX, winPosY), wxSize(winWidth, winHeight), GetSize()); @@ -282,17 +278,10 @@ wxSizer* NetPlayDialog::CreateBottomGUI(wxWindow* parent) NetPlayDialog::~NetPlayDialog() { - IniFile inifile; - const std::string dolphin_ini = File::GetUserPath(F_DOLPHINCONFIG_IDX); - inifile.Load(dolphin_ini); - IniFile::Section& netplay_config = *inifile.GetOrCreateSection("NetPlay"); - - netplay_config.Set("NetWindowPosX", GetPosition().x); - netplay_config.Set("NetWindowPosY", GetPosition().y); - netplay_config.Set("NetWindowWidth", GetSize().GetWidth()); - netplay_config.Set("NetWindowHeight", GetSize().GetHeight()); - - inifile.Save(dolphin_ini); + wxConfig::Get()->Write("NetWindowPosX", GetPosition().x); + wxConfig::Get()->Write("NetWindowPosY", GetPosition().y); + wxConfig::Get()->Write("NetWindowWidth", GetSize().GetWidth()); + wxConfig::Get()->Write("NetWindowHeight", GetSize().GetHeight()); if (netplay_client) { -- cgit v1.2.3