void CViewWork::GetDocApplicationName(wxInt32 item, wxString& strBuffer) const { CMainDocument* pDoc = wxGetApp().GetDocument(); RESULT* result = wxGetApp().GetDocument()->result(item); RESULT* state_result = NULL; wxString strAppBuffer = wxEmptyString; wxString strClassBuffer = wxEmptyString; wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); if (result) { state_result = pDoc->state.lookup_result(result->project_url, result->name); if (!state_result) { pDoc->ForceCacheUpdate(); state_result = pDoc->state.lookup_result(result->project_url, result->name); } if (!state_result) return; WORKUNIT* wup = state_result->wup; if (!wup) return; APP* app = wup->app; if (!app) return; APP_VERSION* avp = state_result->avp; if (!avp) return; if (strlen(app->user_friendly_name)) { strAppBuffer = HtmlEntityDecode(wxString(state_result->app->user_friendly_name, wxConvUTF8)); } else { strAppBuffer = HtmlEntityDecode(wxString(state_result->avp->app_name, wxConvUTF8)); } if (strlen(avp->plan_class)) { strClassBuffer.Printf( wxT(" (%s)"), wxString(avp->plan_class, wxConvUTF8).c_str() ); } strBuffer.Printf( wxT(" %s%s %d.%02d %s"), state_result->project->anonymous_platform?_("Local: "):wxT(""), strAppBuffer.c_str(), state_result->avp->version_num / 100, state_result->avp->version_num % 100, strClassBuffer.c_str() ); } }
wxInt32 CViewTransfersGrid::FormatProjectName(wxInt32 item, wxString& strBuffer) const { FILE_TRANSFER* transfer = wxGetApp().GetDocument()->file_transfer(item); if (transfer) { strBuffer = wxT(" ") + HtmlEntityDecode(wxString(transfer->project_name.c_str(), wxConvUTF8)); } return 0; }
wxInt32 CViewMessages::FormatProjectName(wxInt32 item, wxString& strBuffer) const { MESSAGE* message = wxGetApp().GetDocument()->message(item); if (message) { strBuffer = HtmlEntityDecode(wxString(message->project.c_str(), wxConvUTF8)); } return 0; }
void CViewTransfers::GetDocProjectName(size_t item, wxString& strBuffer) const { CMainDocument* pDoc = wxGetApp().GetDocument(); FILE_TRANSFER* transfer = 0; if (pDoc) { transfer = pDoc->file_transfer(item); } if (transfer) { strBuffer = HtmlEntityDecode(wxString(transfer->project_name.c_str(), wxConvUTF8)); } else { strBuffer = wxEmptyString; } }
void CViewProjects::GetDocTeamName(wxInt32 item, wxString& strBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); if (pDoc) { project = pDoc->project(item); } if (project) { strBuffer = HtmlEntityDecode(wxString(project->team_name.c_str(), wxConvUTF8)); } else { strBuffer = wxEmptyString; } }
wxInt32 CViewMessagesGrid::FormatProjectName(wxInt32 item, wxString& strBuffer) const { MESSAGE* message = wxGetApp().GetDocument()->message(item); if (message) { wxString szProjectName = HtmlEntityDecode(wxString(message->project.c_str(), wxConvUTF8)); if(szProjectName == wxEmptyString) { strBuffer = wxT("BOINC core client"); } else { strBuffer = szProjectName; } } return 0; }
wxInt32 CViewResources::FormatProjectName(PROJECT* project, wxString& strBuffer) const { CMainDocument* doc = wxGetApp().GetDocument(); std::string project_name; wxASSERT(doc); wxASSERT(wxDynamicCast(doc, CMainDocument)); if (project) { PROJECT* state_project = doc->state.lookup_project(project->master_url); if (state_project) { state_project->get_name(project_name); strBuffer = HtmlEntityDecode(wxString(project_name.c_str(), wxConvUTF8)); } } return 0; }
void CViewWork::GetDocProjectName(wxInt32 item, wxString& strBuffer) const { CMainDocument* doc = wxGetApp().GetDocument(); RESULT* result = wxGetApp().GetDocument()->result(item); PROJECT* state_project = NULL; std::string project_name; wxASSERT(doc); wxASSERT(wxDynamicCast(doc, CMainDocument)); if (result) { // TODO: should we get the name directly with result->project->get_name(project_name) ? state_project = doc->state.lookup_project(result->project_url); if (state_project) { state_project->get_name(project_name); strBuffer = HtmlEntityDecode(wxString(project_name.c_str(), wxConvUTF8)); } else { doc->ForceCacheUpdate(); } } }