MGR: Fix bug which can cause Manager to quit when started in Simple View

This commit is contained in:
Charlie Fenton 2012-10-18 03:13:22 -07:00 committed by Oliver Bock
parent e54b0ae02e
commit d6accd5437
2 changed files with 16 additions and 0 deletions

View File

@ -6247,3 +6247,9 @@ David 17 Oct 2012
html/inc/ html/inc/
forum.inc forum.inc
Charlie 18 Oct 2012
- MGR: Fix bug which can cause Manager to quit when started in Simple View.
clientgui/
sg_TaskPanel.cpp

View File

@ -936,10 +936,17 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
CMainDocument* pDoc = wxGetApp().GetDocument(); CMainDocument* pDoc = wxGetApp().GetDocument();
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
static bool bAlreadyRunning = false;
wxASSERT(pDoc); wxASSERT(pDoc);
wxASSERT(pSkinSimple); wxASSERT(pSkinSimple);
wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple));
if (bAlreadyRunning) {
return;
}
bAlreadyRunning = true;
count = m_TaskSelectionCtrl->GetCount(); count = m_TaskSelectionCtrl->GetCount();
// Mark all inactive (this lets us loop only once) // Mark all inactive (this lets us loop only once)
for (i=0; i<count; ++i) { for (i=0; i<count; ++i) {
@ -1108,6 +1115,9 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
if (needRefresh) { if (needRefresh) {
m_TaskSelectionCtrl->Refresh(); m_TaskSelectionCtrl->Refresh();
} }
bAlreadyRunning = false;
wxLogTrace(wxT("Function Start/End"), wxT("CSimpleTaskPanel::UpdateTaskSelectionList - Function End")); wxLogTrace(wxT("Function Start/End"), wxT("CSimpleTaskPanel::UpdateTaskSelectionList - Function End"));
} }