diff --git a/clientgui/sg_TaskPanel.cpp b/clientgui/sg_TaskPanel.cpp index 563a247b3f..c4c7e2a555 100644 --- a/clientgui/sg_TaskPanel.cpp +++ b/clientgui/sg_TaskPanel.cpp @@ -212,6 +212,7 @@ CSlideShowPanel::CSlideShowPanel( wxWindow* parent ) : m_SlideBitmap = wxNullBitmap; m_bCurrentSlideIsDefault = false; m_bGotAllProjectsList = false; + m_bHasBeenDrawn = false; #ifdef __WXMAC__ // Tell accessibility aids to ignore this panel (but not its contents) @@ -235,11 +236,36 @@ void CSlideShowPanel::OnSlideShowTimer(wxTimerEvent& WXUNUSED(event)) { AdvanceSlideShow(true, false); } +void CSlideShowPanel::SetDescriptionText(void) { + unsigned int i; + wxString s, ss; + + TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData(); + if (selData == NULL) return; + for (i=0; iurl.c_str(), selData->project_url)) { + s = wxString(m_AllProjectsList.projects[i]->home.c_str(), wxConvUTF8); + ss = wxGetTranslation(s); + ss.Append("\n\n"); + s = wxString(m_AllProjectsList.projects[i]->specific_area.c_str(), wxConvUTF8); + ss += wxGetTranslation(s); + ss.Append("\n\n"); + s = wxString(m_AllProjectsList.projects[i]->description.c_str(), wxConvUTF8); + ss += wxGetTranslation(s); + m_description->SetValue(ss); + + m_description->Show(true); + Enable( true ); + m_description->Enable(); + this->Layout(); + break; + } + } +} + void CSlideShowPanel::AdvanceSlideShow(bool changeSlide, bool reload) { double xRatio, yRatio, ratio; - unsigned int i; - wxString s, ss; TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData(); if (selData == NULL) return; @@ -274,25 +300,8 @@ numSlides = 0; m_bGotAllProjectsList = true; } - for (i=0; iurl.c_str(), selData->project_url)) { - s = wxString(m_AllProjectsList.projects[i]->home.c_str(), wxConvUTF8); - ss = wxGetTranslation(s); - ss.Append("\n\n"); - s = wxString(m_AllProjectsList.projects[i]->specific_area.c_str(), wxConvUTF8); - ss += wxGetTranslation(s); - ss.Append("\n\n"); - s = wxString(m_AllProjectsList.projects[i]->description.c_str(), wxConvUTF8); - ss += wxGetTranslation(s); - m_description->SetValue(ss); + SetDescriptionText(); - m_description->Show(true); - Enable( true ); - m_description->Enable(); - this->Layout(); - break; - } - } return; #else // HIDEDEFAULTSLIDE SetBackgroundColour(*wxBLACK); @@ -405,6 +414,11 @@ numSlides = 0; ); } } + + if (!m_bHasBeenDrawn) { + m_bHasBeenDrawn = true; + SetDescriptionText(); + } } diff --git a/clientgui/sg_TaskPanel.h b/clientgui/sg_TaskPanel.h index e9a590ab94..aa8f1ca3fc 100644 --- a/clientgui/sg_TaskPanel.h +++ b/clientgui/sg_TaskPanel.h @@ -80,6 +80,7 @@ class CSlideShowPanel : public wxPanel ~CSlideShowPanel(); void OnSlideShowTimer(wxTimerEvent& WXUNUSED(event)); + void SetDescriptionText(void); void AdvanceSlideShow(bool changeSlide, bool reload); void OnPaint(wxPaintEvent& WXUNUSED(event)); void OnEraseBackground(wxEraseEvent& event); @@ -90,6 +91,7 @@ class CSlideShowPanel : public wxPanel wxBitmap m_SlideBitmap; bool m_bCurrentSlideIsDefault; bool m_bGotAllProjectsList; + bool m_bHasBeenDrawn; ALL_PROJECTS_LIST m_AllProjectsList; };