MGR: Always sort after a row is added or deleted.

svn path=/trunk/boinc/; revision=16352
This commit is contained in:
Charlie Fenton 2008-10-29 10:24:45 +00:00
parent 384ebd262f
commit b4d0ec65ea
3 changed files with 9 additions and 4 deletions

View File

@ -8815,10 +8815,11 @@ David 28 Oct 2008
Charlie 29 Oct 2008 Charlie 29 Oct 2008
- MGR: Fix bug introduced yesterday. - MGR: Fix bug introduced yesterday.
- MGR: Always sort after a row is added or deleted.
- Mac: Add new files rr_sim.cpp,.h to XCode project. - Mac: Add new files rr_sim.cpp,.h to XCode project.
clientgui/ clientgui/
BOINCBaseView.cpp BOINCBaseView.cpp,.h
mac_build/ mac_build/
boinc.xcodeproj/ boinc.xcodeproj/
project.pbxproj project.pbxproj

View File

@ -47,6 +47,7 @@ CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook) :
m_bForceUpdateSelection = true; m_bForceUpdateSelection = true;
m_bIgnoreUIEvents = false; m_bIgnoreUIEvents = false;
m_bNeedSort = false;
// //
// Setup View // Setup View
@ -275,6 +276,7 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) {
} }
wxASSERT(GetDocCount() == GetCacheCount()); wxASSERT(GetDocCount() == GetCacheCount());
m_pListPane->SetItemCount(iDocCount); m_pListPane->SetItemCount(iDocCount);
m_bNeedSort = true;
} else { } else {
for (iIndex = 0; iIndex < (iCacheCount - iDocCount); iIndex++) { for (iIndex = 0; iIndex < (iCacheCount - iDocCount); iIndex++) {
iReturnValue = RemoveCacheElement(); iReturnValue = RemoveCacheElement();
@ -283,6 +285,7 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) {
wxASSERT(GetDocCount() == GetCacheCount()); wxASSERT(GetDocCount() == GetCacheCount());
m_pListPane->SetItemCount(iDocCount); m_pListPane->SetItemCount(iDocCount);
m_pListPane->RefreshItems(0, iDocCount - 1); m_pListPane->RefreshItems(0, iDocCount - 1);
m_bNeedSort = true;
} }
} }
} }
@ -457,7 +460,6 @@ int CBOINCBaseView::SynchronizeCache() {
int iColumnIndex = 0; int iColumnIndex = 0;
int iColumnTotal = 0; int iColumnTotal = 0;
bool bNeedRefreshData = false; bool bNeedRefreshData = false;
bool bNeedSort = false;
iRowTotal = GetDocCount(); iRowTotal = GetDocCount();
iColumnTotal = m_pListPane->GetColumnCount(); iColumnTotal = m_pListPane->GetColumnCount();
@ -474,7 +476,7 @@ int CBOINCBaseView::SynchronizeCache() {
m_pListPane->RefreshCell(iRowIndex, iColumnIndex); m_pListPane->RefreshCell(iRowIndex, iColumnIndex);
#endif #endif
if (iColumnIndex == m_iSortColumn) { if (iColumnIndex == m_iSortColumn) {
bNeedSort = true; m_bNeedSort = true;
} }
} }
} }
@ -485,8 +487,9 @@ int CBOINCBaseView::SynchronizeCache() {
} }
} }
if (bNeedSort) { if (m_bNeedSort) {
sortData(); // Will mark moved items as needing refresh sortData(); // Will mark moved items as needing refresh
m_bNeedSort = false;
} }
return 0; return 0;

View File

@ -177,6 +177,7 @@ protected:
bool m_bForceUpdateSelection; bool m_bForceUpdateSelection;
bool m_bIgnoreUIEvents; bool m_bIgnoreUIEvents;
bool m_bNeedSort;
int m_iProgressColumn; int m_iProgressColumn;