Skip to content

Commit

Permalink
MGR: Eliminate Grid Views. NOTE: The Grid View source files still sho…
Browse files Browse the repository at this point in the history
…uld be removed from Windows project and makefiles for Linux, etc. and possibly from SVN trunk.

svn path=/workspaces/charlief/; revision=15689
  • Loading branch information
Charlie Fenton committed Jul 27, 2008
1 parent 1830e05 commit 0bc22ed
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 158 deletions.
15 changes: 15 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -6062,7 +6062,22 @@ Charlie 26 July 2008
windows caused by wxSafeYield() disabling the controls.
Increase delay before displaying Please Wait dialog from 250
to 1250 milliseconds.
- MGR: Eliminate Grid Views.
NOTE: The Grid View source files still should be removed from Windows
project and makefiles for Linux, etc. and possibly from SVN trunk.

clientgui/
AdvancedFrame.cpp,.h
AsyncRPC.cpp,h
BOINCGridCtrl.cpp,.h (removed from XCode project)
BOINCGUIApp.cpp,.h
BOINCBaseView.cpp,.h
Events.h
MainDocument.cpp,.h
ViewMessagesGrid.cpp,.h (removed from XCode project)
ViewProjectsGrid.cpp,.h (removed from XCode project)
ViewTransfersGrid.cpp,.h (removed from XCode project)
ViewWorkGrid.cpp,.h (removed from XCode project)
mac_build/
boinc.xcodeproj/
project.pbxproj
89 changes: 11 additions & 78 deletions clientgui/AdvancedFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@
#include "BOINCTaskBar.h"
#include "BOINCDialupManager.h"
#include "AdvancedFrame.h"
#include "ViewProjectsGrid.h"
#include "ViewProjects.h"
#include "ViewWorkGrid.h"
#include "ViewWork.h"
#include "ViewTransfersGrid.h"
#include "ViewTransfers.h"
#include "ViewMessagesGrid.h"
#include "ViewMessages.h"
#include "ViewStatistics.h"
#include "ViewResources.h"
Expand All @@ -68,8 +64,7 @@

// Which of the view sets should we display.
//
#define VIEW_GRID 1
#define VIEW_LIST 2
//#define VIEW_LIST 2


enum STATUSBARFIELDS {
Expand Down Expand Up @@ -169,7 +164,6 @@ BEGIN_EVENT_TABLE (CAdvancedFrame, CBOINCBaseFrame)
EVT_MENU(ID_FILERUNBENCHMARKS, CAdvancedFrame::OnRunBenchmarks)
EVT_MENU(ID_FILESELECTCOMPUTER, CAdvancedFrame::OnSelectComputer)
EVT_MENU(ID_SHUTDOWNCORECLIENT, CAdvancedFrame::OnClientShutdown)
EVT_MENU_RANGE(ID_VIEWACCESSIBLE, ID_VIEWGRID, CAdvancedFrame::OnSwitchView)
EVT_MENU(ID_FILESWITCHGUI, CAdvancedFrame::OnSwitchGUI)
EVT_MENU(ID_READ_PREFS, CAdvancedFrame::Onread_prefs)
EVT_MENU(ID_READ_CONFIG, CAdvancedFrame::Onread_config)
Expand Down Expand Up @@ -218,7 +212,6 @@ CAdvancedFrame::CAdvancedFrame(wxString title, wxIcon* icon, wxIcon* icon32) :
// Working Variables
m_strBaseTitle = title;
m_bDisplayShutdownClientWarning = true;
m_iDisplayViewType = VIEW_GRID;

// Initialize Application
wxIconBundle icons;
Expand All @@ -229,16 +222,6 @@ CAdvancedFrame::CAdvancedFrame(wxString title, wxIcon* icon, wxIcon* icon32) :
// Restore main application frame settings
RestoreState();

// Screen reader in use? If so, force the list view so that they
// can still use us.
#ifdef __WXMSW__
BOOL bScreenReaderEnabled = false;
SystemParametersInfo(SPI_GETSCREENREADER, NULL, &bScreenReaderEnabled, NULL);
if (bScreenReaderEnabled) {
m_iDisplayViewType = VIEW_LIST;
}
#endif

// Create UI elements
wxCHECK_RET(CreateMenu(), _T("Failed to create menu bar."));
wxCHECK_RET(CreateNotebook(), _T("Failed to create notebook."));
Expand Down Expand Up @@ -358,15 +341,9 @@ bool CAdvancedFrame::CreateMenu() {
wxMenu *menuView = new wxMenu;

menuView->AppendRadioItem(
ID_VIEWACCESSIBLE,
_("&Accessible View"),
_("Accessible views are compatible with accessibility aids such as screen readers.")
);

menuView->AppendRadioItem(
ID_VIEWGRID,
_("&Grid View"),
_("Grid views allow you to sort various columns and displays graphical progress bars.")
ID_VIEWLIST,
_("&Advanced View"),
_("Advanced views allow you to sort various columns and displays graphical progress bars.")
);

menuView->Append(
Expand All @@ -379,10 +356,6 @@ bool CAdvancedFrame::CreateMenu() {
if (wxGetDisplaySize().GetHeight() < 600) {
menuView->Enable(ID_FILESWITCHGUI, false);
}

menuView->Check(ID_VIEWACCESSIBLE, VIEW_LIST == m_iDisplayViewType);
menuView->Check(ID_VIEWGRID, VIEW_GRID == m_iDisplayViewType);


// Tools menu
wxMenu *menuTools = new wxMenu;
Expand Down Expand Up @@ -698,22 +671,12 @@ bool CAdvancedFrame::RepopulateNotebook() {
DeleteNotebook();

// Create the various notebook pages
if ( VIEW_GRID == m_iDisplayViewType ) {
CreateNotebookPage(new CViewProjectsGrid(m_pNotebook));
CreateNotebookPage(new CViewWorkGrid(m_pNotebook));
CreateNotebookPage(new CViewTransfersGrid(m_pNotebook));
CreateNotebookPage(new CViewMessages(m_pNotebook));
CreateNotebookPage(new CViewStatistics(m_pNotebook));
CreateNotebookPage(new CViewResources(m_pNotebook));
} else {
CreateNotebookPage(new CViewProjects(m_pNotebook));
CreateNotebookPage(new CViewWork(m_pNotebook));
CreateNotebookPage(new CViewTransfers(m_pNotebook));
CreateNotebookPage(new CViewMessages(m_pNotebook));
CreateNotebookPage(new CViewStatistics(m_pNotebook));
CreateNotebookPage(new CViewResources(m_pNotebook));
}

CreateNotebookPage(new CViewProjects(m_pNotebook));
CreateNotebookPage(new CViewWork(m_pNotebook));
CreateNotebookPage(new CViewTransfers(m_pNotebook));
CreateNotebookPage(new CViewMessages(m_pNotebook));
CreateNotebookPage(new CViewStatistics(m_pNotebook));
CreateNotebookPage(new CViewResources(m_pNotebook));

wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::RepopulateNotebook - Function End"));
return true;
Expand Down Expand Up @@ -834,7 +797,6 @@ bool CAdvancedFrame::SaveState() {
pConfig->SetPath(strBaseConfigLocation);

pConfig->Write(wxT("DisplayShutdownClientWarning"), m_bDisplayShutdownClientWarning);
pConfig->Write(wxT("DisplayViewType"), m_iDisplayViewType);


#ifdef __WXMAC__
Expand Down Expand Up @@ -934,7 +896,6 @@ bool CAdvancedFrame::RestoreState() {
pConfig->SetPath(strBaseConfigLocation);

pConfig->Read(wxT("DisplayShutdownClientWarning"), &m_bDisplayShutdownClientWarning, true);
pConfig->Read(wxT("DisplayViewType"), &m_iDisplayViewType, VIEW_GRID);

#ifdef __WXMAC__
RestoreWindowDimensions();
Expand Down Expand Up @@ -1302,33 +1263,6 @@ void CAdvancedFrame::Onread_config(wxCommandEvent& WXUNUSED(event)) {
}


void CAdvancedFrame::OnSwitchView(wxCommandEvent& event) {
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::OnSwitchView - Function Begin"));

switch(event.GetId()) {
case ID_VIEWACCESSIBLE:
m_iDisplayViewType = VIEW_LIST;
break;
case ID_VIEWGRID:
default:
m_iDisplayViewType = VIEW_GRID;
break;
}

// Save the current view state
SaveViewState();

// Delete the old pages and then create/display the new pages.
RepopulateNotebook();

// Restore the current view state settings to the newly
// constructed views.
RestoreViewState();

wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::OnSwitchView - Function End"));
}


void CAdvancedFrame::OnSwitchGUI(wxCommandEvent& WXUNUSED(event)) {
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::OnSwitchGUI - Function Begin"));

Expand Down Expand Up @@ -1559,7 +1493,6 @@ void CAdvancedFrame::OnOptionsOptions(wxCommandEvent& WXUNUSED(event)) {
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));

pDoc->TestAsyncRPC(); return; // TEMPORARY FOR TESTING ASYNC RPCs -- CAF

// General Tab
dlg.m_LanguageSelectionCtrl->Append(wxGetApp().GetSupportedLanguages());
Expand Down Expand Up @@ -1938,7 +1871,7 @@ void CAdvancedFrame::OnFrameRender(wxTimerEvent &event) {
wxMenuBar* pMenuBar = GetMenuBar();

if (wxGetApp().ProcessingRPC) return; // TEMPORARY UNTIL PERIODIC ASYNC RPCs IMPLEMENTED -- CAF

if (!bAlreadyRunningLoop && m_pFrameRenderTimer->IsRunning()) {
bAlreadyRunningLoop = true;

Expand Down
3 changes: 1 addition & 2 deletions clientgui/AdvancedFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class CAdvancedFrame : public CBOINCBaseFrame

~CAdvancedFrame(void);

void OnSwitchView( wxCommandEvent& event );
void OnSwitchGUI( wxCommandEvent& event );

void OnActivitySelection( wxCommandEvent& event );
Expand Down Expand Up @@ -87,6 +86,7 @@ class CAdvancedFrame : public CBOINCBaseFrame
void OnListPanelRender( wxTimerEvent& event );

void OnNotebookSelectionChanged( wxNotebookEvent& event );
int GetViewTabIndex() { return m_pNotebook->GetSelection(); }

void OnRefreshView( CFrameEvent& event );
void OnConnect( CFrameEvent& event );
Expand All @@ -105,7 +105,6 @@ class CAdvancedFrame : public CBOINCBaseFrame
CStatusBar* m_pStatusbar;

bool m_bDisplayShutdownClientWarning;
wxInt32 m_iDisplayViewType;

wxString m_strBaseTitle;

Expand Down
25 changes: 0 additions & 25 deletions clientgui/BOINCBaseView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,31 +379,6 @@ wxListItemAttr* CBOINCBaseView::OnListGetItemAttr(long WXUNUSED(item)) const {
}


void CBOINCBaseView::OnGridSelectCell( wxGridEvent& event ) {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnGridSelectCell - Function Begin"));

if (!m_bIgnoreUIEvents) {
m_bForceUpdateSelection = true;
UpdateSelection();
event.Skip();
}

wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnGridSelectCell - Function End"));
}

void CBOINCBaseView::OnGridSelectRange( wxGridRangeSelectEvent& event ) {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnGridSelectRange - Function Begin"));

if (!m_bIgnoreUIEvents) {
m_bForceUpdateSelection = true;
UpdateSelection();
event.Skip();
}

wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnGridSelectRange - Function End"));
}


int CBOINCBaseView::GetDocCount() {
return 0;
}
Expand Down
3 changes: 0 additions & 3 deletions clientgui/BOINCBaseView.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ class CBOINCBaseView : public wxPanel {

void OnColClick(wxListEvent& event);

virtual void OnGridSelectCell( wxGridEvent& event );
virtual void OnGridSelectRange( wxGridRangeSelectEvent& event );

virtual int GetDocCount();
virtual wxString OnDocGetItemImage( long item ) const;
virtual wxString OnDocGetItemAttr( long item ) const;
Expand Down
24 changes: 23 additions & 1 deletion clientgui/BOINCGUIApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ bool CBOINCGUIApp::OnInit() {
BOINC_DIAG_MEMORYLEAKCHECKENABLED |
#if defined(__WXMSW__) || defined(__WXMAC__)
BOINC_DIAG_REDIRECTSTDERR |
// TEMPORARY FOR TESTING ASYNC RPCs -- CAF BOINC_DIAG_REDIRECTSTDOUT |
BOINC_DIAG_REDIRECTSTDOUT |
#endif
BOINC_DIAG_TRACETOSTDOUT;

Expand Down Expand Up @@ -733,6 +733,28 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
}


int CBOINCGUIApp::GetCurrentViewPage() {
if (m_iGUISelected == BOINC_SIMPLEGUI) return VW_SGUI;

switch (((CAdvancedFrame*)m_pFrame)->GetViewTabIndex()) {
case 0:
return VW_PROJ;
case 1:
return VW_TASK;
case 2:
return VW_XFER;
case 3:
return VW_MSGS;
case 4:
return VW_STAT;
case 5:
return VW_DISK;
}

return 0; // Should never happen.
}


int CBOINCGUIApp::ConfirmExit() {
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
CMainDocument* pDoc = wxGetApp().GetDocument();
Expand Down
11 changes: 11 additions & 0 deletions clientgui/BOINCGUIApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
#define BOINC_ADVANCEDGUI 1
#define BOINC_SIMPLEGUI 2

// Bit values for CBOINCGUIApp::GetCurrentView() and
// CMainDocument::RunPeriodicRPCs()
#define VW_PROJ 1
#define VW_TASK 2
#define VW_XFER 4
#define VW_MSGS 8
#define VW_STAT 16
#define VW_DISK 32
#define VW_SGUI 1024


class wxLogBOINC;
class CBOINCBaseFrame;
Expand Down Expand Up @@ -124,6 +134,7 @@ class CBOINCGUIApp : public wxApp {
void FireReloadSkin();

bool SetActiveGUI(int iGUISelection, bool bShowWindow = true);
int GetCurrentViewPage();

virtual void OnRPCFinished( CRPCFinishedEvent& event );
bool ProcessingRPC; // TEMPORARY UNTIL PERIODIC ASYNC RPCs IMPLEMENTED -- CAF
Expand Down
11 changes: 1 addition & 10 deletions clientgui/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
#define ID_ADVPREFSDLG 6033
#define ID_SHUTDOWNCORECLIENT 6034
#define ID_HELPBOINC 6035
#define ID_VIEWACCESSIBLE 6036
#define ID_VIEWGRID 6037
#define ID_VIEWLIST 6036
#define ID_PERIODICRPCTIMER 6050
#define ID_SIMPLEFRAME 6100
#define ID_SIMPLEMESSAGECHECKTIMER 6101
Expand All @@ -81,21 +80,13 @@
#define ID_LIST_RESOURCEUTILIZATIONVIEW 7004
#define ID_LIST_STATISTICSVIEW 7005
#define ID_LIST_RESOURCEUTILIZATIONVIEWTOTAL 7006
#define ID_LIST_WORKGRIDVIEW 7007
#define ID_LIST_TRANSFERSGRIDVIEW 7008
#define ID_LIST_PROJECTSGRIDVIEW 7009
#define ID_LIST_MESSAGESGRIDVIEW 7010
#define ID_TASK_BASE 8000
#define ID_TASK_PROJECTSVIEW 8000
#define ID_TASK_WORKVIEW 8001
#define ID_TASK_TRANSFERSVIEW 8002
#define ID_TASK_MESSAGESVIEW 8003
#define ID_TASK_STATISTICSVIEW 8004
#define ID_TASK_RESOURCEUTILIZATIONVIEW 8005
#define ID_TASK_WORKGRIDVIEW 8006
#define ID_TASK_TRANSFERSGRIDVIEW 8007
#define ID_TASK_PROJECTSGRIDVIEW 8008
#define ID_TASK_MESSAGESGRIDVIEW 8009
#define ID_TASK_PROJECT_UPDATE 9000
#define ID_TASK_PROJECT_SUSPEND 9002
#define ID_TASK_PROJECT_RESUME 9003
Expand Down
5 changes: 3 additions & 2 deletions clientgui/MainDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@ void CMainDocument::RunPeriodicRPCs() {
wxDateTime dtNow(wxDateTime::Now());
// int retval = 0;

int currentTabView = wxGetApp().GetCurrentViewPage();

if (!IsConnected()) return;

// *********** RPC_GET_CC_STATUS **************
Expand Down Expand Up @@ -1062,7 +1064,6 @@ int CMainDocument::CachedResultsStatusUpdate() {
m_dtResultsTimestamp = wxDateTime::Now();

iRetVal = rpc.get_results(results);
//iRetVal = m_iGet_results_RPC_retval;
if (iRetVal) {
wxLogTrace(wxT("Function Status"), wxT("CMainDocument::CachedResultsStatusUpdate - Get Result Status Failed '%d'"), iRetVal);
ForceCacheUpdate();
Expand Down Expand Up @@ -1215,7 +1216,7 @@ void CMainDocument::KillInactiveGraphicsApps()
// If none of the Tasks displays are visible, we need to update
// the results vector. This call does nothing if recently updated
// by a call from CViewWork, CViewWorkGrid or CViewTabPage.
// by a call from CViewWork or CViewTabPage.
CachedResultsStatusUpdate();
gfx_app_iter = m_running_gfx_apps.begin();
Expand Down
Loading

0 comments on commit 0bc22ed

Please sign in to comment.