Skip to content

Commit

Permalink
[wip] boincmgr: get tasks by project function
Browse files Browse the repository at this point in the history
  • Loading branch information
winkies committed Nov 17, 2020
1 parent 0797187 commit 2759f0f
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions clientgui/ViewWork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ void CViewWork::OnTasksByProject( wxCommandEvent& WXUNUSED(event)) {

CMainDocument* pDoc = wxGetApp().GetDocument();
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
int row;
MESSAGE* message;
int row = -1;
wxString strProjectName = wxEmptyString;

wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
Expand All @@ -455,12 +455,30 @@ void CViewWork::OnTasksByProject( wxCommandEvent& WXUNUSED(event)) {
// Get row selected
row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);

// Get message or result ?
message = wxGetApp().GetDocument()->message(row);
fprintf(stdout, "Project == %s", message->project);
syslog(LOG_INFO|LOG_ERR, "%s", message->project);
// Get project name of selected item
GetDocProjectName(row, strProjectName);

wxString projectRef = strProjectName;
int value = 0;
int total = GetDocCount();

// loop on all row to get only selected project
for (row = 0; row < total; row++) {
GetDocProjectName(row, strProjectName);
if (strRef.IsSameAs(strProjectName)) {
value++;
}
}

// wxString Foobar;
// Foobar.Printf( wxT("Hello I have %d tasks."), value);
// wxMessageBox(Foobar);

pDoc->m_TasksByProject = !pDoc->m_TasksByProject;
UpdateSelection(); // update button

pFrame->FireRefreshView(); // update frame / display

wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnTasksByProject - Function End"));
}

Expand Down

0 comments on commit 2759f0f

Please sign in to comment.