From 0e401b7f8dbf0bce45a74ffb9d879734c110dda9 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 1 Dec 2008 09:44:01 +0000 Subject: [PATCH] MGR: Update Tasks panel only when necessary, trying again to fix redraw glitch on Windows; fix Mac Messages tab not getting deselection events due to wxWidgets bug. svn path=/trunk/boinc/; revision=16587 --- checkin_notes | 13 +++++++++++++ clientgui/ViewMessages.cpp | 1 + clientgui/ViewProjects.cpp | 8 +++++++- clientgui/ViewTransfers.cpp | 4 ++++ clientgui/ViewWork.cpp | 8 +++++++- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index a2482a7433..aa46bf9657 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9714,3 +9714,16 @@ David 28 Nov 2008 update_translations.php user/ get_project_config.php + +Charlie 1 Dec 2008 + - MGR: In Messages tab, work around Mac wxWidgets bug: virtual list control + does not post deselection events; I had previously done this for the + Projects, Tasks and Transfers tabs. + - MGR: Update Tasks panel only when necessary to try again to fix latest + instance of cosmetic bug reported by David on Windows. + + clientgui/ + ViewMessages.cpp + ViewProjects.cpp + ViewTransfers.cpp + ViewWork.cpp diff --git a/clientgui/ViewMessages.cpp b/clientgui/ViewMessages.cpp index 8fad4982ae..023db1540c 100644 --- a/clientgui/ViewMessages.cpp +++ b/clientgui/ViewMessages.cpp @@ -51,6 +51,7 @@ BEGIN_EVENT_TABLE (CViewMessages, CBOINCBaseView) EVT_BUTTON(ID_TASK_MESSAGES_FILTERBYPROJECT, CViewMessages::OnMessagesFilter) EVT_LIST_ITEM_SELECTED(ID_LIST_MESSAGESVIEW, CViewMessages::OnListSelected) EVT_LIST_ITEM_DESELECTED(ID_LIST_MESSAGESVIEW, CViewMessages::OnListDeselected) + EVT_LIST_CACHE_HINT(ID_LIST_MESSAGESVIEW, CViewMessages::OnCacheHint) END_EVENT_TABLE () diff --git a/clientgui/ViewProjects.cpp b/clientgui/ViewProjects.cpp index 2c19f96e48..cde781da7f 100644 --- a/clientgui/ViewProjects.cpp +++ b/clientgui/ViewProjects.cpp @@ -650,7 +650,7 @@ bool CViewProjects::IsSelectionManagementNeeded() { void CViewProjects::UpdateSelection() { CTaskItemGroup* pGroup = NULL; PROJECT* project = NULL; - CMainDocument* pDoc = wxGetApp().GetDocument(); + CMainDocument* pDoc = NULL; int i, n, row; bool wasSuspended=false, wasNoNewWork=false; bool enableUpdate = false; @@ -660,6 +660,12 @@ void CViewProjects::UpdateSelection() { bool enableDetach = false; bool enableProperties = false; + if(!m_bForceUpdateSelection) { + return; + } + + pDoc = wxGetApp().GetDocument(); + wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(m_pTaskPane); diff --git a/clientgui/ViewTransfers.cpp b/clientgui/ViewTransfers.cpp index 5d5aa0f922..1b2c104514 100644 --- a/clientgui/ViewTransfers.cpp +++ b/clientgui/ViewTransfers.cpp @@ -441,6 +441,10 @@ bool CViewTransfers::IsSelectionManagementNeeded() { void CViewTransfers::UpdateSelection() { CTaskItemGroup* pGroup = m_TaskGroups[0]; + if(!m_bForceUpdateSelection) { + return; + } + CBOINCBaseView::PreUpdateSelection(); if (m_pListPane->GetSelectedItemCount()) { diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index 6e6b3a42ec..999dd48b10 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -590,7 +590,7 @@ void CViewWork::UpdateSelection() { RESULT* result = NULL; PROJECT* project = NULL; CC_STATUS status; - CMainDocument* pDoc = wxGetApp().GetDocument(); + CMainDocument* pDoc = NULL; int i, n, row; bool wasSuspended=false, all_same_project=false; std::string first_project_url; @@ -599,6 +599,12 @@ void CViewWork::UpdateSelection() { bool enableAbort = false; bool enableProperties = false; + if(!m_bForceUpdateSelection) { + return; + } + + pDoc = wxGetApp().GetDocument(); + wxASSERT(NULL != pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(NULL != m_pTaskPane);