diff --git a/clientgui/Events.h b/clientgui/Events.h index b7e5157541..371b301cf8 100644 --- a/clientgui/Events.h +++ b/clientgui/Events.h @@ -38,12 +38,13 @@ #define ID_NETWORKRUNALWAYS 6009 #define ID_NETWORKRUNBASEDONPREPERENCES 6010 #define ID_NETWORKSUSPEND 6011 -#define ID_TB_ACTIVITYRUNALWAYS 6012 -#define ID_TB_ACTIVITYRUNBASEDONPREPERENCES 6013 -#define ID_TB_ACTIVITYSUSPEND 6014 -#define ID_TB_NETWORKRUNALWAYS 6015 -#define ID_TB_NETWORKRUNBASEDONPREPERENCES 6016 -#define ID_TB_NETWORKSUSPEND 6017 +#define ID_RUNBENCHMARKS 6012 +#define ID_TB_ACTIVITYRUNALWAYS 6013 +#define ID_TB_ACTIVITYRUNBASEDONPREPERENCES 6014 +#define ID_TB_ACTIVITYSUSPEND 6015 +#define ID_TB_NETWORKRUNALWAYS 6016 +#define ID_TB_NETWORKRUNBASEDONPREPERENCES 6017 +#define ID_TB_NETWORKSUSPEND 6018 #define ID_LIST_BASE 7000 #define ID_LIST_PROJECTSVIEW 7000 #define ID_LIST_WORKVIEW 7001 diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 6c6d918d55..6e512268c1 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -254,6 +254,12 @@ wxInt32 CMainDocument::SetNetworkRunMode( wxInt32 iMode ) } +wxInt32 CMainDocument::RunBenchmarks() +{ + return rpc.run_benchmarks(); +} + + wxInt32 CMainDocument::CachedProjectStatusUpdate() { wxInt32 retval = 0; diff --git a/clientgui/MainDocument.h b/clientgui/MainDocument.h index d5eaea1f4e..f6f3738c7b 100644 --- a/clientgui/MainDocument.h +++ b/clientgui/MainDocument.h @@ -100,6 +100,9 @@ public: wxInt32 SetNetworkRunMode( wxInt32 iMode ); + wxInt32 RunBenchmarks(); + + // // Project Tab // diff --git a/clientgui/MainFrame.cpp b/clientgui/MainFrame.cpp index b8a29cd44a..4fb3c1b9f9 100644 --- a/clientgui/MainFrame.cpp +++ b/clientgui/MainFrame.cpp @@ -47,6 +47,7 @@ BEGIN_EVENT_TABLE (CMainFrame, wxFrame) EVT_MENU(ID_HIDE, CMainFrame::OnHide) EVT_MENU_RANGE(ID_ACTIVITYRUNALWAYS, ID_ACTIVITYSUSPEND, CMainFrame::OnActivitySelection) EVT_MENU_RANGE(ID_NETWORKRUNALWAYS, ID_NETWORKSUSPEND, CMainFrame::OnNetworkSelection) + EVT_MENU(ID_RUNBENCHMARKS, CMainFrame::OnRunBenchmarks) EVT_MENU(wxID_EXIT, CMainFrame::OnExit) EVT_MENU(ID_TOOLSOPTIONS, CMainFrame::OnToolsOptions) EVT_MENU(wxID_ABOUT, CMainFrame::OnAbout) @@ -172,6 +173,14 @@ bool CMainFrame::CreateMenu() menuFile->AppendSeparator(); + menuFile->Append( + ID_RUNBENCHMARKS, + _("Run &Benchmarks"), + _("Runs the CPU Benchmarks for BOINC") + ); + + menuFile->AppendSeparator(); + menuFile->Append( wxID_EXIT, _("E&xit"), @@ -520,6 +529,18 @@ void CMainFrame::OnNetworkSelection( wxCommandEvent& event ) } +void CMainFrame::OnRunBenchmarks( wxCommandEvent& WXUNUSED(event) ) +{ + CMainDocument* pDoc = wxGetApp().GetDocument(); + wxASSERT(NULL != m_pNotebook); + wxASSERT(NULL != pDoc); + wxASSERT(wxDynamicCast(pDoc, CMainDocument)); + + m_pNotebook->SetSelection( ID_LIST_MESSAGESVIEW - ID_LIST_BASE ); + pDoc->RunBenchmarks(); +} + + void CMainFrame::OnExit( wxCommandEvent& WXUNUSED(event) ) { Close(true); diff --git a/clientgui/MainFrame.h b/clientgui/MainFrame.h index b7271775eb..c6568bc71d 100644 --- a/clientgui/MainFrame.h +++ b/clientgui/MainFrame.h @@ -45,6 +45,7 @@ public: void OnHide( wxCommandEvent& event ); void OnActivitySelection( wxCommandEvent& event ); void OnNetworkSelection( wxCommandEvent& event ); + void OnRunBenchmarks( wxCommandEvent& event ); void OnExit( wxCommandEvent& event ); void OnToolsOptions( wxCommandEvent& event );