mirror of https://github.com/BOINC/boinc.git
MGR: Bug fix: if currently selected task in Simple View deleted, change selection
svn path=/trunk/boinc/; revision=24463
This commit is contained in:
parent
e5153566d4
commit
3373bc801a
|
@ -7672,3 +7672,10 @@ Charlie 21 Oct 2011
|
|||
|
||||
clientgui/
|
||||
sg_TaskPanel.cpp
|
||||
|
||||
Charlie 21 Oct 2011
|
||||
- MGR: Bug fix: when the task currently selected in Simple View
|
||||
is deleted, change selection to a different task.
|
||||
|
||||
clientgui/
|
||||
sg_TaskPanel.cpp
|
||||
|
|
|
@ -82,7 +82,7 @@ void CSlideShowPanel::AdvanceSlideShow(bool changeSlide) {
|
|||
TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData();
|
||||
if (selData == NULL) return;
|
||||
|
||||
int numSlides = selData->slideShowFileNames.size();
|
||||
int numSlides = (int)selData->slideShowFileNames.size();
|
||||
|
||||
if (numSlides <= 0) {
|
||||
if (m_bCurrentSlideIsDefault) return;
|
||||
|
@ -691,6 +691,7 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
|
|||
RESULT* ctrlResult;
|
||||
PROJECT* project;
|
||||
std::vector<bool>is_alive;
|
||||
bool needRefresh = false;
|
||||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
|
||||
|
||||
|
@ -729,7 +730,7 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
|
|||
}
|
||||
}
|
||||
|
||||
// if it isn't currently one of the tabs then we have a new one! lets add it
|
||||
// if it isn't currently in the list then we have a new one! lets add it
|
||||
if (!found) {
|
||||
#if SELECTBYRESULTNAME
|
||||
wxString resname(result->name, wxConvUTF8);
|
||||
|
@ -761,7 +762,18 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
|
|||
delete selData;
|
||||
m_TaskSelectionCtrl->Delete(j);
|
||||
if (j == m_CurrentTaskSelection) {
|
||||
int newCount = m_TaskSelectionCtrl->GetCount();
|
||||
if (m_CurrentTaskSelection < newCount) {
|
||||
// Select the next item if one exists
|
||||
m_TaskSelectionCtrl->SetSelection(m_CurrentTaskSelection);
|
||||
} else if (newCount > 0) {
|
||||
// Select the previous item if one exists
|
||||
m_TaskSelectionCtrl->SetSelection(newCount-1);
|
||||
} else {
|
||||
m_TaskSelectionCtrl->SetSelection(wxNOT_FOUND);
|
||||
}
|
||||
m_bStableTaskInfoChanged = true;
|
||||
needRefresh = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -802,9 +814,12 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
|
|||
break;
|
||||
}
|
||||
selData->dotColor = newColor;
|
||||
m_TaskSelectionCtrl->Refresh();
|
||||
needRefresh = true;
|
||||
}
|
||||
}
|
||||
if (needRefresh) {
|
||||
m_TaskSelectionCtrl->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue