Commit 91bf52bd authored by Rom Walton's avatar Rom Walton

- MGR: Add basic support for displaying the Nvidia and ATI logos

        for projects whom support Nvidia and ATI GPUs.
        
        Todo: add descriptions and project images when selected.
        
    clientgui/
        AccountManagerInfoPage.cpp
        ProjectInfoPage.cpp
        ProjectListCtrl.cpp, .h
    clientgui/res/
        atiicon.xpm (Added)
        nvidiaicon.xpm (Added)
    win_build/
        boincmgr.vcproj

svn path=/trunk/boinc/; revision=19591
parent 8dcf3420
......@@ -9286,3 +9286,19 @@ David 17 Nov 2009
doc/
get_platforms.inc
project_list.php
Rom 17 Nov 2009
- MGR: Add basic support for displaying the Nvidia and ATI logos
for projects whom support Nvidia and ATI GPUs.
Todo: add descriptions and project images when selected.
clientgui/
AccountManagerInfoPage.cpp
ProjectInfoPage.cpp
ProjectListCtrl.cpp, .h
clientgui/res/
atiicon.xpm (Added)
nvidiaicon.xpm (Added)
win_build/
boincmgr.vcproj
......@@ -264,7 +264,11 @@ void CAccountManagerInfoPage::OnPageChanged( wxWizardExEvent& event ) {
m_pProjectListCtrl->Append(
wxString(pl.account_managers[i]->url.c_str(), wxConvUTF8),
wxString(pl.account_managers[i]->name.c_str(), wxConvUTF8),
wxString(pl.account_managers[i]->image.c_str(), wxConvUTF8),
wxString(pl.account_managers[i]->description.c_str(), wxConvUTF8),
false,
false,
false,
true
);
}
......
......@@ -234,6 +234,9 @@ void CProjectInfoPage::OnPageChanged( wxWizardExEvent& event ) {
unsigned int i, j, k;
bool bSupportedPlatformFound = false;
bool bProjectSupportsNvidiaGPU = false;
bool bProjectSupportsATIGPU = false;
bool bProjectSupportsMulticore = false;
ALL_PROJECTS_LIST pl;
CMainDocument* pDoc = wxGetApp().GetDocument();
......@@ -264,31 +267,71 @@ void CProjectInfoPage::OnPageChanged( wxWizardExEvent& event ) {
for (i=0; i<pl.projects.size(); i++) {
bSupportedPlatformFound = false;
bProjectSupportsNvidiaGPU = false;
bProjectSupportsATIGPU = false;
bProjectSupportsMulticore = false;
wxLogTrace(
wxT("Function Status"),
wxT("CProjectInfoPage::OnPageChanged - Name: '%s', URL: '%s'"),
wxString(pl.projects[i]->name.c_str(), wxConvUTF8).c_str(),
wxString(pl.projects[i]->url.c_str(), wxConvUTF8).c_str()
);
std::vector<std::string> &project_platforms = pl.projects[i]->platforms;
// Can the core client support a platform that this project
// supports?
std::vector<std::string> &project_platforms = pl.projects[i]->platforms;
for (j = 0;j < client_platforms.size(); j++) {
for (k = 0;k < project_platforms.size(); k++) {
if (client_platforms[j] == project_platforms[k]) {
wxString strClientPlatform = wxString(client_platforms[j].c_str(), wxConvUTF8);
wxString strProjectPlatform = wxString(project_platforms[k].c_str(), wxConvUTF8);
wxString strRootProjectPlatform = strProjectPlatform.SubString(0, strProjectPlatform.Find(_T("[")) - 1);
if (strProjectPlatform.Find(_T("[cuda")) != wxNOT_FOUND) {
bProjectSupportsNvidiaGPU = true;
if ((pDoc->state.have_cuda) && (strClientPlatform == strRootProjectPlatform)) {
bSupportedPlatformFound = true;
}
}
if (strProjectPlatform.Find(_T("[ati")) != wxNOT_FOUND) {
bProjectSupportsATIGPU = true;
if ((pDoc->state.have_ati) && (strClientPlatform == strRootProjectPlatform)) {
bSupportedPlatformFound = true;
}
}
if (strProjectPlatform.Find(_T("[mt")) != wxNOT_FOUND) {
bProjectSupportsMulticore = true;
if (strClientPlatform == strRootProjectPlatform) {
bSupportedPlatformFound = true;
}
}
if (strClientPlatform == strRootProjectPlatform) {
bSupportedPlatformFound = true;
break;
}
}
}
wxLogTrace(
wxT("Function Status"),
wxT("CProjectInfoPage::OnPageChanged - Name: '%s', URL: '%s', Supported: '%d'"),
wxString(pl.projects[i]->name.c_str(), wxConvUTF8).c_str(),
wxString(pl.projects[i]->url.c_str(), wxConvUTF8).c_str(),
wxT("CProjectInfoPage::OnPageChanged - Nvidia: '%d', ATI: '%d', Multicore: '%d', Platform: '%d'"),
bProjectSupportsNvidiaGPU,
bProjectSupportsATIGPU,
bProjectSupportsMulticore,
bSupportedPlatformFound
);
m_pProjectListCtrl->Append(
wxString(pl.projects[i]->url.c_str(), wxConvUTF8),
wxString(pl.projects[i]->name.c_str(), wxConvUTF8),
wxString(pl.projects[i]->image.c_str(), wxConvUTF8),
wxString(pl.projects[i]->description.c_str(), wxConvUTF8),
bProjectSupportsNvidiaGPU,
bProjectSupportsATIGPU,
bProjectSupportsMulticore,
bSupportedPlatformFound
);
}
......@@ -297,6 +340,7 @@ void CProjectInfoPage::OnPageChanged( wxWizardExEvent& event ) {
m_pProjectListCtrl->SetSelection(0);
m_strProjectURL = m_pProjectListCtrl->GetItem(0)->GetURL();
m_bProjectSupported = m_pProjectListCtrl->GetItem(0)->IsPlatformSupported();
TransferDataToWindow();
m_bProjectListPopulated = true;
......
......@@ -26,6 +26,8 @@
////@begin XPM images
#include "res/externalweblink.xpm"
#include "res/nvidiaicon.xpm"
#include "res/atiicon.xpm"
////@end XPM images
......@@ -433,6 +435,8 @@ bool CProjectListCtrl::Create( wxWindow* parent )
#endif
wxMemoryFSHandler::AddFile(wxT("webexternallink.xpm"), wxBitmap(externalweblink_xpm), wxBITMAP_TYPE_XPM);
wxMemoryFSHandler::AddFile(wxT("nvidiaicon.xpm"), wxBitmap(nvidiaicon_xpm), wxBITMAP_TYPE_XPM);
wxMemoryFSHandler::AddFile(wxT("atiicon.xpm"), wxBitmap(atiicon_xpm), wxBITMAP_TYPE_XPM);
////@end CProjectListCtrl creation
return TRUE;
}
......@@ -488,20 +492,36 @@ void CProjectListCtrl::OnHover( wxHtmlCellEvent& event )
wxString CProjectListCtrl::OnGetItem(size_t i) const
{
wxString retval = wxEmptyString;
wxString buf = wxEmptyString;
retval += wxT(" <table cellpadding=0 cellspacing=1>");
retval += wxT(" <tr>");
buf.Printf(
wxT(" <td width=100%%>%s</td>"),
m_Items[i]->GetTitle().c_str()
);
retval += buf;
if (m_Items[i]->IsNvidiaGPUSupported()) {
retval += wxT(" <td><img src=\"memory:nvidiaicon.xpm\"></td>");
}
if (m_Items[i]->IsATIGPUSupported()) {
retval += wxT(" <td><img src=\"memory:atiicon.xpm\"></td>");
}
buf.Printf(
wxT(" <table cellpadding=0 cellspacing=1>")
wxT(" <tr>")
wxT(" <td width=100%%>%s</td>")
wxT(" <td><a href=\"%s\"><img src=\"memory:webexternallink.xpm\"></a></td>")
wxT(" </tr>")
wxT(" </table>"),
m_Items[i]->GetTitle().c_str(),
wxT(" <td><a href=\"%s\"><img src=\"memory:webexternallink.xpm\"></a></td>"),
m_Items[i]->GetURL().c_str()
);
retval += buf;
retval += wxT(" </tr>");
retval += wxT(" </table>");
return buf;
return retval;
}
......@@ -512,7 +532,11 @@ wxString CProjectListCtrl::OnGetItem(size_t i) const
bool CProjectListCtrl::Append(
wxString strURL,
wxString strTitle,
wxString strImage,
wxString strDescription,
bool bNvidiaGPUSupported,
bool bATIGPUSupported,
bool bMulticoreSupported,
bool bSupported
)
{
......@@ -520,7 +544,11 @@ bool CProjectListCtrl::Append(
pItem->SetURL( strURL );
pItem->SetTitle( strTitle );
pItem->SetImage( strImage );
pItem->SetDescription( strDescription );
pItem->SetNvidiaGPUSupported( bNvidiaGPUSupported );
pItem->SetATIGPUSupported( bATIGPUSupported );
pItem->SetMulticoreSupported( bMulticoreSupported );
pItem->SetPlatformSupported( bSupported );
m_Items.push_back(pItem);
......
......@@ -38,6 +38,9 @@ public:
wxString GetTitle() const { return m_strTitle ; }
void SetTitle(wxString value) { m_strTitle = value ; }
wxString GetImage() const { return m_strImage ; }
void SetImage(wxString value) { m_strImage = value ; }
wxString GetOrganization() const { return m_strOrganization ; }
void SetOrganization(wxString value) { m_strOrganization = value ; }
......@@ -47,15 +50,28 @@ public:
wxString GetCategory() const { return m_strCategory ; }
void SetCategory(wxString value) { m_strCategory = value ; }
bool IsNvidiaGPUSupported() const { return m_bNvidiaGPUSupported ; }
void SetNvidiaGPUSupported(bool value) { m_bNvidiaGPUSupported = value ; }
bool IsATIGPUSupported() const { return m_bATIGPUSupported ; }
void SetATIGPUSupported(bool value) { m_bATIGPUSupported = value ; }
bool IsMulticoreSupported() const { return m_bMulticoreSupported ; }
void SetMulticoreSupported(bool value) { m_bMulticoreSupported = value ; }
bool IsPlatformSupported() const { return m_bSupported ; }
void SetPlatformSupported(bool value) { m_bSupported = value ; }
private:
wxString m_strURL;
wxString m_strTitle;
wxString m_strImage;
wxString m_strOrganization;
wxString m_strDescription;
wxString m_strCategory;
bool m_bNvidiaGPUSupported;
bool m_bATIGPUSupported;
bool m_bMulticoreSupported;
bool m_bSupported;
};
......@@ -150,7 +166,11 @@ public:
bool Append(
wxString strURL,
wxString strTitle,
wxString strImage,
wxString strDescription,
bool bNvidiaGPUSupported,
bool bATIGPUSupported,
bool bMulticoreSupported,
bool bSupported
);
......@@ -164,7 +184,7 @@ private:
std::vector<CProjectListItem*> m_Items;
#ifdef __WXMAC__
CProjectListCtrlAccessible* m_accessible;
CProjectListCtrlAccessible* m_accessible;
#endif
};
......
// This file is part of BOINC.
// http://boinc.berkeley.edu
//
/* XPM */
static char *atiicon_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 249 2",
"n. c #A6222E",
"% c #C5565B",
"O. c #CE7D7A",
"D c #F71A1C",
"S. c #FFFFE7",
"C c #4F0100",
"5 c #FD6C6E",
"Q. c #AD4636",
"]. c #7A2E17",
"^ c #FB7273",
"a. c #7B181C",
"dX c #9C4038",
"h. c #D96979",
"1. c #DCA59F",
"v c #FF6066",
"<. c #F7848C",
"N. c #FFFFF6",
"_. c #AE2A30",
"#. c #FFFFF7",
"*X c #7A2B1A",
"y. c #89142A",
"B. c #A2221C",
"-. c #AB1718",
"R. c #FFFCF4",
"@. c #FFFFFE",
"c. c #E1A9AC",
"_ c #FFFFFF",
" X c #BE4331",
"Y. c #C23734",
"bX c #D73445",
"p. c #C7122F",
"DX c #C03D37",
"/. c #C2373B",
"4. c #E6ADB8",
"y c #FF575F",
"9. c #C31210",
"F c #FF1918",
"M c #9C373B",
"j c #A21916",
"=X c #BE403A",
"8X c #C73B4A",
"%. c #79121C",
": c #AF0524",
"I. c #FFEDE0",
",. c #EA2228",
"$ c #EB6D6A",
" . c #B0474E",
"lX c #D13A3A",
"3. c #F6F8ED",
";X c #D3343D",
"r c #E26F5C",
"o. c #FF8085",
"gX c #D3374D",
"E c #EDC8B9",
"0 c #7F1D16",
"CX c #D3344B",
"s c #BC4044",
"/ c #EC7A78",
") c #F4C3BE",
"@ c #D35A4D",
"R c #E0DCC2",
"} c #F09D9E",
"~ c #E0341F",
"Z. c #E1565B",
"k. c #DB332D",
"I c #E5AEAC",
"- c #7F1718",
"X. c #F02A2B",
"uX c #C63F40",
"N c #560A08",
"g c #4B1805",
"m. c #571D13",
"| c #E15669",
"2 c #F75A5B",
",X c #CB3D36",
"C. c #D66773",
"kX c #BD443D",
"e. c #E9292C",
"2X c #B33932",
"l c #CF281E",
"h c #951B1A",
"U c #E5D7C6",
"`. c #61282D",
"r. c #C05D77",
"z c #F52523",
"XX c #D73C3B",
":X c #D9363D",
"[. c #BD3E36",
">. c #D8555B",
"q c #951511",
"FX c #AA413E",
"v. c #F3FFE6",
"GX c #A53D41",
"fX c #713E2D",
"1X c #B24C3D",
"@X c #D2353E",
"( c #D57779",
"ZX c #923A3B",
"0X c #BB413E",
"H. c #FFF8DC",
"> c #DC6959",
"SX c #AB4B3C",
"yX c #C23C3D",
"J c #F9777B",
"Q c #F07F7C",
"u. c #FFF8E8",
".X c #C54034",
" c #DC6356",
"#X c #B43D3B",
"wX c #DC343D",
":. c #DE667B",
"x c #EB6F5F",
"f. c #B51B1C",
"!. c #EA2D3E",
"6 c #BC4B46",
"|. c #D3393F",
"4X c #CC3B40",
"~. c #FF213C",
"L c #F1C1BC",
"zX c #BE3F3F",
"j. c #D9535B",
"& c #5A0F16",
"*. c #BEB2BE",
"'. c #803B33",
"{. c #C7343D",
", c #FF4D56",
"MX c #BE3C40",
"rX c #BC423F",
".. c #E54F54",
"iX c #B23736",
"%X c #712928",
"sX c #CA3B40",
"}. c #BC4246",
"q. c #DA636F",
"[ c #E9E2F0",
"<X c #BF463B",
"P. c #C8AEB0",
"VX c #67472F",
"m c #E96F77",
"b c #E96C6E",
"{ c #E9A19E",
">X c #BF4339",
"5X c #AC463F",
"n c #D86367",
"V c #4C0405",
"* c #85071E",
"o c #E45C4F",
"0. c #CA2C28",
"2. c #C9BBB6",
"7. c #C4B7B9",
"6X c #8D3E32",
"nX c #AC403D",
"cX c #994038",
"qX c #CD393C",
"3X c #D4373E",
"U. c #852716",
"7 c #670C07",
"$. c #E8BAC0",
"A c #D51826",
"g. c #D82533",
"$X c #96302C",
"+ c #E4534B",
"eX c #D23A3F",
"A. c #CB3629",
"&. c #1F0000",
"a c #F67578",
"i c #F55F66",
"G c #F66F67",
"s. c #C2BAC6",
"xX c #B13E43",
"vX c #BF373F",
"c c #FF6162",
"&X c #AF4446",
"F. c #EA3E57",
"^. c #D42B35",
"1 c #EC5E56",
"6. c #631210",
"K. c #B72331",
"! c #CC4334",
"S c #E61220",
"). c #CF2738",
"9X c #863127",
"V. c #D22E35",
"i. c #EBB5B6",
";. c #AB1819",
"B c #540004",
"p c #F35C65",
"9 c #981E29",
"l. c #FFFAEE",
"w. c #D26060",
"d c #6A0704",
"-X c #D0343B",
"E. c #EC5B5F",
"d. c #FFFAF2",
"f c #692319",
"t c #FF585C",
"8 c #4E120A",
"M. c #CFC3CD",
"=. c #FFFAF5",
"7X c #78322A",
"8. c #FFF7EC",
"aX c #CE3A42",
"W c #C85254",
"hX c #903634",
"J. c #F5B4AB",
"D. c #B24546",
"] c #B2A996",
"W. c #FF7E6C",
"+. c #E4ABA9",
"' c #C18685",
"3 c #F15658",
"# c #EA5856",
"OX c #C73333",
"< c #FF4F56",
"O c #EF5952",
"t. c #FDC8D4",
"Y c #D3D7DB",
"mX c #8D4C3B",
"= c #691718",
"X c #FF4951",
"AX c #A43D3C",
"jX c #B03F3F",
"H c #FC6E6E",
"u c #F26362",
"tX c #BE383A",
"b. c #E6C8B5",
"BX c #9B4238",
"oX c #D43F3D",
"` c #D6A6A7",
". c #FF4655",
"5. c #A21128",
"w c #A1241C",
"P c #C67B7E",
"L. c #822523",
"x. c #CD7982",
"k c #C21A16",
"pX c #BA3E3D",
"(. c #D12F3D",
"K c #C86C6B",
"NX c #D63343",
"T c #C1D5C5",
"Z c #B41E24",
"G. c #B84144",
"z. c #FCFBEB",
"e c #D82431",
"T. c #E2646D",
"+X c #DB313D",
"4 c #E25E5A",
"; c #821C1E",
/* pixels */
" . X o O + @ # $ % & * = - ; : ",
"> , < 1 2 3 4 5 6 7 8 9 0 q w e ",
"r t y u i p a s d f g h j k l z ",
"x c v b n m M N B V C Z A S D F ",
"G H J K L P I U Y T R E W Q ! ~ ",
"^ / ( ) _ ` ' ] [ _ { } | ...X.",
"o.O.+.@.#.$.%.&.*.=.-.;.:._ >.,.",
"<.1._ 2.3.4.5.6.7.8.9.0.q._ w.e.",
"r._ t.y.u.i.p.a.s.d.f.g.h._ j.k.",
"l.z.x.c.v.b.n.m.M.N.B.V.C._ Z.A.",
"S.D.F.G.H.J.K.L.P.I.U.Y.T.R.E.W.",
"Q.!.~.^./.(.)._.`.'.].[.{.}.|. X",
".XXXoXOX+X@X#X$X%X&X*X=X-X;X:X>X",
",X<X1X2X3X4X5X6X7X8X9X0XqXwXeXrX",
"tXyXuXiXpXaXsXdXfXgXhXjXkXlXzXxX",
"cXvXbXnXmXMXNXBXVXCXZXAXSXDXFXGX"
};
// This file is part of BOINC.
// http://boinc.berkeley.edu
//
/* XPM */
static char *nvidiaicon_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 103 2",
"V c #6DB400",
"| c #7EBD0F",
"Q c #91C632",
"L c #C3E08F",
"@. c #F5FAED",
"f c #77B902",
"X. c #77B903",
"m c #FAFBF5",
"p c #D4E9B0",
"^ c #ECF6DB",
" c None",
"C c #CDE5A3",
"5 c #F1F7E5",
"+. c #6EB500",
" . c #EFF7E1",
"h c #BDDD84",
"> c #AAD462",
"&. c #A3D054",
"$. c #A3D055",
"3 c #67B100",
"T c #E8F3D6",
"4 c #CEE6A4",
"* c #71B600",
"g c #CEE6A5",
"( c #82BF17",
"= c #F2F8E6",
"r c #ADD567",
"#. c #9ACC45",
"o. c #F2F8E8",
"` c #A6D15B",
"x c #D1E7A9",
"a c #5EAD00",
"d c #BEDE87",
"$ c #68B200",
"/ c #FCFDFA",
"l c #A4D157",
"& c #72B700",
"N c #96C93B",
"; c #83C019",
"] c #61AE00",
"X c #7CBC0B",
"s c #F3F9E9",
"@ c #F3F9EA",
"% c #6BB300",
"U c #A7D25B",
"S c #FFFEFF",
"i c #75B800",
"I c #8DC52C",
"K c #69B300",
"P c #64AF00",
"v c #EAF5D8",
"o c #86C11E",
"~ c #86C11F",
"9 c #B8DB7C",
"O. c #6EB400",
"! c #EFF6E2",
"t c #62AF00",
"j c #BBDC80",
"1 c #76B900",
"D c #76B901",
"[ c #A8D35F",
": c #F9FBF4",
"b c #F9FBF5",
"# c #65B000",
"M c #87C220",
"e c #FEFFFE",
"J c #6FB500",
"F c #93C736",
"w c #93C737",
"{ c #BEDD86",
"' c #F0F7E3",
"6 c #5EAC00",
"8 c #DDEEC1",
"%. c #A4D056",
") c #FAFCF5",
"Z c #B5D976",
"0 c #66B100",
"G c #AED568",
"W c #AED569",
"z c #70B600",
"y c #D9EBB8",
"- c #94C839",
"Y c #5FAD00",
". c #F1F8E6",
"u c #69B200",
"H c #B8DA7B",
"k c #73B700",
"R c #C9E39A",
"_ c #67B200",
"} c #FBFDF9",
"q c #E1F0C7",
"E c #6CB300",
"B c #7DBC0E",
"7 c #8EC52C",
", c #6AB300",
"O c #87C11F",
"< c #74B800",
"A c #9FCE4B",
".. c #B2D76F",
"n c #59AA00",
"c c #63AF00",
"2 c #CAE49D",
"+ c #85C11D",
/* pixels */
" ",
" . X o O O O O O + o ",
" @ # $ % & & & & * * ",