From 3239f120cfe26d2471050062405b6c43e273dc8d Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 23 Dec 2009 11:01:48 +0000 Subject: [PATCH] MGR: Fix save and restore of Event Log column widths svn path=/trunk/boinc/; revision=20025 --- checkin_notes | 8 +++++++- clientgui/DlgEventLog.cpp | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index f504438049..9aa71189c1 100644 --- a/checkin_notes +++ b/checkin_notes @@ -10648,7 +10648,7 @@ Charlie 22 Dec 2009 DlgEventLog.cpp Charlie 22 Dec 2009 - - MGR: Restore my previous fixes to Event Log for the new orphan + - MGR: Adapt my previous fixes to Event Log for the new orphan dialog implementation to integrate properly with async RPC logic: - Always set Periodic RPC timer to 1 second if showing event log. - Eliminate separate timer. @@ -10664,3 +10664,9 @@ Charlie 22 Dec 2009 Events.h MainDocument.h sg_BoincSimpleGUI.cpp, .h + +Charlie 23 Dec 2009 + - MGR: Fix save and restore of Event Log column widths. + + clientgui/ + DlgEventLog.cpp diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 5bb7f37b9b..4438f86446 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -353,7 +353,7 @@ void CDlgEventLog::OnRefresh( wxTimerEvent& WXUNUSED(event) ) { bool CDlgEventLog::SaveState() { wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::SaveState - Function Begin")); - wxString strBaseConfigLocation = wxString(wxT("/Messages")); + wxString strBaseConfigLocation = wxString(wxT("/Messages/")); wxConfigBase* pConfig = wxConfigBase::Get(FALSE); wxListItem liColumnInfo; wxInt32 iIndex = 0; @@ -370,11 +370,11 @@ bool CDlgEventLog::SaveState() { // // Save Frame State // - pConfig->SetPath(strBaseConfigLocation); - // Reterieve and store the latest window dimensions. SaveWindowDimensions(); + pConfig->SetPath(strBaseConfigLocation); + // Convert to a zero based index iColumnCount = m_pList->GetColumnCount() - 1; @@ -399,7 +399,7 @@ bool CDlgEventLog::SaveState() { void CDlgEventLog::SaveWindowDimensions() { - wxString strBaseConfigLocation = wxString(wxT("/Simple/Messages")); + wxString strBaseConfigLocation = wxString(wxT("/EventLog")); wxConfigBase* pConfig = wxConfigBase::Get(FALSE); wxASSERT(pConfig); @@ -421,7 +421,7 @@ void CDlgEventLog::SaveWindowDimensions() { bool CDlgEventLog::RestoreState() { wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::RestoreState - Function Begin")); - wxString strBaseConfigLocation = wxString(wxT("/Messages")); + wxString strBaseConfigLocation = wxString(wxT("/Messages/")); wxConfigBase* pConfig = wxConfigBase::Get(FALSE); wxListItem liColumnInfo; wxInt32 iIndex = 0; @@ -439,11 +439,12 @@ bool CDlgEventLog::RestoreState() { // // Restore Frame State // - pConfig->SetPath(strBaseConfigLocation); // Restore the windows properties RestoreWindowDimensions(); + pConfig->SetPath(strBaseConfigLocation); + // Convert to a zero based index iColumnCount = m_pList->GetColumnCount() - 1; @@ -459,10 +460,12 @@ bool CDlgEventLog::RestoreState() { m_pList->GetColumn(iIndex, liColumnInfo); pConfig->SetPath(strBaseConfigLocation + liColumnInfo.GetText()); - pConfig->Read(wxT("Width"), &iTempValue, -1); if (-1 != iTempValue) { + liColumnInfo.SetWidth(iTempValue); +#if (defined(__WXMAC__) && wxCHECK_VERSION(2,8,0)) m_pList->SetColumnWidth(iIndex,iTempValue); // Work around bug in wxMac-2.8.0 wxListCtrl::SetColumn() +#endif } m_pList->SetColumn(iIndex, liColumnInfo); @@ -474,7 +477,7 @@ bool CDlgEventLog::RestoreState() { void CDlgEventLog::RestoreWindowDimensions() { - wxString strBaseConfigLocation = wxString(wxT("/Simple/Messages")); + wxString strBaseConfigLocation = wxString(wxT("/EventLog")); wxConfigBase* pConfig = wxConfigBase::Get(FALSE); bool bWindowIconized = false; bool bWindowMaximized = false;