From 11f509e2bf912b012ba1371d0ad9172727f96434 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Wed, 30 May 2012 19:44:14 +0000 Subject: [PATCH] - MGR: Wait until there is valid data in the list box before processing the OnProjectSelected() event. clientgui/ ProjectInfoPage.cpp svn path=/trunk/boinc/; revision=25729 --- checkin_notes | 8 ++++ clientgui/ProjectInfoPage.cpp | 80 ++++++++++++++++++----------------- 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/checkin_notes b/checkin_notes index 77cd0e3efe..4164ee4b35 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4110,3 +4110,11 @@ David 28 May 2012 sched/ feeder.cpp + +Rom 30 May 2012 + - MGR: Wait until there is valid data in the list box before processing + the OnProjectSelected() event. + + clientgui/ + ProjectInfoPage.cpp + \ No newline at end of file diff --git a/clientgui/ProjectInfoPage.cpp b/clientgui/ProjectInfoPage.cpp index 02942df90e..4325afeb07 100644 --- a/clientgui/ProjectInfoPage.cpp +++ b/clientgui/ProjectInfoPage.cpp @@ -464,52 +464,56 @@ void CProjectInfoPage::OnProjectCategorySelected( wxCommandEvent& WXUNUSED(event void CProjectInfoPage::OnProjectSelected( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CProjectInfoPage::OnProjectSelected - Function Begin")); - CProjectInfo* pProjectInfo = (CProjectInfo*)m_pProjectsCtrl->GetClientData(m_pProjectsCtrl->GetSelection()); + if (m_pProjectsCtrl->GetSelection() != wxNOT_FOUND) { - wxString strURL = pProjectInfo->m_strURL; - EllipseStringIfNeeded(strURL, m_pProjectDetailsURLCtrl); + CProjectInfo* pProjectInfo = (CProjectInfo*)m_pProjectsCtrl->GetClientData(m_pProjectsCtrl->GetSelection()); - // Populate the project details area - wxString desc = pProjectInfo->m_strDescription; - // Change all occurrences of "n" to "^n" - desc.Replace(wxT(""), wxT("^"), true); - desc.Replace(wxT(""), wxT(""), true); + wxString strURL = pProjectInfo->m_strURL; + EllipseStringIfNeeded(strURL, m_pProjectDetailsURLCtrl); - m_pProjectDetailsDescriptionCtrl->SetValue(desc); - m_pProjectDetailsURLCtrl->SetLabel(strURL); - m_pProjectDetailsURLCtrl->SetURL(pProjectInfo->m_strURL); - // Set tooltip to full text in case ellipsed - m_pProjectDetailsURLCtrl->SetToolTip(pProjectInfo->m_strURL); + // Populate the project details area + wxString desc = pProjectInfo->m_strDescription; + // Change all occurrences of "n" to "^n" + desc.Replace(wxT(""), wxT("^"), true); + desc.Replace(wxT(""), wxT(""), true); - m_pProjectDetailsSupportedPlatformWindowsCtrl->Hide(); - m_pProjectDetailsSupportedPlatformMacCtrl->Hide(); - m_pProjectDetailsSupportedPlatformLinuxCtrl->Hide(); - m_pProjectDetailsSupportedPlatformATICtrl->Hide(); - m_pProjectDetailsSupportedPlatformNvidiaCtrl->Hide(); - if (pProjectInfo->m_bProjectSupportsWindows) m_pProjectDetailsSupportedPlatformWindowsCtrl->Show(); - if (pProjectInfo->m_bProjectSupportsMac) m_pProjectDetailsSupportedPlatformMacCtrl->Show(); - if (pProjectInfo->m_bProjectSupportsLinux) m_pProjectDetailsSupportedPlatformLinuxCtrl->Show(); - if (pProjectInfo->m_bProjectSupportsCAL) m_pProjectDetailsSupportedPlatformATICtrl->Show(); - if (pProjectInfo->m_bProjectSupportsCUDA) m_pProjectDetailsSupportedPlatformNvidiaCtrl->Show(); + m_pProjectDetailsDescriptionCtrl->SetValue(desc); + m_pProjectDetailsURLCtrl->SetLabel(strURL); + m_pProjectDetailsURLCtrl->SetURL(pProjectInfo->m_strURL); + // Set tooltip to full text in case ellipsed + m_pProjectDetailsURLCtrl->SetToolTip(pProjectInfo->m_strURL); - // Populate non-control data for use in other places of the wizard - SetProjectURL( pProjectInfo->m_strURL ); - SetProjectSupported( pProjectInfo->m_bSupportedPlatformFound ); + m_pProjectDetailsSupportedPlatformWindowsCtrl->Hide(); + m_pProjectDetailsSupportedPlatformMacCtrl->Hide(); + m_pProjectDetailsSupportedPlatformLinuxCtrl->Hide(); + m_pProjectDetailsSupportedPlatformATICtrl->Hide(); + m_pProjectDetailsSupportedPlatformNvidiaCtrl->Hide(); + if (pProjectInfo->m_bProjectSupportsWindows) m_pProjectDetailsSupportedPlatformWindowsCtrl->Show(); + if (pProjectInfo->m_bProjectSupportsMac) m_pProjectDetailsSupportedPlatformMacCtrl->Show(); + if (pProjectInfo->m_bProjectSupportsLinux) m_pProjectDetailsSupportedPlatformLinuxCtrl->Show(); + if (pProjectInfo->m_bProjectSupportsCAL) m_pProjectDetailsSupportedPlatformATICtrl->Show(); + if (pProjectInfo->m_bProjectSupportsCUDA) m_pProjectDetailsSupportedPlatformNvidiaCtrl->Show(); - TransferDataToWindow(); - Layout(); + // Populate non-control data for use in other places of the wizard + SetProjectURL( pProjectInfo->m_strURL ); + SetProjectSupported( pProjectInfo->m_bSupportedPlatformFound ); - wxString strResearchArea = pProjectInfo->m_strSpecificArea; - EllipseStringIfNeeded(strResearchArea, m_pProjectDetailsResearchAreaCtrl); - m_pProjectDetailsResearchAreaCtrl->SetLabel(strResearchArea); - // Set tooltip to full text in case ellipsed - m_pProjectDetailsResearchAreaCtrl->SetToolTip(pProjectInfo->m_strSpecificArea); + TransferDataToWindow(); + Layout(); - wxString strOrganization = pProjectInfo->m_strOrganization; - EllipseStringIfNeeded(strOrganization, m_pProjectDetailsOrganizationCtrl); - m_pProjectDetailsOrganizationCtrl->SetLabel(strOrganization); - // Set tooltip to full text in case ellipsed - m_pProjectDetailsOrganizationCtrl->SetToolTip(pProjectInfo->m_strOrganization); + wxString strResearchArea = pProjectInfo->m_strSpecificArea; + EllipseStringIfNeeded(strResearchArea, m_pProjectDetailsResearchAreaCtrl); + m_pProjectDetailsResearchAreaCtrl->SetLabel(strResearchArea); + // Set tooltip to full text in case ellipsed + m_pProjectDetailsResearchAreaCtrl->SetToolTip(pProjectInfo->m_strSpecificArea); + + wxString strOrganization = pProjectInfo->m_strOrganization; + EllipseStringIfNeeded(strOrganization, m_pProjectDetailsOrganizationCtrl); + m_pProjectDetailsOrganizationCtrl->SetLabel(strOrganization); + // Set tooltip to full text in case ellipsed + m_pProjectDetailsOrganizationCtrl->SetToolTip(pProjectInfo->m_strOrganization); + + } wxLogTrace(wxT("Function Start/End"), wxT("CProjectInfoPage::OnProjectSelected - Function End")); }