Ticket #26: boincmgr_26.patch

File boincmgr_26.patch, 7.9 KB (added by Der Meister, 17 years ago)
  • ../clientgui/ViewProjects.cpp

     
    4242#define COLUMN_TOTALCREDIT          3
    4343#define COLUMN_AVGCREDIT            4
    4444#define COLUMN_RESOURCESHARE        5
    45 #define COLUMN_STATUS               6
     45#define COLUMN_SHORTTERMDEBT        6
     46#define COLUMN_LONGTERMDEBT         7
     47#define COLUMN_STATUS               8
    4648
    4749// groups that contain buttons
    4850#define GRP_TASKS    0
     
    6769    m_strTotalCredit.Clear();
    6870    m_strAVGCredit.Clear();
    6971    m_strResourceShare.Clear();
     72        m_strShortTermDebt.Clear();
     73        m_strLongTermDebt.Clear();
    7074    m_strStatus.Clear();
    7175}
    7276
     
    156160    m_pListPane->InsertColumn(COLUMN_TOTALCREDIT, _("Work done"), wxLIST_FORMAT_RIGHT, 80);
    157161    m_pListPane->InsertColumn(COLUMN_AVGCREDIT, _("Avg. work done"), wxLIST_FORMAT_RIGHT, 80);
    158162    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);
    159165    m_pListPane->InsertColumn(COLUMN_STATUS, _("Status"), wxLIST_FORMAT_LEFT, 150);
    160166
    161167    UpdateSelection();
     
    426432            case COLUMN_RESOURCESHARE:
    427433                strBuffer = project->m_strResourceShare;
    428434                break;
     435                        case COLUMN_SHORTTERMDEBT:
     436                                strBuffer = project->m_strShortTermDebt;
     437                                break;
     438                        case COLUMN_LONGTERMDEBT:
     439                                strBuffer = project->m_strLongTermDebt;
     440                                break;
    429441            case COLUMN_STATUS:
    430442                strBuffer = project->m_strStatus;
    431443                break;
     
    458470    case COLUMN_RESOURCESHARE:
    459471        FormatResourceShare(item, strBuffer);
    460472        break;
     473        case COLUMN_SHORTTERMDEBT:
     474                FormatShortTermDebt(item, strBuffer);
     475                break;
     476        case COLUMN_LONGTERMDEBT:
     477                FormatLongTermDebt(item, strBuffer);
     478                break;
    461479    case COLUMN_STATUS:
    462480        FormatStatus(item, strBuffer);
    463481        break;
     
    522540    case COLUMN_RESOURCESHARE:
    523541        project->m_strResourceShare = strNewData;
    524542        break;
     543        case COLUMN_SHORTTERMDEBT:
     544                project->m_strShortTermDebt = strNewData;
     545                break;
     546        case COLUMN_LONGTERMDEBT:
     547                project->m_strLongTermDebt = strNewData;
     548                break;
    525549    case COLUMN_STATUS:
    526550        project->m_strStatus = strNewData;
    527551        break;
     
    667691    return 0;
    668692}
    669693
     694wxInt32 CViewProjects::FormatShortTermDebt(wxInt32 item, wxString& strBuffer ) const {
     695        PROJECT* project = wxGetApp().GetDocument()->project(item);
    670696
     697        if (project) {
     698                strBuffer.Printf(wxT("%0.2fs"), project->short_term_debt);
     699        }
     700
     701        return 0;
     702}
     703
     704wxInt32 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
    671714wxInt32 CViewProjects::FormatStatus(wxInt32 item, wxString& status) const {
    672715    PROJECT* project = wxGetApp().GetDocument()->project(item);
    673716
  • ../clientgui/ViewProjects.h

     
    4040    wxString m_strTotalCredit;
    4141    wxString m_strAVGCredit;
    4242    wxString m_strResourceShare;
     43        wxString m_strShortTermDebt;
     44        wxString m_strLongTermDebt;
    4345    wxString m_strStatus;
    4446};
    4547
     
    8991    wxInt32                 FormatTotalCredit( wxInt32 item, wxString& strBuffer ) const;
    9092    wxInt32                 FormatAVGCredit( wxInt32 item, wxString& strBuffer ) const;
    9193    wxInt32                 FormatResourceShare( wxInt32 item, wxString& strBuffer ) const;
     94        wxInt32                 FormatShortTermDebt( wxInt32 item, wxString& strBuffer ) const;
     95        wxInt32                 FormatLongTermDebt( wxInt32 item, wxString& strBuffer ) const;
    9296    wxInt32                 FormatStatus( wxInt32 item, wxString& strBuffer ) const;
    9397
    9498    bool                    IsWebsiteLink( const wxString& strLink );
  • ../clientgui/ViewProjectsGrid.cpp

     
    4242#define COLUMN_TOTALCREDIT          3
    4343#define COLUMN_AVGCREDIT            4
    4444#define COLUMN_RESOURCESHARE        5
    45 #define COLUMN_STATUS               6
     45#define COLUMN_SHORTTERMDEBT        6
     46#define COLUMN_LONGTERMDEBT         7
     47#define COLUMN_STATUS               8
    4648
    4749// groups that contain buttons
    4850#define GRP_TASKS    0
     
    159161
    160162        // Create Grid
    161163        m_pGridPane->Setup();
    162         m_pGridPane->SetTable(new CBOINCGridTable(1,7));
     164        m_pGridPane->SetTable(new CBOINCGridTable(1,9));
    163165        m_pGridPane->SetSelectionMode(wxGrid::wxGridSelectRows);
    164166        // 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"),_("Status")};
     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")};
    167169        for(int i=0; i<= COLUMN_STATUS;i++){
    168170                m_pGridPane->SetColLabelValue(i,colTitles[i]);
    169171                m_pGridPane->SetColSize(i,colSizes[i]);
     
    174176        m_pGridPane->SetColumnSortType(COLUMN_TOTALCREDIT,CST_FLOAT);
    175177        m_pGridPane->SetColumnSortType(COLUMN_RESOURCESHARE,CST_FLOAT);
    176178        m_pGridPane->SetColumnSortType(COLUMN_AVGCREDIT,CST_FLOAT);
     179        m_pGridPane->SetColumnSortType(COLUMN_SHORTTERMDEBT,CST_FLOAT);
     180        m_pGridPane->SetColumnSortType(COLUMN_LONGTERMDEBT,CST_FLOAT);
    177181        //
    178182        m_pGridPane->SetPrimaryKeyColumn(COLUMN_PROJECT);
    179183    UpdateSelection();
     
    623627    }
    624628}
    625629
     630void 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
     637void 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
    626644void CViewProjectsGrid::FormatStatus(wxInt32 item, wxString& strBuffer) {
    627645    PROJECT* project = wxGetApp().GetDocument()->project(item);
    628646
     
    789807                    m_pGridPane->SetCellAlignment(iRow, COLUMN_RESOURCESHARE, wxALIGN_CENTRE, wxALIGN_CENTRE);
    790808        }
    791809
     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               
    792820                strBuffer = wxEmptyString;
    793821                FormatStatus(iRow, strBuffer);
    794822        if (m_pGridPane->GetCellValue(iRow, COLUMN_STATUS) != strBuffer) {
  • ../clientgui/ViewProjectsGrid.h

     
    6565    void                                        FormatTotalCredit( wxInt32 item, wxString& strBuffer );
    6666    void                                        FormatAVGCredit( wxInt32 item, wxString& strBuffer );
    6767    void                                        FormatResourceShare( wxInt32 item, wxString& strBuffer );
     68        void                                    FormatShortTermDebt( wxInt32 item, wxString& strBuffer );
     69        void                                    FormatLongTermDebt( wxInt32 item, wxString& strBuffer );
    6870    void                                        FormatStatus( wxInt32 item, wxString& strBuffer );
    6971
    7072    bool                    IsWebsiteLink( const wxString& strLink );