Skip to content

Commit

Permalink
[wip] boincmgr: change on button when it pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
winkies committed Oct 14, 2020
1 parent 9af4d57 commit 81bb928
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions clientgui/ViewWork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,20 +465,27 @@ void CViewWork::OnTasksByProject( wxCommandEvent& WXUNUSED(event)) {
// loop on all row to get only selected project
for (row = 0; row < total; row++) {
GetDocProjectName(row, strProjectName);
if (strRef.IsSameAs(strProjectName)) {
if (projectRef.IsSameAs(strProjectName)) {
value++;
}
}

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

// TODO
// Use wxArrayInt instead of integer to save index tasks of same project
//
// See how Active Tasks or DlgEventLog re-draw current Frame
//


// 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

// Need to understand between RPC call and frame update..
// See: BOINCBaseFrame.cpp


wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnTasksByProject - Function End"));
}
Expand Down Expand Up @@ -916,6 +923,20 @@ void CViewWork::UpdateSelection() {
);
}

if (pDoc->m_TasksByProject) {
m_pTaskPane->UpdateTask(
pGroup->m_Tasks[BTN_FILTER_BY],
_("Show all tasks"),
_("Show all tasks.")
);
} else {
m_pTaskPane->UpdateTask(
pGroup->m_Tasks[BTN_FILTER_BY],
_("Show only this project"),
_("Show tasks from only this project.")
);
}

row = -1;
for (i=0; i<n; i++) {
// Step through all selected items
Expand Down

0 comments on commit 81bb928

Please sign in to comment.