Mgr: Flush Manager settings to Windows Registry or user prefs when selecting a different skin

This commit is contained in:
Charlie Fenton 2013-04-30 05:44:55 -07:00
parent 78847a0181
commit 6efb00118c
2 changed files with 10 additions and 5 deletions

View File

@ -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);

View File

@ -446,6 +446,9 @@ void CSimpleFrame::OnSelectSkin( wxCommandEvent& event ){
selectedItem->Check(true);
pSkinManager->ReloadSkin(newSkinName);
wxGetApp().SaveState();
wxConfigBase::Get(FALSE)->Flush();
}