mirror of https://github.com/BOINC/boinc.git
- client: don't do two RSS fetches at once
- manager: WxWidget's HTML renderer doesn't seem to like \n's. For example, if you try to render foo <img src=...> blah all it shows is foo. Work around this by replacing \n's with <br> svn path=/trunk/boinc/; revision=22017
This commit is contained in:
parent
bb35d196ef
commit
a33d6a6f8b
|
@ -5313,3 +5313,18 @@ David 20 Jul 2010
|
||||||
|
|
||||||
configure.ac
|
configure.ac
|
||||||
Makefile.am
|
Makefile.am
|
||||||
|
|
||||||
|
David 20 Jul 2010
|
||||||
|
- client: don't do two RSS fetches at once
|
||||||
|
- manager: WxWidget's HTML renderer doesn't seem to like \n's.
|
||||||
|
For example, if you try to render
|
||||||
|
foo
|
||||||
|
<img src=...>
|
||||||
|
blah
|
||||||
|
all it shows is foo.
|
||||||
|
Work around this by replacing \n's with <br>
|
||||||
|
|
||||||
|
client/
|
||||||
|
cs_notice.cpp
|
||||||
|
clientgui/
|
||||||
|
NoticeListCtrl.cpp
|
||||||
|
|
|
@ -602,6 +602,7 @@ bool RSS_FEED_OP::poll() {
|
||||||
strcpy(url, rf.url);
|
strcpy(url, rf.url);
|
||||||
}
|
}
|
||||||
gstate.gui_http.do_rpc(this, url, filename);
|
gstate.gui_http.do_rpc(this, url, filename);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -172,6 +172,22 @@ wxAccStatus CNoticeListCtrlAccessible::DoDefaultAction(int childId)
|
||||||
return wxACC_NOT_IMPLEMENTED;
|
return wxACC_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void fix_html(const char* in, char* out) {
|
||||||
|
while (*in) {
|
||||||
|
switch (*in) {
|
||||||
|
case '\n':
|
||||||
|
strcpy(out, "<br>");
|
||||||
|
out += 4;
|
||||||
|
break;
|
||||||
|
case '\r':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*out++ = *in;
|
||||||
|
}
|
||||||
|
in++;
|
||||||
|
}
|
||||||
|
*out = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the description for this object or a child.
|
// Returns the description for this object or a child.
|
||||||
wxAccStatus CNoticeListCtrlAccessible::GetDescription(int childId, wxString* description)
|
wxAccStatus CNoticeListCtrlAccessible::GetDescription(int childId, wxString* description)
|
||||||
|
@ -183,12 +199,13 @@ wxAccStatus CNoticeListCtrlAccessible::GetDescription(int childId, wxString* des
|
||||||
wxString strProjectName = wxEmptyString;
|
wxString strProjectName = wxEmptyString;
|
||||||
wxString strArrivalTime = wxEmptyString;
|
wxString strArrivalTime = wxEmptyString;
|
||||||
|
|
||||||
if (pDoc && (childId != wxACC_SELF))
|
if (pDoc && (childId != wxACC_SELF)) {
|
||||||
{
|
|
||||||
strBuffer = wxEmptyString;
|
strBuffer = wxEmptyString;
|
||||||
if (pDoc)
|
|
||||||
{
|
// WxWidget's HTML renderer gets messed up by \n's. change to <br>
|
||||||
strDescription = wxString(process_client_message(pDoc->notice(childId-1)->description.c_str()), wxConvUTF8);
|
char buf[8192];
|
||||||
|
fix_html(pDoc->notice(childId-1)->description.c_str(), buf);
|
||||||
|
strDescription = process_client_message(buf);
|
||||||
strProjectName = wxString(pDoc->notice(childId-1)->project_name, wxConvUTF8);
|
strProjectName = wxString(pDoc->notice(childId-1)->project_name, wxConvUTF8);
|
||||||
dtBuffer.Set((time_t)pDoc->notice(childId-1)->arrival_time);
|
dtBuffer.Set((time_t)pDoc->notice(childId-1)->arrival_time);
|
||||||
strArrivalTime = dtBuffer.Format();
|
strArrivalTime = dtBuffer.Format();
|
||||||
|
@ -203,7 +220,6 @@ wxAccStatus CNoticeListCtrlAccessible::GetDescription(int childId, wxString* des
|
||||||
|
|
||||||
return wxACC_OK;
|
return wxACC_OK;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Let the framework handle the other cases.
|
// Let the framework handle the other cases.
|
||||||
return wxACC_NOT_IMPLEMENTED;
|
return wxACC_NOT_IMPLEMENTED;
|
||||||
|
@ -532,7 +548,9 @@ wxString CNoticeListCtrl::OnGetItem(size_t i) const
|
||||||
strProjectName = wxString(np->project_name, wxConvUTF8);
|
strProjectName = wxString(np->project_name, wxConvUTF8);
|
||||||
strURL = wxString(np->link, wxConvUTF8);
|
strURL = wxString(np->link, wxConvUTF8);
|
||||||
strTitle = wxString(process_client_message(np->title), wxConvUTF8);
|
strTitle = wxString(process_client_message(np->title), wxConvUTF8);
|
||||||
strDescription = wxString(process_client_message(np->description.c_str()), wxConvUTF8);
|
char buf[8192];
|
||||||
|
fix_html(np->description.c_str(), buf);
|
||||||
|
strDescription = process_client_message(buf);
|
||||||
|
|
||||||
dtBuffer.Set((time_t)np->arrival_time);
|
dtBuffer.Set((time_t)np->arrival_time);
|
||||||
strArrivalTime = dtBuffer.Format();
|
strArrivalTime = dtBuffer.Format();
|
||||||
|
|
Loading…
Reference in New Issue