Ticket #26: boincmgr_26.patch
File boincmgr_26.patch, 7.9 KB (added by , 17 years ago) |
---|
-
../clientgui/ViewProjects.cpp
42 42 #define COLUMN_TOTALCREDIT 3 43 43 #define COLUMN_AVGCREDIT 4 44 44 #define COLUMN_RESOURCESHARE 5 45 #define COLUMN_STATUS 6 45 #define COLUMN_SHORTTERMDEBT 6 46 #define COLUMN_LONGTERMDEBT 7 47 #define COLUMN_STATUS 8 46 48 47 49 // groups that contain buttons 48 50 #define GRP_TASKS 0 … … 67 69 m_strTotalCredit.Clear(); 68 70 m_strAVGCredit.Clear(); 69 71 m_strResourceShare.Clear(); 72 m_strShortTermDebt.Clear(); 73 m_strLongTermDebt.Clear(); 70 74 m_strStatus.Clear(); 71 75 } 72 76 … … 156 160 m_pListPane->InsertColumn(COLUMN_TOTALCREDIT, _("Work done"), wxLIST_FORMAT_RIGHT, 80); 157 161 m_pListPane->InsertColumn(COLUMN_AVGCREDIT, _("Avg. work done"), wxLIST_FORMAT_RIGHT, 80); 158 162 m_pListPane->InsertColumn(COLUMN_RESOURCESHARE, _("Resource share"), wxLIST_FORMAT_CENTRE, 85); 163 m_pListPane->InsertColumn(COLUMN_SHORTTERMDEBT, _("Short term debt"), wxLIST_FORMAT_RIGHT, 80); 164 m_pListPane->InsertColumn(COLUMN_LONGTERMDEBT, _("Long term debt"), wxLIST_FORMAT_RIGHT, 80); 159 165 m_pListPane->InsertColumn(COLUMN_STATUS, _("Status"), wxLIST_FORMAT_LEFT, 150); 160 166 161 167 UpdateSelection(); … … 426 432 case COLUMN_RESOURCESHARE: 427 433 strBuffer = project->m_strResourceShare; 428 434 break; 435 case COLUMN_SHORTTERMDEBT: 436 strBuffer = project->m_strShortTermDebt; 437 break; 438 case COLUMN_LONGTERMDEBT: 439 strBuffer = project->m_strLongTermDebt; 440 break; 429 441 case COLUMN_STATUS: 430 442 strBuffer = project->m_strStatus; 431 443 break; … … 458 470 case COLUMN_RESOURCESHARE: 459 471 FormatResourceShare(item, strBuffer); 460 472 break; 473 case COLUMN_SHORTTERMDEBT: 474 FormatShortTermDebt(item, strBuffer); 475 break; 476 case COLUMN_LONGTERMDEBT: 477 FormatLongTermDebt(item, strBuffer); 478 break; 461 479 case COLUMN_STATUS: 462 480 FormatStatus(item, strBuffer); 463 481 break; … … 522 540 case COLUMN_RESOURCESHARE: 523 541 project->m_strResourceShare = strNewData; 524 542 break; 543 case COLUMN_SHORTTERMDEBT: 544 project->m_strShortTermDebt = strNewData; 545 break; 546 case COLUMN_LONGTERMDEBT: 547 project->m_strLongTermDebt = strNewData; 548 break; 525 549 case COLUMN_STATUS: 526 550 project->m_strStatus = strNewData; 527 551 break; … … 667 691 return 0; 668 692 } 669 693 694 wxInt32 CViewProjects::FormatShortTermDebt(wxInt32 item, wxString& strBuffer ) const { 695 PROJECT* project = wxGetApp().GetDocument()->project(item); 670 696 697 if (project) { 698 strBuffer.Printf(wxT("%0.2fs"), project->short_term_debt); 699 } 700 701 return 0; 702 } 703 704 wxInt32 CViewProjects::FormatLongTermDebt(wxInt32 item, wxString& strBuffer ) const { 705 PROJECT* project = wxGetApp().GetDocument()->project(item); 706 707 if (project) { 708 strBuffer.Printf(wxT("%0.2fs"), project->long_term_debt); 709 } 710 711 return 0; 712 } 713 671 714 wxInt32 CViewProjects::FormatStatus(wxInt32 item, wxString& status) const { 672 715 PROJECT* project = wxGetApp().GetDocument()->project(item); 673 716 -
../clientgui/ViewProjects.h
40 40 wxString m_strTotalCredit; 41 41 wxString m_strAVGCredit; 42 42 wxString m_strResourceShare; 43 wxString m_strShortTermDebt; 44 wxString m_strLongTermDebt; 43 45 wxString m_strStatus; 44 46 }; 45 47 … … 89 91 wxInt32 FormatTotalCredit( wxInt32 item, wxString& strBuffer ) const; 90 92 wxInt32 FormatAVGCredit( wxInt32 item, wxString& strBuffer ) const; 91 93 wxInt32 FormatResourceShare( wxInt32 item, wxString& strBuffer ) const; 94 wxInt32 FormatShortTermDebt( wxInt32 item, wxString& strBuffer ) const; 95 wxInt32 FormatLongTermDebt( wxInt32 item, wxString& strBuffer ) const; 92 96 wxInt32 FormatStatus( wxInt32 item, wxString& strBuffer ) const; 93 97 94 98 bool IsWebsiteLink( const wxString& strLink ); -
../clientgui/ViewProjectsGrid.cpp
42 42 #define COLUMN_TOTALCREDIT 3 43 43 #define COLUMN_AVGCREDIT 4 44 44 #define COLUMN_RESOURCESHARE 5 45 #define COLUMN_STATUS 6 45 #define COLUMN_SHORTTERMDEBT 6 46 #define COLUMN_LONGTERMDEBT 7 47 #define COLUMN_STATUS 8 46 48 47 49 // groups that contain buttons 48 50 #define GRP_TASKS 0 … … 159 161 160 162 // Create Grid 161 163 m_pGridPane->Setup(); 162 m_pGridPane->SetTable(new CBOINCGridTable(1, 7));164 m_pGridPane->SetTable(new CBOINCGridTable(1,9)); 163 165 m_pGridPane->SetSelectionMode(wxGrid::wxGridSelectRows); 164 166 // init grid columns 165 wxInt32 colSizes[] = {150,80,80,80,80,85, 150};166 wxString colTitles[] = {_("Project"),_("Account"),_("Team"),_("Work done"),_("Avg. work done"),_("Resource share"),_("S tatus")};167 wxInt32 colSizes[] = {150,80,80,80,80,85,80,80,150}; 168 wxString colTitles[] = {_("Project"),_("Account"),_("Team"),_("Work done"),_("Avg. work done"),_("Resource share"),_("Short term debt"),_("Long term debt"),_("Status")}; 167 169 for(int i=0; i<= COLUMN_STATUS;i++){ 168 170 m_pGridPane->SetColLabelValue(i,colTitles[i]); 169 171 m_pGridPane->SetColSize(i,colSizes[i]); … … 174 176 m_pGridPane->SetColumnSortType(COLUMN_TOTALCREDIT,CST_FLOAT); 175 177 m_pGridPane->SetColumnSortType(COLUMN_RESOURCESHARE,CST_FLOAT); 176 178 m_pGridPane->SetColumnSortType(COLUMN_AVGCREDIT,CST_FLOAT); 179 m_pGridPane->SetColumnSortType(COLUMN_SHORTTERMDEBT,CST_FLOAT); 180 m_pGridPane->SetColumnSortType(COLUMN_LONGTERMDEBT,CST_FLOAT); 177 181 // 178 182 m_pGridPane->SetPrimaryKeyColumn(COLUMN_PROJECT); 179 183 UpdateSelection(); … … 623 627 } 624 628 } 625 629 630 void CViewProjectsGrid::FormatShortTermDebt(wxInt32 item, wxString& strBuffer) { 631 PROJECT* project = wxGetApp().GetDocument()->project(item); 632 if (project) { 633 strBuffer.Printf(wxT("%0.2fs"), project->short_term_debt); 634 } 635 } 636 637 void CViewProjectsGrid::FormatLongTermDebt(wxInt32 item, wxString& strBuffer) { 638 PROJECT* project = wxGetApp().GetDocument()->project(item); 639 if (project) { 640 strBuffer.Printf(wxT("%0.2fs"), project->long_term_debt); 641 } 642 } 643 626 644 void CViewProjectsGrid::FormatStatus(wxInt32 item, wxString& strBuffer) { 627 645 PROJECT* project = wxGetApp().GetDocument()->project(item); 628 646 … … 789 807 m_pGridPane->SetCellAlignment(iRow, COLUMN_RESOURCESHARE, wxALIGN_CENTRE, wxALIGN_CENTRE); 790 808 } 791 809 810 FormatShortTermDebt(iRow, strBuffer); 811 if (m_pGridPane->GetCellValue(iRow, COLUMN_SHORTTERMDEBT) != strBuffer) { 812 m_pGridPane->SetCellValue(iRow, COLUMN_SHORTTERMDEBT, strBuffer); 813 } 814 815 FormatLongTermDebt(iRow, strBuffer); 816 if (m_pGridPane->GetCellValue(iRow, COLUMN_LONGTERMDEBT) != strBuffer) { 817 m_pGridPane->SetCellValue(iRow, COLUMN_LONGTERMDEBT, strBuffer); 818 } 819 792 820 strBuffer = wxEmptyString; 793 821 FormatStatus(iRow, strBuffer); 794 822 if (m_pGridPane->GetCellValue(iRow, COLUMN_STATUS) != strBuffer) { -
../clientgui/ViewProjectsGrid.h
65 65 void FormatTotalCredit( wxInt32 item, wxString& strBuffer ); 66 66 void FormatAVGCredit( wxInt32 item, wxString& strBuffer ); 67 67 void FormatResourceShare( wxInt32 item, wxString& strBuffer ); 68 void FormatShortTermDebt( wxInt32 item, wxString& strBuffer ); 69 void FormatLongTermDebt( wxInt32 item, wxString& strBuffer ); 68 70 void FormatStatus( wxInt32 item, wxString& strBuffer ); 69 71 70 72 bool IsWebsiteLink( const wxString& strLink );