mirror of https://github.com/BOINC/boinc.git
Mgr: Flush Manager settings to Windows Registry or user prefs when closing Options dialog
This commit is contained in:
parent
c5368a62d9
commit
66e61912c9
|
@ -530,11 +530,8 @@ int CBOINCGUIApp::OnExit() {
|
|||
m_pEventLog = NULL;
|
||||
}
|
||||
|
||||
|
||||
// Save Application State
|
||||
m_pConfig->Write(wxT("AutomaticallyShutdownClient"), m_iShutdownCoreClient);
|
||||
m_pConfig->Write(wxT("DisplayShutdownClientDialog"), m_iDisplayExitDialog);
|
||||
m_pConfig->Write(wxT("DisableAutoStart"), m_iBOINCMGRDisableAutoStart);
|
||||
SaveState();
|
||||
|
||||
diagnostics_finish();
|
||||
|
||||
|
@ -542,6 +539,14 @@ int CBOINCGUIApp::OnExit() {
|
|||
}
|
||||
|
||||
|
||||
void CBOINCGUIApp::SaveState() {
|
||||
// Save Application State
|
||||
m_pConfig->Write(wxT("AutomaticallyShutdownClient"), m_iShutdownCoreClient);
|
||||
m_pConfig->Write(wxT("DisplayShutdownClientDialog"), m_iDisplayExitDialog);
|
||||
m_pConfig->Write(wxT("DisableAutoStart"), m_iBOINCMGRDisableAutoStart);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Pass the command line parameters and discriptions to wxWidgets for displaying.
|
||||
///
|
||||
|
|
|
@ -57,7 +57,7 @@ protected:
|
|||
#if (defined(__WXMSW__) && !wxCHECK_VERSION(2, 9, 4))
|
||||
void OnEndSession(wxCloseEvent& event);
|
||||
#endif
|
||||
|
||||
|
||||
void OnInitCmdLine(wxCmdLineParser &parser);
|
||||
bool OnCmdLineParsed(wxCmdLineParser &parser);
|
||||
|
||||
|
@ -122,6 +122,7 @@ protected:
|
|||
public:
|
||||
|
||||
bool OnInit();
|
||||
void SaveState();
|
||||
|
||||
wxLocale* GetLocale() { return m_pLocale; }
|
||||
CSkinManager* GetSkinManager() { return m_pSkinManager; }
|
||||
|
|
|
@ -76,6 +76,21 @@ CDlgOptions::CDlgOptions(wxWindow* parent, wxWindowID id, const wxString& captio
|
|||
Create(parent, id, caption, pos, size, style);
|
||||
}
|
||||
|
||||
|
||||
CDlgOptions::~CDlgOptions() {
|
||||
CBOINCBaseFrame* pFrame = wxGetApp().GetFrame();
|
||||
|
||||
wxASSERT(pDoc);
|
||||
wxASSERT(pFrame);
|
||||
wxASSERT(wxDynamicCast(pFrame, CBOINCBaseFrame));
|
||||
|
||||
wxGetApp().SaveState();
|
||||
pFrame->SaveState();
|
||||
|
||||
wxConfigBase::Get(FALSE)->Flush();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* CDlgToolsOptions creator
|
||||
*/
|
||||
|
|
|
@ -105,6 +105,9 @@ public:
|
|||
CDlgOptions( );
|
||||
CDlgOptions( wxWindow* parent, wxWindowID id = SYMBOL_CDLGOPTIONS_IDNAME, const wxString& caption = SYMBOL_CDLGOPTIONS_TITLE, const wxPoint& pos = SYMBOL_CDLGOPTIONS_POSITION, const wxSize& size = SYMBOL_CDLGOPTIONS_SIZE, long style = SYMBOL_CDLGOPTIONS_STYLE );
|
||||
|
||||
/// Destructor
|
||||
~CDlgOptions( );
|
||||
|
||||
/// Creation
|
||||
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CDLGOPTIONS_IDNAME, const wxString& caption = SYMBOL_CDLGOPTIONS_TITLE, const wxPoint& pos = SYMBOL_CDLGOPTIONS_POSITION, const wxSize& size = SYMBOL_CDLGOPTIONS_SIZE, long style = SYMBOL_CDLGOPTIONS_STYLE );
|
||||
|
||||
|
|
Loading…
Reference in New Issue