From 1001dd39143e735af00988cb150a15d65f4791b6 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 8 Dec 2015 03:54:56 -0800 Subject: [PATCH] MGR: Fix 2 more cases which incorrectly showed suspended tasks as waiting to run in Simple View: insufficient disk space and when only GPU apps are suspended. --- clientgui/sg_TaskPanel.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/clientgui/sg_TaskPanel.cpp b/clientgui/sg_TaskPanel.cpp index 55a9112b82..3ac2016857 100644 --- a/clientgui/sg_TaskPanel.cpp +++ b/clientgui/sg_TaskPanel.cpp @@ -939,9 +939,11 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) { std::vectoris_alive; bool needRefresh = false; wxString resname; + CC_STATUS status; CMainDocument* pDoc = wxGetApp().GetDocument(); CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); - + wxASSERT(pDoc); + static bool bAlreadyRunning = false; wxASSERT(pDoc); @@ -1088,13 +1090,20 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) { } } + pDoc->GetCoreClientStatus(status); + count = m_TaskSelectionCtrl->GetCount(); for(j = 0; j < count; ++j) { selData = (TaskSelectionData*)m_TaskSelectionCtrl->GetClientData(j); ctrlResult = selData->result; if (isRunning(ctrlResult)) { newIcon = runningIcon; - } else if (Suspended() || ctrlResult->suspended_via_gui || ctrlResult->project_suspended_via_gui) { + } else if (Suspended() || + ctrlResult->suspended_via_gui || + ctrlResult->project_suspended_via_gui || + // kludge. But ctrlResult->avp isn't populated. + (status.gpu_suspend_reason && (strstr(ctrlResult->resources, "GPU") != NULL))) + { newIcon = suspendedIcon; } else { newIcon = waitingIcon; @@ -1176,7 +1185,7 @@ bool CSimpleTaskPanel::Suspended() { bool result = false; pDoc->GetCoreClientStatus(status); - if ( pDoc->IsConnected() && status.task_suspend_reason > 0 && status.task_suspend_reason != SUSPEND_REASON_DISK_SIZE && status.task_suspend_reason != SUSPEND_REASON_CPU_THROTTLE ) { + if ( pDoc->IsConnected() && status.task_suspend_reason > 0 && status.task_suspend_reason != SUSPEND_REASON_CPU_THROTTLE ) { result = true; } return result; @@ -1224,6 +1233,8 @@ void CSimpleTaskPanel::DisplayIdleState() { UpdateStaticText(&m_StatusValueText, _("Processing Suspended: Time of Day.")); } else if ( status.task_suspend_reason & SUSPEND_REASON_BENCHMARKS ) { UpdateStaticText(&m_StatusValueText, _("Processing Suspended: Benchmarks Running.")); + } else if ( status.task_suspend_reason & SUSPEND_REASON_DISK_SIZE ) { + UpdateStaticText(&m_StatusValueText, _("Processing Suspended: need disk space.")); } else { UpdateStaticText(&m_StatusValueText, _("Processing Suspended.")); }