diff --git a/checkin_notes b/checkin_notes index bcf69cd8e4..2af74e1712 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11896,4 +11896,10 @@ Kevin 31 Oct 2006 clientgui/ sg_ViewTabPage.cpp +Kevin 31 Oct 2006 + - MGR: Fixed bug that prevented recently downloaded stat icons from being displayed + + clientgui/ + sg_StatImageLoader.cpp/h + \ No newline at end of file diff --git a/clientgui/sg_StatImageLoader.cpp b/clientgui/sg_StatImageLoader.cpp index 7dc9736898..49db19a9bb 100644 --- a/clientgui/sg_StatImageLoader.cpp +++ b/clientgui/sg_StatImageLoader.cpp @@ -222,19 +222,22 @@ void StatImageLoader::LoadStatIcon(wxBitmap& image) { SetSize(width, height); } - -void StatImageLoader::LoadImage() { +std::string StatImageLoader::GetProjectIconLoc() { char urlDirectory[256]; - std::string dirProjectGraphic; - - CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); CMainDocument* pDoc = wxGetApp().GetDocument(); PROJECT* project = pDoc->state.lookup_project(m_prjUrl); url_to_project_dir((char*)project->master_url.c_str() ,urlDirectory); - dirProjectGraphic = (std::string)urlDirectory + "/" + wxT("stat_icon"); + return (std::string)urlDirectory + "/" + wxT("stat_icon"); +} + + +void StatImageLoader::LoadImage() { + std::string dirProjectGraphic; + + CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); char defaultIcnPath[256]; - if(boinc_resolve_filename(dirProjectGraphic.c_str(), defaultIcnPath, sizeof(defaultIcnPath)) == 0){ + if(boinc_resolve_filename(GetProjectIconLoc().c_str(), defaultIcnPath, sizeof(defaultIcnPath)) == 0){ wxBitmap* btmpStatIcn = new wxBitmap(); if ( btmpStatIcn->LoadFile(defaultIcnPath, wxBITMAP_TYPE_ANY) ) { LoadStatIcon(*btmpStatIcn); @@ -251,7 +254,7 @@ void StatImageLoader::LoadImage() { void StatImageLoader::ReloadProjectSpecificIcon() { char defaultIcnPath[256]; // Only update if it is project specific is found - if(boinc_resolve_filename(projectIcon.c_str(), defaultIcnPath, sizeof(defaultIcnPath)) == 0){ + if(boinc_resolve_filename(GetProjectIconLoc().c_str(), defaultIcnPath, sizeof(defaultIcnPath)) == 0){ wxBitmap* btmpStatIcn = new wxBitmap(); if ( btmpStatIcn->LoadFile(defaultIcnPath, wxBITMAP_TYPE_ANY) ) { LoadStatIcon(*btmpStatIcn); diff --git a/clientgui/sg_StatImageLoader.h b/clientgui/sg_StatImageLoader.h index 31fc593eed..ac4e5cc6bc 100644 --- a/clientgui/sg_StatImageLoader.h +++ b/clientgui/sg_StatImageLoader.h @@ -56,6 +56,7 @@ private: void ReloadProjectSpecificIcon(); void BuildUserStatToolTip(); void AddMenuItems(); + std::string GetProjectIconLoc(); DECLARE_EVENT_TABLE() };