MGR: Restore m_bForceUpdateSelection logic because it is needed to prevent flicker.

svn path=/trunk/boinc/; revision=16618
This commit is contained in:
Charlie Fenton 2008-12-04 11:39:51 +00:00
parent 64f863e894
commit ba1efc6014
4 changed files with 57 additions and 40 deletions

View File

@ -9845,11 +9845,12 @@ David 3 Dec 2008
cpu_sched.cpp
Charlie 4 Dec 2008
- MGR: Restore UpdateSelection() call in CBOINCBaseView::OnListRender()
because it is needed to set texct in Suspend/Resume button.
- MGR: Restore m_bForceUpdateSelection logic because it is needed to
set text in Suspend/Resume button and prevent flicker.
- MGR: Set wxWidgets option "msw.staticbox.optimized-paint" in another
attempt at fixing Task Pane background erase glitch.
attempt at fixing Task Pane background erase glitch on Windows.
clientgui/
BOINCBaseView.cpp
BOINCBaseView.cpp,.h
BOINCGUIApp.cpp
ViewProjects.cpp

View File

@ -45,6 +45,7 @@ CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook) :
m_bProcessingTaskRenderEvent = false;
m_bProcessingListRenderEvent = false;
m_bForceUpdateSelection = true;
m_bIgnoreUIEvents = false;
m_bNeedSort = false;
@ -75,6 +76,7 @@ CBOINCBaseView::CBOINCBaseView(
m_bProcessingTaskRenderEvent = false;
m_bProcessingListRenderEvent = false;
m_bForceUpdateSelection = true;
m_bIgnoreUIEvents = false;
//
@ -364,6 +366,7 @@ void CBOINCBaseView::OnListSelected(wxListEvent& event) {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListSelected - Function Begin"));
if (!m_bIgnoreUIEvents) {
m_bForceUpdateSelection = true;
UpdateSelection();
event.Skip();
}
@ -376,6 +379,7 @@ void CBOINCBaseView::OnListDeselected(wxListEvent& event) {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function Begin"));
if (!m_bIgnoreUIEvents) {
m_bForceUpdateSelection = true;
UpdateSelection();
event.Skip();
}
@ -672,6 +676,7 @@ void CBOINCBaseView::RestoreSelections() {
m_bIgnoreUIEvents = false;
if (oldCount != newCount) {
m_bForceUpdateSelection = true;
UpdateSelection();
}
}
@ -716,51 +721,56 @@ void CBOINCBaseView::UpdateWebsiteSelection(long lControlGroup, PROJECT* project
// Update the websites list
//
if (m_TaskGroups.size() > 1) {
if (m_bForceUpdateSelection) {
if (m_TaskGroups.size() > 1) {
// Delete task group, objects, and controls.
pGroup = m_TaskGroups[lControlGroup];
// Delete task group, objects, and controls.
pGroup = m_TaskGroups[lControlGroup];
m_pTaskPane->DeleteTaskGroupAndTasks(pGroup);
for (i=0; i<pGroup->m_Tasks.size(); i++) {
delete pGroup->m_Tasks[i];
m_pTaskPane->DeleteTaskGroupAndTasks(pGroup);
for (i=0; i<pGroup->m_Tasks.size(); i++) {
delete pGroup->m_Tasks[i];
}
pGroup->m_Tasks.clear();
delete pGroup;
pGroup = NULL;
m_TaskGroups.erase( m_TaskGroups.begin() + 1 );
}
pGroup->m_Tasks.clear();
delete pGroup;
pGroup = NULL;
// If something is selected create the tasks and controls
if (m_pListPane->GetSelectedItemCount()) {
if (project) {
// Create the web sites task group
pGroup = new CTaskItemGroup( _("Web sites") );
m_TaskGroups.push_back( pGroup );
m_TaskGroups.erase( m_TaskGroups.begin() + 1 );
}
// If something is selected create the tasks and controls
if (m_pListPane->GetSelectedItemCount()) {
if (project) {
// Create the web sites task group
pGroup = new CTaskItemGroup( _("Web sites") );
m_TaskGroups.push_back( pGroup );
// Default project url
pItem = new CTaskItem(
wxString(project->project_name.c_str(), wxConvUTF8),
wxT(""),
wxString(project->master_url.c_str(), wxConvUTF8),
ID_TASK_PROJECT_WEB_PROJDEF_MIN
);
pGroup->m_Tasks.push_back(pItem);
// Project defined urls
for (i=0;(i<project->gui_urls.size())&&(i<=ID_TASK_PROJECT_WEB_PROJDEF_MAX);i++) {
// Default project url
pItem = new CTaskItem(
wxGetTranslation(wxString(project->gui_urls[i].name.c_str(), wxConvUTF8)),
wxGetTranslation(wxString(project->gui_urls[i].description.c_str(), wxConvUTF8)),
wxString(project->gui_urls[i].url.c_str(), wxConvUTF8),
ID_TASK_PROJECT_WEB_PROJDEF_MIN + 1 + i
wxString(project->project_name.c_str(), wxConvUTF8),
wxT(""),
wxString(project->master_url.c_str(), wxConvUTF8),
ID_TASK_PROJECT_WEB_PROJDEF_MIN
);
pGroup->m_Tasks.push_back(pItem);
// Project defined urls
for (i=0;(i<project->gui_urls.size())&&(i<=ID_TASK_PROJECT_WEB_PROJDEF_MAX);i++) {
pItem = new CTaskItem(
wxGetTranslation(wxString(project->gui_urls[i].name.c_str(), wxConvUTF8)),
wxGetTranslation(wxString(project->gui_urls[i].description.c_str(), wxConvUTF8)),
wxString(project->gui_urls[i].url.c_str(), wxConvUTF8),
ID_TASK_PROJECT_WEB_PROJDEF_MIN + 1 + i
);
pGroup->m_Tasks.push_back(pItem);
}
}
m_bForceUpdateSelection = false;
}
}
}

View File

@ -179,6 +179,7 @@ protected:
bool m_bProcessingTaskRenderEvent;
bool m_bProcessingListRenderEvent;
bool m_bForceUpdateSelection;
bool m_bIgnoreUIEvents;
bool m_bNeedSort;

View File

@ -304,6 +304,7 @@ void CViewProjects::OnProjectUpdate( wxCommandEvent& WXUNUSED(event) ) {
}
pFrame->UpdateStatusText(wxT(""));
m_bForceUpdateSelection = true;
UpdateSelection();
pFrame->ResetReminderTimers();
pFrame->FireRefreshView();
@ -345,6 +346,7 @@ void CViewProjects::OnProjectSuspend( wxCommandEvent& WXUNUSED(event) ) {
}
}
m_bForceUpdateSelection = true;
UpdateSelection();
pFrame->FireRefreshView();
@ -385,6 +387,7 @@ void CViewProjects::OnProjectNoNewWork( wxCommandEvent& WXUNUSED(event) ) {
}
}
m_bForceUpdateSelection = true;
UpdateSelection();
pFrame->FireRefreshView();
@ -444,6 +447,7 @@ void CViewProjects::OnProjectReset( wxCommandEvent& WXUNUSED(event) ) {
pFrame->UpdateStatusText(wxT(""));
m_bForceUpdateSelection = true;
UpdateSelection();
pFrame->FireRefreshView();
@ -501,6 +505,7 @@ void CViewProjects::OnProjectDetach( wxCommandEvent& WXUNUSED(event) ) {
pFrame->UpdateStatusText(wxT(""));
m_bForceUpdateSelection = true;
UpdateSelection();
pFrame->FireRefreshView();
@ -645,7 +650,7 @@ bool CViewProjects::IsSelectionManagementNeeded() {
void CViewProjects::UpdateSelection() {
CTaskItemGroup* pGroup = NULL;
PROJECT* project = NULL;
CMainDocument* pDoc = wxGetApp().GetDocument();
CMainDocument* pDoc = wxGetApp().GetDocument();
int i, n, row;
bool wasSuspended=false, wasNoNewWork=false;
bool enableUpdate = false;