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 13, 2020
1 parent 9bd3a3b commit f32c1fe
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions clientgui/ViewWork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,21 +465,31 @@ 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 +926,21 @@ void CViewWork::UpdateSelection() {
);
}

// Update pTaskPane by
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 f32c1fe

Please sign in to comment.