From 6efb00118c53faa741ae7137ab3434b99e349ad4 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 30 Apr 2013 05:44:55 -0700 Subject: [PATCH] Mgr: Flush Manager settings to Windows Registry or user prefs when selecting a different skin --- clientgui/BOINCGUIApp.cpp | 12 +++++++----- clientgui/sg_BoincSimpleFrame.cpp | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index a2d48eb1f5..3cb9a11dcb 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -514,9 +514,10 @@ int CBOINCGUIApp::OnExit() { m_pDocument = NULL; } - m_pConfig->SetPath(wxT("/")); + // Save Application State + SaveState(); + if (m_pSkinManager) { - m_pConfig->Write(wxT("Skin"), m_pSkinManager->GetSelectedSkin()); delete m_pSkinManager; } @@ -530,9 +531,6 @@ int CBOINCGUIApp::OnExit() { m_pEventLog = NULL; } - // Save Application State - SaveState(); - diagnostics_finish(); return wxApp::OnExit(); @@ -541,6 +539,10 @@ int CBOINCGUIApp::OnExit() { void CBOINCGUIApp::SaveState() { // Save Application State + m_pConfig->SetPath(wxT("/")); + if (m_pSkinManager) { + m_pConfig->Write(wxT("Skin"), m_pSkinManager->GetSelectedSkin()); + } m_pConfig->Write(wxT("AutomaticallyShutdownClient"), m_iShutdownCoreClient); m_pConfig->Write(wxT("DisplayShutdownClientDialog"), m_iDisplayExitDialog); m_pConfig->Write(wxT("DisableAutoStart"), m_iBOINCMGRDisableAutoStart); diff --git a/clientgui/sg_BoincSimpleFrame.cpp b/clientgui/sg_BoincSimpleFrame.cpp index f7ca505a94..3657a5bc11 100644 --- a/clientgui/sg_BoincSimpleFrame.cpp +++ b/clientgui/sg_BoincSimpleFrame.cpp @@ -446,6 +446,9 @@ void CSimpleFrame::OnSelectSkin( wxCommandEvent& event ){ selectedItem->Check(true); pSkinManager->ReloadSkin(newSkinName); + + wxGetApp().SaveState(); + wxConfigBase::Get(FALSE)->Flush(); }