- MGR: User errors are supposed to be red, not internal errors.

clientgui/
        ViewMessages.cpp, .h

svn path=/trunk/boinc/; revision=13795
This commit is contained in:
Rom Walton 2007-10-08 18:58:35 +00:00
parent 442711ede4
commit 962eb54a3d
3 changed files with 22 additions and 30 deletions

View File

@ -9310,3 +9310,8 @@ Janus 8 Oct 2007
database/
bittorrent_peers.sql
Rom 8 Oct 2007
- MGR: User errors are supposed to be red, not internal errors.
clientgui/
ViewMessages.cpp, .h

View File

@ -272,14 +272,17 @@ wxString CViewMessages::OnListGetItemText(long item, long column) const {
wxListItemAttr* CViewMessages::OnListGetItemAttr(long item) const {
wxListItemAttr* pAttribute = NULL;
MESSAGE* message = wxGetApp().GetDocument()->message(item);
wxString strBuffer = wxEmptyString;
FormatPriority(item, strBuffer);
if (wxT("E") == strBuffer) {
if (message) {
switch(message->priority) {
case MSG_USER_ERROR:
pAttribute = m_pMessageErrorAttr;
} else {
pAttribute = m_pMessageInfoAttr;
break;
default:
break;
}
}
return pAttribute;
@ -318,28 +321,6 @@ wxInt32 CViewMessages::FormatProjectName(wxInt32 item, wxString& strBuffer) cons
}
wxInt32 CViewMessages::FormatPriority(wxInt32 item, wxString& strBuffer) const {
MESSAGE* message = wxGetApp().GetDocument()->message(item);
if (message) {
switch(message->priority) {
case MSG_INFO:
strBuffer = wxT("I");
break;
case MSG_USER_ERROR:
strBuffer = wxT("W");
break;
case MSG_INTERNAL_ERROR:
default:
strBuffer = wxT("E");
break;
}
}
return 0;
}
wxInt32 CViewMessages::FormatTime(wxInt32 item, wxString& strBuffer) const {
wxDateTime dtBuffer;
MESSAGE* message = wxGetApp().GetDocument()->message(item);
@ -357,7 +338,14 @@ wxInt32 CViewMessages::FormatMessage(wxInt32 item, wxString& strBuffer) const {
MESSAGE* message = wxGetApp().GetDocument()->message(item);
if (message) {
switch(message->priority) {
case MSG_INTERNAL_ERROR:
strBuffer = wxT("[error]") + wxString(message->body.c_str(), wxConvUTF8);
break;
default:
strBuffer = wxString(message->body.c_str(), wxConvUTF8);
break;
}
}
strBuffer.Replace(wxT("\n"), wxT(""), true);

View File

@ -66,7 +66,6 @@ protected:
virtual void UpdateSelection();
wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const;
wxInt32 FormatPriority( wxInt32 item, wxString& strBuffer ) const;
wxInt32 FormatTime( wxInt32 item, wxString& strBuffer ) const;
wxInt32 FormatMessage( wxInt32 item, wxString& strBuffer ) const;