mirror of https://github.com/BOINC/boinc.git
If Client connection lost, don't clear message window; show messages grayed out instead
svn path=/trunk/boinc/; revision=14564
This commit is contained in:
parent
8392c6a83d
commit
26f823ad99
|
@ -605,3 +605,15 @@ David Jan 15 2008
|
|||
|
||||
zip/zip/
|
||||
z_fileio.c
|
||||
|
||||
Charlie Jan 15 2008
|
||||
MGR: When connection to Client is lost, don't clear message window; show
|
||||
messages grayed out instead.
|
||||
NOTE: these changes may need to be applied in CViewMessagesGrid class
|
||||
if we implement that in the future.
|
||||
|
||||
clientgui/
|
||||
MainDocument.cpp
|
||||
clientgui/
|
||||
sg_DlgMessages.cpp
|
||||
ViewMessages.cpp
|
||||
|
|
|
@ -334,7 +334,7 @@ CMainDocument::CMainDocument() {
|
|||
m_dtFileTransfersTimestamp = wxDateTime((time_t)0);
|
||||
m_dtDiskUsageTimestamp = wxDateTime((time_t)0);
|
||||
m_dtStatisticsStatusTimestamp = wxDateTime((time_t)0);
|
||||
m_dtCachedSimpleGUITimestamp = wxDateTime((time_t)0);
|
||||
m_dtCachedSimpleGUITimestamp = wxDateTime((time_t)0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -434,14 +434,11 @@ int CMainDocument::ResetState() {
|
|||
state.clear();
|
||||
host.clear_host_info();
|
||||
results.clear();
|
||||
messages.clear();
|
||||
ft.clear();
|
||||
disk_usage.clear();
|
||||
proxy_info.clear();
|
||||
|
||||
ForceCacheUpdate();
|
||||
|
||||
m_iMessageSequenceNumber = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1223,11 +1220,16 @@ int CMainDocument::WorkAbort(std::string& strProjectURL, std::string& strName) {
|
|||
int CMainDocument::CachedMessageUpdate() {
|
||||
int retval;
|
||||
static bool in_this_func = false;
|
||||
static bool was_connected = false;
|
||||
|
||||
if (in_this_func) return 0;
|
||||
in_this_func = true;
|
||||
|
||||
if (IsConnected()) {
|
||||
if (! was_connected) {
|
||||
ResetMessageState();
|
||||
was_connected = true;
|
||||
}
|
||||
retval = rpc.get_messages(m_iMessageSequenceNumber, messages);
|
||||
if (retval) {
|
||||
wxLogTrace(wxT("Function Status"), wxT("CMainDocument::CachedMessageUpdate - Get Messages Failed '%d'"), retval);
|
||||
|
@ -1238,6 +1240,8 @@ int CMainDocument::CachedMessageUpdate() {
|
|||
int last_ind = messages.messages.size()-1;
|
||||
m_iMessageSequenceNumber = messages.messages[last_ind]->seqno;
|
||||
}
|
||||
} else {
|
||||
was_connected = false;
|
||||
}
|
||||
done:
|
||||
in_this_func = false;
|
||||
|
|
|
@ -223,6 +223,9 @@ wxInt32 CViewMessages::GetDocCount() {
|
|||
|
||||
|
||||
void CViewMessages::OnListRender (wxTimerEvent& event) {
|
||||
bool isConnected;
|
||||
static bool was_connected = false;
|
||||
|
||||
if (!m_bProcessingListRenderEvent) {
|
||||
m_bProcessingListRenderEvent = true;
|
||||
|
||||
|
@ -232,6 +235,22 @@ void CViewMessages::OnListRender (wxTimerEvent& event) {
|
|||
if (0 >= iDocCount) {
|
||||
m_pListPane->DeleteAllItems();
|
||||
} else {
|
||||
// If connection status changed, adjust color of messages display
|
||||
isConnected = wxGetApp().GetDocument()->IsConnected();
|
||||
if (was_connected != isConnected) {
|
||||
was_connected = isConnected;
|
||||
if (isConnected) {
|
||||
m_pMessageInfoAttr->SetTextColour(*wxBLACK);
|
||||
m_pMessageErrorAttr->SetTextColour(*wxRED);
|
||||
} else {
|
||||
wxColourDatabase colorBase;
|
||||
m_pMessageInfoAttr->SetTextColour(wxColour(128, 128, 128));
|
||||
m_pMessageErrorAttr->SetTextColour(wxColour(255, 128, 128));
|
||||
}
|
||||
// Force an update
|
||||
m_pListPane->SetItemCount(iDocCount);
|
||||
}
|
||||
|
||||
if (m_iPreviousDocCount != iDocCount)
|
||||
m_pListPane->SetItemCount(iDocCount);
|
||||
}
|
||||
|
@ -280,6 +299,7 @@ wxListItemAttr* CViewMessages::OnListGetItemAttr(long item) const {
|
|||
pAttribute = m_pMessageErrorAttr;
|
||||
break;
|
||||
default:
|
||||
pAttribute = m_pMessageInfoAttr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ bool CPanelMessages::Create()
|
|||
m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130);
|
||||
m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378);
|
||||
|
||||
m_pMessageInfoAttr = new wxListItemAttr(*wxBLACK, *wxWHITE, wxNullFont);
|
||||
m_pMessageInfoAttr = new wxListItemAttr(*wxBLACK, *wxWHITE, wxNullFont);
|
||||
m_pMessageErrorAttr = new wxListItemAttr(*wxRED, *wxWHITE, wxNullFont);
|
||||
|
||||
m_pRefreshMessagesTimer = new wxTimer(this, ID_REFRESHMESSAGESTIMER);
|
||||
|
@ -344,6 +344,9 @@ void CPanelMessages::OnEraseBackground(wxEraseEvent& event){
|
|||
*/
|
||||
|
||||
void CPanelMessages::OnRefresh(wxTimerEvent& event) {
|
||||
bool isConnected;
|
||||
static bool was_connected = false;
|
||||
|
||||
if (!m_bProcessingRefreshEvent) {
|
||||
m_bProcessingRefreshEvent = true;
|
||||
|
||||
|
@ -353,6 +356,22 @@ void CPanelMessages::OnRefresh(wxTimerEvent& event) {
|
|||
if (0 >= iDocCount) {
|
||||
m_pList->DeleteAllItems();
|
||||
} else {
|
||||
// If connection status changed, adjust color of messages display
|
||||
isConnected = wxGetApp().GetDocument()->IsConnected();
|
||||
if (was_connected != isConnected) {
|
||||
was_connected = isConnected;
|
||||
if (isConnected) {
|
||||
m_pMessageInfoAttr->SetTextColour(*wxBLACK);
|
||||
m_pMessageErrorAttr->SetTextColour(*wxRED);
|
||||
} else {
|
||||
wxColourDatabase colorBase;
|
||||
m_pMessageInfoAttr->SetTextColour(wxColour(128, 128, 128));
|
||||
m_pMessageErrorAttr->SetTextColour(wxColour(255, 128, 128));
|
||||
}
|
||||
// Force an update
|
||||
m_pList->SetItemCount(iDocCount);
|
||||
}
|
||||
|
||||
if (m_iPreviousDocCount != iDocCount)
|
||||
m_pList->SetItemCount(iDocCount);
|
||||
}
|
||||
|
@ -574,6 +593,7 @@ wxListItemAttr* CPanelMessages::OnListGetItemAttr(long item) const {
|
|||
pAttribute = m_pMessageErrorAttr;
|
||||
break;
|
||||
default:
|
||||
pAttribute = m_pMessageInfoAttr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue