From 62722370a855cec0f093a5a9c6e612db030fd3c7 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 7 Apr 2008 09:31:15 +0000 Subject: [PATCH] GUI: Disable Show Graphics button if any selected task is suspended for any reason svn path=/trunk/boinc/; revision=15024 --- checkin_notes | 5 +++++ clientgui/ViewWork.cpp | 10 ++++++++++ clientgui/ViewWorkGrid.cpp | 13 +++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index dc67b6ddc1..3f97d0a8aa 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3126,8 +3126,13 @@ David April 5 2008 procinfo_unix.C Charlie April 7 2008 + GUI: Disable Show Graphics button if any selected task is suspended for + any reason. Mac: Fix new backtrace code for x86_64 Client and project applications. + clientgui/ + ViewWork.cpp + ViewWorkGrid.cpp lib/ mac/ mac_backtrace.C diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index 6eebefd8a2..1474b55e77 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -481,6 +481,7 @@ void CViewWork::UpdateSelection() { CTaskItemGroup* pGroup = NULL; RESULT* result = NULL; PROJECT* project = NULL; + CC_STATUS status; CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(NULL != pDoc); @@ -518,6 +519,15 @@ void CViewWork::UpdateSelection() { m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_GRAPHICS]); } + pDoc->GetCoreClientStatus(status); + if (status.task_suspend_reason & ~(SUSPEND_REASON_CPU_USAGE_LIMIT)) { + m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_GRAPHICS]); + } + + if (result->suspended_via_gui || result->project_suspended_via_gui) { + m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_GRAPHICS]); + } + if ( result->active_task_state != PROCESS_ABORT_PENDING && result->active_task_state != PROCESS_ABORTED && diff --git a/clientgui/ViewWorkGrid.cpp b/clientgui/ViewWorkGrid.cpp index a4fa74f605..7934c68aa7 100644 --- a/clientgui/ViewWorkGrid.cpp +++ b/clientgui/ViewWorkGrid.cpp @@ -407,6 +407,7 @@ void CViewWorkGrid::UpdateSelection() { CTaskItemGroup* pGroup = NULL; RESULT* result = NULL; PROJECT* project = NULL; + CC_STATUS status; CMainDocument* pDoc = wxGetApp().GetDocument(); int i, n; bool wasSuspended=false, all_same_project=false; @@ -426,10 +427,14 @@ void CViewWorkGrid::UpdateSelection() { if (n > 0) { m_pTaskPane->EnableTaskGroupTasks(pGroup); + pDoc->GetCoreClientStatus(status); + if (status.task_suspend_reason & ~(SUSPEND_REASON_CPU_USAGE_LIMIT)) { + m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_GRAPHICS]); + } } else { m_pTaskPane->DisableTaskGroupTasks(pGroup); } - + for(i=0; iGetCellValue(arrSelRows[i],COLUMN_NAME).Trim(false); wxString projectURL = m_pGridPane->GetCellValue(arrSelRows[i],COLUMN_HIDDEN_URL).Trim(false); @@ -464,7 +469,11 @@ void CViewWorkGrid::UpdateSelection() { ) { m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_GRAPHICS]); } - + + if (result->suspended_via_gui || result->project_suspended_via_gui) { + m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_GRAPHICS]); + } + // Disable Abort button if any selected task already aborted if ( result->active_task_state == PROCESS_ABORT_PENDING ||