mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-31 18:11:31 +02:00
position and size of the main window are now saved (fixes issue 2035)
Note that running in debug mode (Dolphin.exe -d) still maximizes the window and stores that size aswell. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4879 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
e44e412da8
commit
8fec36b22a
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -79,6 +79,7 @@ struct SCoreStartupParameter
|
||||
// Interface settings
|
||||
bool bConfirmStop, bHideCursor, bAutoHideCursor, bUsePanicHandlers;
|
||||
int iTheme;
|
||||
int iPosX, iPosY, iWidth, iHeight;
|
||||
|
||||
enum EBootBS2
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -394,28 +394,13 @@ bool DolphinApp::OnInit()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
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);
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
wxPoint(x, y), wxSize(w, h), UseDebugger, UseLogger);
|
||||
|
||||
// ------------
|
||||
// Check the autoboot options.
|
||||
|
Loading…
Reference in New Issue
Block a user