diff --git a/checkin_notes b/checkin_notes index fb3a203f31..959d15c500 100644 --- a/checkin_notes +++ b/checkin_notes @@ -188,7 +188,7 @@ Charlie 7 Jan 2010 PTP-ReadMe.rtf ReadMe.rtf -David 7 Jan 2009 +David 7 Jan 2010 - manager: tweak notice appearance client/ @@ -196,9 +196,15 @@ David 7 Jan 2009 clientgui/ ViewNotifications.cpp -David 7 Jan 2009 +David 7 Jan 2010 - client: work fetch fix: avoid sending null request in certain cases. - client: fix crash in notices code client/ cs_notice.cpp work_fetch.cpp + +Rom 7 Jan 2010 + - MGR: Prevent timer events from causing recursive ui issues. + + clientgui/ + ViewNotifications.cpp diff --git a/clientgui/ViewNotifications.cpp b/clientgui/ViewNotifications.cpp index eea902af4b..2cd364342f 100644 --- a/clientgui/ViewNotifications.cpp +++ b/clientgui/ViewNotifications.cpp @@ -138,44 +138,50 @@ void CViewNotifications::OnListRender( wxTimerEvent& WXUNUSED(event) ) { wxDateTime dtBuffer; int n = 0; unsigned int i = 0; + static bool s_bInProgress = false; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(m_pHtmlPane); - n = pDoc->GetNoticeCount(); + if (!s_bInProgress) { + s_bInProgress = true; - if (n == -1) { - strItems += _("Retrieving notices..."); - } else { + n = pDoc->GetNoticeCount(); - // Pre-allocate buffer size so string concat is much faster - strItems.Alloc(4096*n); + if (n == -1) { + strItems += _("Retrieving notices..."); + } else { - for (i = 0; i < (unsigned int)n; i++) { - NOTICE* np = pDoc->notice(i); - if (!np) continue; - char tbuf[512]; - if (strlen(np->title)) { - sprintf(tbuf, "%s
", np->title); - strItems += wxString(tbuf, wxConvUTF8); + // Pre-allocate buffer size so string concat is much faster + strItems.Alloc(4096*n); + for (i = 0; i < (unsigned int)n; i++) { + NOTICE* np = pDoc->notice(i); + if (!np) continue; + char tbuf[512]; + if (strlen(np->title)) { + sprintf(tbuf, "%s
", np->title); + strItems += wxString(tbuf, wxConvUTF8); + + } + strItems += wxString(np->description.c_str(), wxConvUTF8); + strItems += wxT("
"); + dtBuffer.Set((time_t)np->arrival_time); + strItems += dtBuffer.Format(); + strItems += wxT("
\n"); } - strItems += wxString(np->description.c_str(), wxConvUTF8); - strItems += wxT("
"); - dtBuffer.Set((time_t)np->arrival_time); - strItems += dtBuffer.Format(); - strItems += wxT("
\n"); } - } - strHTML = wxT("\n\n"); - strHTML += strItems; - //strHTML += wxT("

foobar

blah blah\n"); - strHTML += wxT("\n\n"); - m_pHtmlPane->SetFonts(wxT("Sans Serif"), wxT("Courier"), 0); - m_pHtmlPane->SetPage( strHTML ); + strHTML = wxT("\n\n"); + strHTML += strItems; + strHTML += wxT("\n\n"); + m_pHtmlPane->SetFonts(wxT("Sans Serif"), wxT("Courier"), 0); + m_pHtmlPane->SetPage( strHTML ); + + s_bInProgress = false; + } wxLogTrace(wxT("Function Start/End"), wxT("CViewNotifications::OnListRender - Function End")); }