MGR: Fix save and restore of Event Log column widths

svn path=/trunk/boinc/; revision=20025
This commit is contained in:
Charlie Fenton 2009-12-23 11:01:48 +00:00
parent e4a2d2feeb
commit 3239f120cf
2 changed files with 18 additions and 9 deletions

View File

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

View File

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