mirror of https://github.com/BOINC/boinc.git
- 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:
parent
442711ede4
commit
962eb54a3d
|
@ -9310,3 +9310,8 @@ Janus 8 Oct 2007
|
||||||
database/
|
database/
|
||||||
bittorrent_peers.sql
|
bittorrent_peers.sql
|
||||||
|
|
||||||
|
Rom 8 Oct 2007
|
||||||
|
- MGR: User errors are supposed to be red, not internal errors.
|
||||||
|
|
||||||
|
clientgui/
|
||||||
|
ViewMessages.cpp, .h
|
||||||
|
|
|
@ -272,14 +272,17 @@ wxString CViewMessages::OnListGetItemText(long item, long column) const {
|
||||||
|
|
||||||
wxListItemAttr* CViewMessages::OnListGetItemAttr(long item) const {
|
wxListItemAttr* CViewMessages::OnListGetItemAttr(long item) const {
|
||||||
wxListItemAttr* pAttribute = NULL;
|
wxListItemAttr* pAttribute = NULL;
|
||||||
|
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
||||||
wxString strBuffer = wxEmptyString;
|
wxString strBuffer = wxEmptyString;
|
||||||
|
|
||||||
FormatPriority(item, strBuffer);
|
if (message) {
|
||||||
|
switch(message->priority) {
|
||||||
if (wxT("E") == strBuffer) {
|
case MSG_USER_ERROR:
|
||||||
pAttribute = m_pMessageErrorAttr;
|
pAttribute = m_pMessageErrorAttr;
|
||||||
} else {
|
break;
|
||||||
pAttribute = m_pMessageInfoAttr;
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pAttribute;
|
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 {
|
wxInt32 CViewMessages::FormatTime(wxInt32 item, wxString& strBuffer) const {
|
||||||
wxDateTime dtBuffer;
|
wxDateTime dtBuffer;
|
||||||
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
||||||
|
@ -357,7 +338,14 @@ wxInt32 CViewMessages::FormatMessage(wxInt32 item, wxString& strBuffer) const {
|
||||||
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
strBuffer = wxString(message->body.c_str(), wxConvUTF8);
|
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);
|
strBuffer.Replace(wxT("\n"), wxT(""), true);
|
||||||
|
|
|
@ -66,7 +66,6 @@ protected:
|
||||||
virtual void UpdateSelection();
|
virtual void UpdateSelection();
|
||||||
|
|
||||||
wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const;
|
wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const;
|
||||||
wxInt32 FormatPriority( wxInt32 item, wxString& strBuffer ) const;
|
|
||||||
wxInt32 FormatTime( wxInt32 item, wxString& strBuffer ) const;
|
wxInt32 FormatTime( wxInt32 item, wxString& strBuffer ) const;
|
||||||
wxInt32 FormatMessage( wxInt32 item, wxString& strBuffer ) const;
|
wxInt32 FormatMessage( wxInt32 item, wxString& strBuffer ) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue