From 9796c6d9e8591775527a932f0250bbec3c7e9fa2 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 21 Apr 2005 23:14:10 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=5916 --- checkin_notes | 14 +++++++++ clientgui/BOINCBaseView.cpp | 12 +++++--- clientgui/BOINCBaseView.h | 5 +-- clientgui/BOINCListCtrl.cpp | 34 ++------------------ clientgui/BOINCListCtrl.h | 2 -- clientgui/BOINCTaskCtrl.cpp | 60 +++++++++++++++++++++--------------- clientgui/BOINCTaskCtrl.h | 2 +- clientgui/ViewMessages.cpp | 15 ++++++--- clientgui/ViewMessages.h | 1 - clientgui/ViewProjects.cpp | 60 +++++++++++++++++++++++++++++++----- clientgui/ViewProjects.h | 3 +- clientgui/ViewResources.cpp | 8 ++--- clientgui/ViewResources.h | 1 - clientgui/ViewStatistics.cpp | 19 ++++++++++-- clientgui/ViewStatistics.h | 1 - clientgui/ViewTransfers.cpp | 14 ++++++--- clientgui/ViewTransfers.h | 1 - clientgui/ViewWork.cpp | 20 +++++++++--- clientgui/ViewWork.h | 1 - 19 files changed, 171 insertions(+), 102 deletions(-) diff --git a/checkin_notes b/checkin_notes index f5f0816eac..6f31330953 100755 --- a/checkin_notes +++ b/checkin_notes @@ -27521,3 +27521,17 @@ David 21 April 2005 BOINCBaseView.h MainDocument.cpp,h ViewProjects.cpp + +Rom 20 April 2005 + - Code Cleanup + + clientgui/ + BOINCBaseView.cpp, .h + BOINCListCtrl.cpp, .h + BOINCTaskCtrl.cpp, .h + ViewMessages.cpp, .h + ViewProjects.cpp, .h + ViewResources.cpp, .h + ViewStatistics.cpp, .h + ViewTransfers.cpp, .h + ViewWork.cpp, .h diff --git a/clientgui/BOINCBaseView.cpp b/clientgui/BOINCBaseView.cpp index 9152e74140..c4ae90b29f 100644 --- a/clientgui/BOINCBaseView.cpp +++ b/clientgui/BOINCBaseView.cpp @@ -261,14 +261,22 @@ bool CBOINCBaseView::OnRestoreState(wxConfigBase* pConfig) { void CBOINCBaseView::OnListSelected(wxListEvent& event) { + wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListSelected - Function Begin")); + UpdateSelection(); event.Skip(); + + wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListSelected - Function End")); } void CBOINCBaseView::OnListDeselected(wxListEvent& event) { + wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function Begin")); + UpdateSelection(); event.Skip(); + + wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function End")); } @@ -379,10 +387,6 @@ void CBOINCBaseView::UpdateSelection() {} -void CBOINCBaseView::UpdateTaskPane() -{} - - bool CBOINCBaseView::_EnsureLastItemVisible() { return EnsureLastItemVisible(); } diff --git a/clientgui/BOINCBaseView.h b/clientgui/BOINCBaseView.h index 5465c917c7..9d325c0634 100644 --- a/clientgui/BOINCBaseView.h +++ b/clientgui/BOINCBaseView.h @@ -36,7 +36,8 @@ class CTaskItem : wxObject { public: CTaskItem(); CTaskItem( wxString strName, wxString strDescription, wxInt32 iEventID ) : - m_strName(strName), m_strDescription(strDescription), m_iEventID(iEventID), m_pButton(NULL) {}; + m_strName(strName), m_strDescription(strDescription), m_iEventID(iEventID), m_pButton(NULL), + m_strWebSiteLink(wxT("")) {}; ~CTaskItem() {}; wxString m_strName; @@ -44,6 +45,7 @@ public: wxInt32 m_iEventID; wxButton* m_pButton; + wxString m_strWebSiteLink; }; @@ -123,7 +125,6 @@ protected: virtual int UpdateCache( long item, long column, wxString& strNewData ); virtual void UpdateSelection(); - virtual void UpdateTaskPane(); bool _EnsureLastItemVisible(); virtual bool EnsureLastItemVisible(); diff --git a/clientgui/BOINCListCtrl.cpp b/clientgui/BOINCListCtrl.cpp index 5aca438aba..b35c76b92b 100644 --- a/clientgui/BOINCListCtrl.cpp +++ b/clientgui/BOINCListCtrl.cpp @@ -47,16 +47,6 @@ CBOINCListCtrl::CBOINCListCtrl( wxEVT_COMMAND_LEFT_CLICK, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &CBOINCListCtrl::OnClick ); - Connect( - iListWindowID, - wxEVT_COMMAND_LIST_ITEM_SELECTED, - (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) &CBOINCListCtrl::OnSelected - ); - Connect( - iListWindowID, - wxEVT_COMMAND_LIST_ITEM_DESELECTED, - (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) &CBOINCListCtrl::OnDeselected - ); } @@ -154,11 +144,11 @@ void CBOINCListCtrl::OnClick(wxCommandEvent& event) { if (m_bIsSingleSelection) { if (GetFocusedItem() != GetFirstSelected()) { - OnDeselected(leEvent); + m_pParentView->FireOnListDeselected(leEvent); } } else { if (-1 == GetFirstSelected()) { - OnDeselected(leEvent); + m_pParentView->FireOnListDeselected(leEvent); } } @@ -166,26 +156,6 @@ void CBOINCListCtrl::OnClick(wxCommandEvent& event) { } -void CBOINCListCtrl::OnSelected(wxListEvent& event) { - wxASSERT(NULL != m_pParentView); - wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView)); - - m_pParentView->FireOnListSelected(event); - - event.Skip(); -} - - -void CBOINCListCtrl::OnDeselected(wxListEvent& event) { - wxASSERT(NULL != m_pParentView); - wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView)); - - m_pParentView->FireOnListDeselected(event); - - event.Skip(); -} - - wxString CBOINCListCtrl::OnGetItemText(long item, long column) const { wxASSERT(NULL != m_pParentView); wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView)); diff --git a/clientgui/BOINCListCtrl.h b/clientgui/BOINCListCtrl.h index 32e4472981..c80cc9f1cd 100644 --- a/clientgui/BOINCListCtrl.h +++ b/clientgui/BOINCListCtrl.h @@ -42,8 +42,6 @@ public: private: virtual void OnClick(wxCommandEvent& event); - virtual void OnSelected(wxListEvent& event); - virtual void OnDeselected(wxListEvent& event); virtual wxString OnGetItemText(long item, long column) const; virtual int OnGetItemImage(long item) const; diff --git a/clientgui/BOINCTaskCtrl.cpp b/clientgui/BOINCTaskCtrl.cpp index 1e5d9c90ba..3363ab9339 100644 --- a/clientgui/BOINCTaskCtrl.cpp +++ b/clientgui/BOINCTaskCtrl.cpp @@ -44,37 +44,49 @@ CBOINCTaskCtrl::~CBOINCTaskCtrl() {} -wxInt32 CBOINCTaskCtrl::CreateTaskControls() { +wxInt32 CBOINCTaskCtrl::UpdateControls() { unsigned int i; unsigned int j; - wxInt32 iCurrentWidth = 0; - wxInt32 iFutureWidth = 0; + bool bCreateMainSizer = false; CTaskItemGroup* pGroup = NULL; CTaskItem* pItem = NULL; - m_pBoxSizer = new wxBoxSizer(wxVERTICAL); - m_pBoxSizer->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - for (i=0; i < m_pParent->m_TaskGroups.size(); i++) { - pGroup = m_pParent->m_TaskGroups[i]; - - pGroup->m_pStaticBox = new wxStaticBox(this, wxID_ANY, pGroup->m_strName); - pGroup->m_pStaticBoxSizer = new wxStaticBoxSizer(pGroup->m_pStaticBox, wxVERTICAL); - - for (j=0; j < pGroup->m_Tasks.size(); j++) { - pItem = pGroup->m_Tasks[j]; - - pItem->m_pButton = new wxButton; - pItem->m_pButton->Create(this, pItem->m_iEventID, pItem->m_strName, wxDefaultPosition, wxDefaultSize, 0); - pItem->m_pButton->SetToolTip(pItem->m_strDescription); - pGroup->m_pStaticBoxSizer->Add(pItem->m_pButton, 0, wxEXPAND|wxALL, 5); - } - - m_pBoxSizer->Add(pGroup->m_pStaticBoxSizer, 0, wxEXPAND|wxALL, 5); - m_pBoxSizer->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + bCreateMainSizer = (!GetSizer()); + if (bCreateMainSizer) { + m_pBoxSizer = new wxBoxSizer(wxVERTICAL); + m_pBoxSizer->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); } - SetSizerAndFit(m_pBoxSizer); + // Create static boxes and sizers if they don't exist + for (i=0; i < m_pParent->m_TaskGroups.size(); i++) { + pGroup = m_pParent->m_TaskGroups[i]; + if (!pGroup->m_pStaticBox) { + pGroup->m_pStaticBox = new wxStaticBox(this, wxID_ANY, pGroup->m_strName); + pGroup->m_pStaticBoxSizer = new wxStaticBoxSizer(pGroup->m_pStaticBox, wxVERTICAL); + m_pBoxSizer->Add(pGroup->m_pStaticBoxSizer, 0, wxEXPAND|wxALL, 5); + m_pBoxSizer->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + } + } + + // Create buttons if they don't exist + for (i=0; i < m_pParent->m_TaskGroups.size(); i++) { + pGroup = m_pParent->m_TaskGroups[i]; + for (j=0; j < pGroup->m_Tasks.size(); j++) { + pItem = pGroup->m_Tasks[j]; + if (!pItem->m_pButton) { + pItem->m_pButton = new wxButton; + pItem->m_pButton->Create(this, pItem->m_iEventID, pItem->m_strName, wxDefaultPosition, wxDefaultSize, 0); + pItem->m_pButton->SetToolTip(pItem->m_strDescription); + pGroup->m_pStaticBoxSizer->Add(pItem->m_pButton, 0, wxEXPAND|wxALL, 5); + } + } + } + + if (bCreateMainSizer) { + SetSizerAndFit(m_pBoxSizer); + } else { + Fit(); + } return 0; } diff --git a/clientgui/BOINCTaskCtrl.h b/clientgui/BOINCTaskCtrl.h index 3a843898a3..c51d18fe3c 100644 --- a/clientgui/BOINCTaskCtrl.h +++ b/clientgui/BOINCTaskCtrl.h @@ -36,7 +36,7 @@ public: ~CBOINCTaskCtrl(); - wxInt32 CreateTaskControls(); + wxInt32 UpdateControls(); virtual bool OnSaveState( wxConfigBase* pConfig ); virtual bool OnRestoreState( wxConfigBase* pConfig ); diff --git a/clientgui/ViewMessages.cpp b/clientgui/ViewMessages.cpp index 27e4880dfe..dd6f05d80c 100644 --- a/clientgui/ViewMessages.cpp +++ b/clientgui/ViewMessages.cpp @@ -46,6 +46,8 @@ IMPLEMENT_DYNAMIC_CLASS(CViewMessages, CBOINCBaseView) BEGIN_EVENT_TABLE (CViewMessages, CBOINCBaseView) EVT_BUTTON(ID_TASK_MESSAGES_COPYALL, CViewMessages::OnMessagesCopyAll) EVT_BUTTON(ID_TASK_MESSAGES_COPYSELECTED, CViewMessages::OnMessagesCopySelected) + EVT_LIST_ITEM_SELECTED(ID_LIST_MESSAGESVIEW, CViewMessages::OnListSelected) + EVT_LIST_ITEM_DESELECTED(ID_LIST_MESSAGESVIEW, CViewMessages::OnListDeselected) END_EVENT_TABLE () @@ -92,7 +94,7 @@ CViewMessages::CViewMessages(wxNotebook* pNotebook) : // Create Task Pane Items - m_pTaskPane->CreateTaskControls(); + m_pTaskPane->UpdateControls(); // Create List Pane Items m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 115); @@ -153,6 +155,9 @@ void CViewMessages::OnMessagesCopyAll( wxCommandEvent& event ) { #endif + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewMessages::OnMessagesCopyAll - Function End")); } @@ -186,6 +191,9 @@ void CViewMessages::OnMessagesCopySelected( wxCommandEvent& event ) { #endif + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewMessages::OnMessagesCopySelected - Function End")); } @@ -273,10 +281,6 @@ void CViewMessages::UpdateSelection() { } -void CViewMessages::UpdateTaskPane() { -} - - wxInt32 CViewMessages::FormatProjectName(wxInt32 item, wxString& strBuffer) const { CMainDocument* pDoc = wxGetApp().GetDocument(); @@ -406,4 +410,5 @@ bool CViewMessages::CloseClipboard() { #endif + const char *BOINC_RCSID_0be7149475 = "$Id$"; diff --git a/clientgui/ViewMessages.h b/clientgui/ViewMessages.h index 6ce57ea3f1..a2f1210634 100644 --- a/clientgui/ViewMessages.h +++ b/clientgui/ViewMessages.h @@ -60,7 +60,6 @@ protected: virtual bool EnsureLastItemVisible(); virtual void UpdateSelection(); - virtual void UpdateTaskPane(); wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const; wxInt32 FormatPriority( wxInt32 item, wxString& strBuffer ) const; diff --git a/clientgui/ViewProjects.cpp b/clientgui/ViewProjects.cpp index c879722500..a18800cd87 100644 --- a/clientgui/ViewProjects.cpp +++ b/clientgui/ViewProjects.cpp @@ -83,6 +83,8 @@ BEGIN_EVENT_TABLE (CViewProjects, CBOINCBaseView) EVT_BUTTON(ID_TASK_PROJECT_RESET, CViewProjects::OnProjectReset) EVT_BUTTON(ID_TASK_PROJECT_DETACH, CViewProjects::OnProjectDetach) EVT_BUTTON(ID_TASK_PROJECT_ATTACH, CViewProjects::OnProjectAttach) + EVT_LIST_ITEM_SELECTED(ID_LIST_PROJECTSVIEW, CViewProjects::OnListSelected) + EVT_LIST_ITEM_DESELECTED(ID_LIST_PROJECTSVIEW, CViewProjects::OnListDeselected) END_EVENT_TABLE () @@ -180,7 +182,7 @@ CViewProjects::CViewProjects(wxNotebook* pNotebook) : // Create Task Pane Items - m_pTaskPane->CreateTaskControls(); + m_pTaskPane->UpdateControls(); // Create List Pane Items m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 150); @@ -226,6 +228,9 @@ void CViewProjects::OnProjectUpdate( wxCommandEvent& event ) { pDoc->ProjectUpdate(m_pListPane->GetFirstSelected()); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectUpdate - Function End")); } @@ -247,6 +252,9 @@ void CViewProjects::OnProjectSuspend( wxCommandEvent& event ) { pDoc->ProjectSuspend(m_pListPane->GetFirstSelected()); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectSuspend - Function End")); } @@ -268,6 +276,9 @@ void CViewProjects::OnProjectResume( wxCommandEvent& event ) { pDoc->ProjectResume(m_pListPane->GetFirstSelected()); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectResume - Function End")); } @@ -289,6 +300,9 @@ void CViewProjects::OnProjectNoNewWork( wxCommandEvent& event ) { pDoc->ProjectNoMoreWork(m_pListPane->GetFirstSelected()); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectNoNewWork - Function End")); } @@ -310,6 +324,9 @@ void CViewProjects::OnProjectAllowNewWork( wxCommandEvent& event ) { pDoc->ProjectAllowMoreWork(m_pListPane->GetFirstSelected()); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectAllowNewWork - Function End")); } @@ -351,6 +368,9 @@ void CViewProjects::OnProjectReset( wxCommandEvent& event ) { pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectReset - Function End")); } @@ -393,6 +413,9 @@ void CViewProjects::OnProjectDetach( wxCommandEvent& event ) { pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectDetach - Function End")); } @@ -430,10 +453,13 @@ void CViewProjects::OnProjectAttach( wxCommandEvent& event ) { pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectAttach - Function End")); } - + wxInt32 CViewProjects::GetDocCount() { CMainDocument* pDoc = wxGetApp().GetDocument(); @@ -444,6 +470,28 @@ wxInt32 CViewProjects::GetDocCount() { } +void CViewProjects::OnListSelected(wxListEvent& event) { + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnListSelected - Function Begin")); + + + + UpdateSelection(); + event.Skip(); + + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnListSelected - Function End")); +} + + +void CViewProjects::OnListDeselected(wxListEvent& event) { + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnListDeselected - Function Begin")); + + UpdateSelection(); + event.Skip(); + + wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnListDeselected - Function End")); +} + + wxString CViewProjects::OnListGetItemText(long item, long column) const { CProject* project = m_ProjectCache.at(item); wxString strBuffer = wxEmptyString; @@ -572,10 +620,10 @@ wxInt32 CViewProjects::UpdateCache(long item, long column, wxString& strNewData) void CViewProjects::UpdateSelection() { + // Update the tasks static box buttons CTaskItemGroup* pGroup = m_TaskGroups[0]; - if (m_pListPane->GetSelectedItemCount() == 0) { - pGroup->button(BTN_UPDATE)->Disable; + pGroup->button(BTN_UPDATE)->Disable(); pGroup->button(BTN_SUSPEND)->Disable(); pGroup->button(BTN_NOWORK)->Disable(); pGroup->button(BTN_RESET)->Disable(); @@ -607,10 +655,6 @@ void CViewProjects::UpdateSelection() { } } -void CViewProjects::UpdateTaskPane() { - -} - wxInt32 CViewProjects::FormatProjectName(wxInt32 item, wxString& strBuffer) const { CMainDocument* pDoc = wxGetApp().GetDocument(); diff --git a/clientgui/ViewProjects.h b/clientgui/ViewProjects.h index ed83b286c2..25e70e5075 100644 --- a/clientgui/ViewProjects.h +++ b/clientgui/ViewProjects.h @@ -71,6 +71,8 @@ protected: virtual wxInt32 GetDocCount(); + virtual void OnListSelected( wxListEvent& event ); + virtual void OnListDeselected( wxListEvent& event ); virtual wxString OnListGetItemText( long item, long column ) const; virtual wxString OnDocGetItemText( long item, long column ) const; @@ -82,7 +84,6 @@ protected: virtual wxInt32 UpdateCache( long item, long column, wxString& strNewData ); virtual void UpdateSelection(); - virtual void UpdateTaskPane(); wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const; wxInt32 FormatAccountName( wxInt32 item, wxString& strBuffer ) const; diff --git a/clientgui/ViewResources.cpp b/clientgui/ViewResources.cpp index f099017cc4..6d5ab10b10 100644 --- a/clientgui/ViewResources.cpp +++ b/clientgui/ViewResources.cpp @@ -52,6 +52,8 @@ CResource::~CResource() { IMPLEMENT_DYNAMIC_CLASS(CViewResources, CBOINCBaseView) BEGIN_EVENT_TABLE (CViewResources, CBOINCBaseView) + EVT_LIST_ITEM_SELECTED(ID_LIST_RESOURCEUTILIZATIONVIEW, CViewResources::OnListSelected) + EVT_LIST_ITEM_DESELECTED(ID_LIST_RESOURCEUTILIZATIONVIEW, CViewResources::OnListDeselected) END_EVENT_TABLE () @@ -72,7 +74,7 @@ CViewResources::CViewResources(wxNotebook* pNotebook) : // // Create Task Pane Items - m_pTaskPane->CreateTaskControls(); + m_pTaskPane->UpdateControls(); // Create List Pane Items m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, -1); @@ -192,10 +194,6 @@ void CViewResources::UpdateSelection() { } -void CViewResources::UpdateTaskPane() { -} - - wxInt32 CViewResources::FormatProjectName(wxInt32 item, wxString& strBuffer) const { CMainDocument* pDoc = wxGetApp().GetDocument(); diff --git a/clientgui/ViewResources.h b/clientgui/ViewResources.h index fb74541957..3b8a642116 100644 --- a/clientgui/ViewResources.h +++ b/clientgui/ViewResources.h @@ -68,7 +68,6 @@ protected: virtual wxInt32 UpdateCache( long item, long column, wxString& strNewData ); virtual void UpdateSelection(); - virtual void UpdateTaskPane(); wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const; wxInt32 FormatDiskSpace( wxInt32 item, wxString& strBuffer ) const; diff --git a/clientgui/ViewStatistics.cpp b/clientgui/ViewStatistics.cpp index 6747220194..a565aa9a13 100644 --- a/clientgui/ViewStatistics.cpp +++ b/clientgui/ViewStatistics.cpp @@ -265,6 +265,8 @@ BEGIN_EVENT_TABLE (CViewStatistics, CBOINCBaseView) EVT_BUTTON(ID_TASK_STATISTICS_USERAVERAGE, CViewStatistics::OnStatisticsUserAverage) EVT_BUTTON(ID_TASK_STATISTICS_HOSTTOTAL, CViewStatistics::OnStatisticsHostTotal) EVT_BUTTON(ID_TASK_STATISTICS_HOSTAVERAGE, CViewStatistics::OnStatisticsHostAverage) + EVT_LIST_ITEM_SELECTED(ID_LIST_STATISTICSVIEW, CViewStatistics::OnListSelected) + EVT_LIST_ITEM_DESELECTED(ID_LIST_STATISTICSVIEW, CViewStatistics::OnListDeselected) END_EVENT_TABLE () @@ -331,7 +333,7 @@ CViewStatistics::CViewStatistics(wxNotebook* pNotebook) : // Create Task Pane Items - m_pTaskPane->CreateTaskControls(); + m_pTaskPane->UpdateControls(); } CViewStatistics::~CViewStatistics() { @@ -358,6 +360,9 @@ void CViewStatistics::OnStatisticsUserTotal( wxCommandEvent& event ) { m_PaintStatistics->Refresh(); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewStatistics::OnStatisticsUserTotal - Function End")); } @@ -376,6 +381,9 @@ void CViewStatistics::OnStatisticsUserAverage( wxCommandEvent& event ) { m_PaintStatistics->Refresh(); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewStatistics::OnStatisticsUserAverage - Function End")); } @@ -394,6 +402,9 @@ void CViewStatistics::OnStatisticsHostTotal( wxCommandEvent& event ) { m_PaintStatistics->Refresh(); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewStatistics::OnStatisticsHostTotal - Function End")); } @@ -412,6 +423,9 @@ void CViewStatistics::OnStatisticsHostAverage( wxCommandEvent& event ) { m_PaintStatistics->Refresh(); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewStatistics::OnStatisticsHostAverage - Function End")); } @@ -458,5 +472,4 @@ void CViewStatistics::UpdateSelection() { } -void CViewStatistics::UpdateTaskPane() { -} +const char *BOINC_RCSID_7aadb93333 = "$Id$"; diff --git a/clientgui/ViewStatistics.h b/clientgui/ViewStatistics.h index 2c36bc7bb2..5b13939ccf 100644 --- a/clientgui/ViewStatistics.h +++ b/clientgui/ViewStatistics.h @@ -70,7 +70,6 @@ protected: virtual void OnListRender( wxTimerEvent& event ); virtual void UpdateSelection(); - virtual void UpdateTaskPane(); DECLARE_EVENT_TABLE() }; diff --git a/clientgui/ViewTransfers.cpp b/clientgui/ViewTransfers.cpp index dcd280fae9..44778697c6 100644 --- a/clientgui/ViewTransfers.cpp +++ b/clientgui/ViewTransfers.cpp @@ -70,6 +70,8 @@ IMPLEMENT_DYNAMIC_CLASS(CViewTransfers, CBOINCBaseView) BEGIN_EVENT_TABLE (CViewTransfers, CBOINCBaseView) EVT_BUTTON(ID_TASK_TRANSFERS_RETRYNOW, CViewTransfers::OnTransfersRetryNow) EVT_BUTTON(ID_TASK_TRANSFERS_ABORT, CViewTransfers::OnTransfersAbort) + EVT_LIST_ITEM_SELECTED(ID_LIST_TRANSFERSVIEW, CViewTransfers::OnListSelected) + EVT_LIST_ITEM_DESELECTED(ID_LIST_TRANSFERSVIEW, CViewTransfers::OnListDeselected) END_EVENT_TABLE () @@ -109,7 +111,7 @@ CViewTransfers::CViewTransfers(wxNotebook* pNotebook) : // Create Task Pane Items - m_pTaskPane->CreateTaskControls(); + m_pTaskPane->UpdateControls(); // Create List Pane Items m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 125); @@ -155,6 +157,9 @@ void CViewTransfers::OnTransfersRetryNow( wxCommandEvent& event ) { pDoc->TransferRetryNow(m_pListPane->GetFirstSelected()); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewTransfers::OnTransfersRetryNow - Function End")); } @@ -197,6 +202,9 @@ void CViewTransfers::OnTransfersAbort( wxCommandEvent& event ) { pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewTransfers::OnTransfersAbort - Function End")); } @@ -342,10 +350,6 @@ void CViewTransfers::UpdateSelection() { } -void CViewTransfers::UpdateTaskPane() { -} - - wxInt32 CViewTransfers::FormatProjectName(wxInt32 item, wxString& strBuffer) const { CMainDocument* pDoc = wxGetApp().GetDocument(); diff --git a/clientgui/ViewTransfers.h b/clientgui/ViewTransfers.h index ea4d26676b..7e98a3cdf4 100644 --- a/clientgui/ViewTransfers.h +++ b/clientgui/ViewTransfers.h @@ -76,7 +76,6 @@ protected: virtual wxInt32 UpdateCache( long item, long column, wxString& strNewData ); virtual void UpdateSelection(); - virtual void UpdateTaskPane(); wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const; wxInt32 FormatFileName( wxInt32 item, wxString& strBuffer ) const; diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index 48005a62a2..adc3ac93fa 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -74,6 +74,8 @@ BEGIN_EVENT_TABLE (CViewWork, CBOINCBaseView) EVT_BUTTON(ID_TASK_WORK_RESUME, CViewWork::OnWorkResume) EVT_BUTTON(ID_TASK_WORK_SHOWGRAPHICS, CViewWork::OnWorkShowGraphics) EVT_BUTTON(ID_TASK_WORK_ABORT, CViewWork::OnWorkAbort) + EVT_LIST_ITEM_SELECTED(ID_LIST_WORKVIEW, CViewWork::OnListSelected) + EVT_LIST_ITEM_DESELECTED(ID_LIST_WORKVIEW, CViewWork::OnListDeselected) END_EVENT_TABLE () @@ -127,7 +129,7 @@ CViewWork::CViewWork(wxNotebook* pNotebook) : // Create Task Pane Items - m_pTaskPane->CreateTaskControls(); + m_pTaskPane->UpdateControls(); // Create List Pane Items m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 125); @@ -174,6 +176,9 @@ void CViewWork::OnWorkSuspend( wxCommandEvent& event ) { pDoc->WorkSuspend(m_pListPane->GetFirstSelected()); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkSuspend - Function End")); } @@ -195,6 +200,9 @@ void CViewWork::OnWorkResume( wxCommandEvent& event ) { pDoc->WorkResume(m_pListPane->GetFirstSelected()); pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkResume - Function End")); } @@ -245,6 +253,9 @@ void CViewWork::OnWorkShowGraphics( wxCommandEvent& event ) { pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkShowGraphics - Function End")); } @@ -285,6 +296,9 @@ void CViewWork::OnWorkAbort( wxCommandEvent& event ) { pFrame->UpdateStatusText(wxT("")); + UpdateSelection(); + pFrame->ProcessRefreshView(); + wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkAbort - Function End")); } @@ -439,10 +453,6 @@ void CViewWork::UpdateSelection() { } -void CViewWork::UpdateTaskPane() { -} - - wxInt32 CViewWork::FormatProjectName(wxInt32 item, wxString& strBuffer) const { CMainDocument* pDoc = wxGetApp().GetDocument(); diff --git a/clientgui/ViewWork.h b/clientgui/ViewWork.h index 609c8ba248..6051398829 100644 --- a/clientgui/ViewWork.h +++ b/clientgui/ViewWork.h @@ -79,7 +79,6 @@ protected: virtual wxInt32 UpdateCache( long item, long column, wxString& strNewData ); virtual void UpdateSelection(); - virtual void UpdateTaskPane(); wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const; wxInt32 FormatApplicationName( wxInt32 item, wxString& strBuffer ) const;