diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index 6c6fc5b555..e63c646946 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -76,6 +76,10 @@ void SConfig::SaveSettings() ini.Set("Interface", "HideCursor", m_LocalCoreStartupParameter.bHideCursor); ini.Set("Interface", "AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor); ini.Set("Interface", "Theme", m_LocalCoreStartupParameter.iTheme); + ini.Set("Interface", "MainWindowPosX", m_LocalCoreStartupParameter.iPosX); + ini.Set("Interface", "MainWindowPosY", m_LocalCoreStartupParameter.iPosY); + ini.Set("Interface", "MainWindowWidth", m_LocalCoreStartupParameter.iWidth); + ini.Set("Interface", "MainWindowHeight", m_LocalCoreStartupParameter.iHeight); ini.Set("Interface", "ShowWiimoteLeds", m_LocalCoreStartupParameter.bWiiLeds); ini.Set("Interface", "ShowWiimoteSpeakers", m_LocalCoreStartupParameter.bWiiSpeakers); ini.Set("Interface", "Language", m_InterfaceLanguage); @@ -191,6 +195,10 @@ void SConfig::LoadSettings() ini.Get("Interface", "HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false); ini.Get("Interface", "AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false); ini.Get("Interface", "Theme", &m_LocalCoreStartupParameter.iTheme, 0); + ini.Get("Interface", "MainWindowPosX", &m_LocalCoreStartupParameter.iPosX, 100); + ini.Get("Interface", "MainWindowPosY", &m_LocalCoreStartupParameter.iPosY, 100); + ini.Get("Interface", "MainWindowWidth", &m_LocalCoreStartupParameter.iWidth, 800); + ini.Get("Interface", "MainWindowHeight", &m_LocalCoreStartupParameter.iHeight, 600); ini.Get("Interface", "ShowWiimoteLeds", &m_LocalCoreStartupParameter.bWiiLeds, false); ini.Get("Interface", "ShowWiimoteSpeakers", &m_LocalCoreStartupParameter.bWiiSpeakers, false); ini.Get("Interface", "Language", (int*)&m_InterfaceLanguage, 0); diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index c3fcf69212..f319db2105 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -48,6 +48,11 @@ void SCoreStartupParameter::LoadDefaults() SelectedLanguage = 0; iTLBHack = 0; + iPosX = 100; + iPosY = 100; + iWidth = 800; + iHeight = 600; + bJITOff = false; // debugger only settings bJITLoadStoreOff = false; bJITLoadStoreFloatingOff = false; diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index eedeebfb89..d2ac1bcd20 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -79,6 +79,7 @@ struct SCoreStartupParameter // Interface settings bool bConfirmStop, bHideCursor, bAutoHideCursor, bUsePanicHandlers; int iTheme; + int iPosX, iPosY, iWidth, iHeight; enum EBootBS2 { diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp index 0f9d7d6551..8c785fa0b8 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp @@ -172,12 +172,6 @@ void CCodeWindow::Save() ini.Set("Float", "Sound", !!FindWindowById(IDM_SOUNDWINDOW_PARENT)); ini.Set("Float", "Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT)); - // Save window settings - ini.Set("MainWindow", "x", Parent->GetPosition().x); - ini.Set("MainWindow", "y", Parent->GetPosition().y); - ini.Set("MainWindow", "w", Parent->GetSize().GetWidth()); - ini.Set("MainWindow", "h", Parent->GetSize().GetHeight()); - ini.Save(DEBUGGER_CONFIG_FILE); } diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index ef64b052ee..e21de4ddac 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -271,6 +271,7 @@ EVT_MENU_RANGE(IDM_LISTWAD, IDM_LISTDRIVES, CFrame::GameListChanged) EVT_ACTIVATE(CFrame::OnActive) EVT_CLOSE(CFrame::OnClose) EVT_SIZE(CFrame::OnResize) +EVT_MOVE(CFrame::OnMove) EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnGameListCtrl_ItemActivated) EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage) #if wxUSE_TIMER @@ -553,10 +554,20 @@ void CFrame::PostUpdateUIEvent(wxUpdateUIEvent& event) if (g_pCodeWindow) g_pCodeWindow->AddPendingEvent(event); } +void CFrame::OnMove(wxMoveEvent& event) +{ + event.Skip(); + + SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX = GetPosition().x; + SConfig::GetInstance().m_LocalCoreStartupParameter.iPosY = GetPosition().y; +} void CFrame::OnResize(wxSizeEvent& event) { event.Skip(); + SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth = GetSize().GetWidth(); + SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight = GetSize().GetHeight(); + DoMoveIcons(); // In FrameWiimote.cpp } void CFrame::OnResizeAll(wxSizeEvent& event) diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 28dc704742..011b64a329 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -294,6 +294,7 @@ class CFrame : public wxFrame void OnToggleSkipIdle(wxCommandEvent& event); void OnToggleThrottle(wxCommandEvent& event); void OnManagerResize(wxAuiManagerEvent& event); + void OnMove(wxMoveEvent& event); void OnResize(wxSizeEvent& event); void OnResizeAll(wxSizeEvent& event); void OnToggleToolbar(wxCommandEvent& event); diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index aae53415c4..a7f2d92e3b 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -394,28 +394,13 @@ bool DolphinApp::OnInit() #endif #endif + int x = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX; + int y = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosY; + int w = SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth; + int h = SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight; - - if (UseDebugger) - { - // If we are debugging let user save the main window position and size - IniFile ini; - ini.Load(DEBUGGER_CONFIG_FILE); - int x, y, w, h; - - ini.Get("MainWindow", "x", &x, 100); - ini.Get("MainWindow", "y", &y, 100); - ini.Get("MainWindow", "w", &w, 800); - ini.Get("MainWindow", "h", &h, 600); - - main_frame = new CFrame((wxFrame*)NULL, wxID_ANY, wxString::FromAscii(title), - wxPoint(x, y), wxSize(w, h), true, UseLogger); - } - else - { - main_frame = new CFrame((wxFrame*)NULL, wxID_ANY, wxString::FromAscii(title), - wxPoint(100, 100), wxSize(800, 600), false, UseLogger); - } + main_frame = new CFrame((wxFrame*)NULL, wxID_ANY, wxString::FromAscii(title), + wxPoint(x, y), wxSize(w, h), UseDebugger, UseLogger); // ------------ // Check the autoboot options.