2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-01-20 23:22:22 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2023-06-15 14:01:20 +00:00
|
|
|
// Copyright (C) 2023 University of California
|
2004-05-17 22:15:10 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2004-04-10 09:11:03 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-01-20 23:22:22 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
2004-05-17 22:15:10 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2004-05-17 22:15:10 +00:00
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#ifndef BOINC_BOINCBASEVIEW_H
|
|
|
|
#define BOINC_BOINCBASEVIEW_H
|
2004-04-11 04:37:10 +00:00
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
2004-09-21 01:30:29 +00:00
|
|
|
#pragma interface "BOINCBaseView.cpp"
|
2004-04-11 04:37:10 +00:00
|
|
|
#endif
|
|
|
|
|
2014-05-22 02:11:22 +00:00
|
|
|
|
2019-02-09 12:11:56 +00:00
|
|
|
#define DEFAULT_TASK_FLAGS wxTAB_TRAVERSAL | wxFULL_REPAINT_ON_RESIZE
|
2014-04-05 06:11:48 +00:00
|
|
|
#define DEFAULT_LIST_FLAGS wxLC_REPORT | wxLC_VIRTUAL | wxLC_HRULES
|
2004-10-26 01:59:44 +00:00
|
|
|
|
2004-12-23 01:06:41 +00:00
|
|
|
class CBOINCTaskCtrl;
|
|
|
|
class CBOINCListCtrl;
|
2014-05-22 02:11:22 +00:00
|
|
|
class CCheckSelectionChangedEvent;
|
2012-02-08 01:53:19 +00:00
|
|
|
struct PROJECT;
|
2006-01-09 14:03:13 +00:00
|
|
|
|
2004-12-23 01:06:41 +00:00
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
class CTaskItem : wxObject {
|
2005-04-08 06:24:58 +00:00
|
|
|
public:
|
2005-04-20 22:22:41 +00:00
|
|
|
CTaskItem();
|
|
|
|
CTaskItem( wxString strName, wxString strDescription, wxInt32 iEventID ) :
|
2005-11-04 01:35:57 +00:00
|
|
|
m_strName(strName), m_strDescription(strDescription), m_iEventID(iEventID),
|
|
|
|
m_pButton(NULL), m_strWebSiteLink(wxT("")) {};
|
2005-04-27 06:32:40 +00:00
|
|
|
CTaskItem( wxString strName, wxString strDescription, wxString strWebSiteLink, wxInt32 iEventID ) :
|
2023-05-05 18:05:20 +00:00
|
|
|
m_strName(strName), m_strDescription(strDescription), m_iEventID(iEventID),
|
2005-11-04 01:35:57 +00:00
|
|
|
m_pButton(NULL), m_strWebSiteLink(strWebSiteLink) {};
|
2005-04-20 22:22:41 +00:00
|
|
|
~CTaskItem() {};
|
|
|
|
|
|
|
|
wxString m_strName;
|
2012-01-25 11:51:31 +00:00
|
|
|
wxString m_strNameEllipsed;
|
2005-04-20 22:22:41 +00:00
|
|
|
wxString m_strDescription;
|
|
|
|
wxInt32 m_iEventID;
|
|
|
|
|
2008-06-27 04:34:47 +00:00
|
|
|
wxButton* m_pButton;
|
2005-04-21 23:14:10 +00:00
|
|
|
wxString m_strWebSiteLink;
|
2005-04-20 22:22:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CTaskItemGroup : wxObject {
|
|
|
|
public:
|
|
|
|
CTaskItemGroup();
|
|
|
|
CTaskItemGroup( wxString strName ) :
|
2009-11-25 12:43:22 +00:00
|
|
|
m_strName(strName), m_pStaticBox(NULL), m_pStaticBoxSizer(NULL) {
|
|
|
|
m_Tasks.clear();
|
|
|
|
};
|
2013-10-24 12:49:59 +00:00
|
|
|
~CTaskItemGroup() {};
|
2005-04-21 22:21:54 +00:00
|
|
|
wxButton* button(int i) {return m_Tasks[i]->m_pButton;}
|
2005-04-20 22:22:41 +00:00
|
|
|
|
|
|
|
wxString m_strName;
|
|
|
|
|
|
|
|
wxStaticBox* m_pStaticBox;
|
|
|
|
wxStaticBoxSizer* m_pStaticBoxSizer;
|
|
|
|
|
2009-11-25 12:43:22 +00:00
|
|
|
std::vector<CTaskItem*> m_Tasks;
|
2005-04-08 06:24:58 +00:00
|
|
|
};
|
|
|
|
|
2008-07-08 15:13:34 +00:00
|
|
|
typedef bool (*ListSortCompareFunc)(int, int);
|
2008-06-26 01:25:31 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2012-01-06 23:37:40 +00:00
|
|
|
class CBOINCBaseView : public wxPanel {
|
2004-09-21 01:30:29 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS( CBOINCBaseView )
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
public:
|
2004-12-02 07:43:47 +00:00
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
CBOINCBaseView();
|
2004-10-27 21:10:22 +00:00
|
|
|
CBOINCBaseView(
|
2005-09-06 06:18:36 +00:00
|
|
|
wxNotebook* pNotebook
|
2005-07-21 09:43:40 +00:00
|
|
|
);
|
|
|
|
CBOINCBaseView(
|
|
|
|
wxNotebook* pNotebook,
|
2005-04-20 22:22:41 +00:00
|
|
|
wxWindowID iTaskWindowID,
|
|
|
|
int iTaskWindowFlags,
|
2004-10-27 21:10:22 +00:00
|
|
|
wxWindowID iListWindowID,
|
2005-04-21 06:04:26 +00:00
|
|
|
int iListWindowFlags
|
2004-10-27 21:10:22 +00:00
|
|
|
);
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
~CBOINCBaseView();
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-09-02 21:03:36 +00:00
|
|
|
virtual wxString& GetViewName();
|
- fixes #207 - HTML entities in BOINC Manager have to be decoded
BOINC Manager can now properly decode HTML entites for the
following elements:
Projects Tab:
Project Name
User Name
Team Name
Work Tab:
Project Name
Application Name
Transfers Tab:
Project Name
Messages Tab:
Project Name
Disk Tab:
Project Name
- fixes #212 - Info in columns misaligned on switching views
- Properly restore which tab view the user left from when going
to the advanced view from the simple view
- Fix the problem that caused the manager to wait for 7 seconds
to display anything on initial startup.
- Store the various Grid/List persisted data seperately so that
the different header sizes don't cause problems.
clientgui/
AdvancedFrame.cpp
BOINCBaseView.cpp, .h
BOINCGridCtrl.cpp
ViewMessages.cpp, .h
ViewMessagesGrid.cpp, .h
ViewProjects.cpp, .h
ViewProjectsGrid.cpp, .h
ViewResources.cpp, .h
ViewStatistics.cpp, .h
ViewTransfers.cpp, .h
ViewTransfersGrid.cpp, .h
ViewWork.cpp, .h
ViewWorkGrid.cpp, .h
lib/
gui_rpc_client_ops.C
svn path=/trunk/boinc/; revision=12761
2007-05-29 05:07:35 +00:00
|
|
|
virtual wxString& GetViewDisplayName();
|
2005-04-06 20:40:19 +00:00
|
|
|
virtual const char** GetViewIcon();
|
2013-02-07 18:26:02 +00:00
|
|
|
virtual int GetViewRefreshRate();
|
|
|
|
virtual int GetViewCurrentViewPage();
|
2009-12-22 01:22:11 +00:00
|
|
|
|
2008-09-04 13:00:24 +00:00
|
|
|
virtual wxString GetKeyValue1(int iRowIndex);
|
|
|
|
virtual wxString GetKeyValue2(int iRowIndex);
|
|
|
|
virtual int FindRowIndexByKeyValues(wxString& key1, wxString& key2);
|
2004-07-13 05:56:03 +00:00
|
|
|
|
2004-12-02 07:43:47 +00:00
|
|
|
bool FireOnSaveState( wxConfigBase* pConfig );
|
|
|
|
bool FireOnRestoreState( wxConfigBase* pConfig );
|
2005-04-20 22:22:41 +00:00
|
|
|
|
|
|
|
virtual int GetListRowCount();
|
|
|
|
void FireOnListRender( wxTimerEvent& event );
|
2004-12-02 07:43:47 +00:00
|
|
|
void FireOnListSelected( wxListEvent& event );
|
|
|
|
void FireOnListDeselected( wxListEvent& event );
|
|
|
|
wxString FireOnListGetItemText( long item, long column ) const;
|
|
|
|
int FireOnListGetItemImage( long item ) const;
|
2010-03-05 07:04:58 +00:00
|
|
|
|
2008-06-24 10:52:12 +00:00
|
|
|
int GetProgressColumn() { return m_iProgressColumn; }
|
2014-12-11 14:18:47 +00:00
|
|
|
void SetProgressColumn(int col) { m_iProgressColumn = col; }
|
2008-06-24 10:52:12 +00:00
|
|
|
virtual double GetProgressValue(long item);
|
2008-10-06 11:33:28 +00:00
|
|
|
virtual wxString GetProgressText( long item);
|
2014-12-11 14:18:47 +00:00
|
|
|
virtual void AppendColumn(int columnID);
|
2023-05-05 18:05:20 +00:00
|
|
|
|
2014-12-11 14:18:47 +00:00
|
|
|
void InitSort();
|
|
|
|
void SetSortColumn(int newSortColIndex);
|
2008-09-04 13:00:24 +00:00
|
|
|
void SaveSelections();
|
|
|
|
void RestoreSelections();
|
|
|
|
void ClearSavedSelections();
|
|
|
|
void ClearSelections();
|
2008-12-05 01:13:16 +00:00
|
|
|
void RefreshTaskPane();
|
2023-05-05 18:05:20 +00:00
|
|
|
|
2009-10-29 11:13:48 +00:00
|
|
|
CBOINCListCtrl* GetListCtrl() { return m_pListPane; }
|
2023-05-05 18:05:20 +00:00
|
|
|
|
2014-12-05 12:37:07 +00:00
|
|
|
#ifdef __WXMAC__
|
2014-03-31 12:12:10 +00:00
|
|
|
void OnKeyPressed(wxKeyEvent &event);
|
2023-05-05 18:05:20 +00:00
|
|
|
#endif
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
std::vector<CTaskItemGroup*> m_TaskGroups;
|
2005-04-06 20:40:19 +00:00
|
|
|
|
2014-12-11 14:18:47 +00:00
|
|
|
int m_iSortColumnID; // ColumnID of sort column
|
2008-06-25 13:12:39 +00:00
|
|
|
bool m_bReverseSort;
|
2014-12-04 14:01:15 +00:00
|
|
|
wxArrayString* m_aStdColNameOrder;
|
2014-12-11 14:18:47 +00:00
|
|
|
wxArrayInt m_iStdColWidthOrder;
|
|
|
|
wxArrayInt m_iColumnIndexToColumnID;
|
|
|
|
wxArrayInt m_iColumnIDToColumnIndex;
|
2014-12-15 05:47:37 +00:00
|
|
|
int* m_iDefaultShownColumns;
|
|
|
|
int m_iNumDefaultShownColumns;
|
2014-12-11 14:18:47 +00:00
|
|
|
|
2023-05-05 18:05:20 +00:00
|
|
|
|
2008-09-04 13:00:24 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
wxArrayString m_arrSelectedKeys1; //array for remembering the current selected rows by primary key column value
|
|
|
|
wxArrayString m_arrSelectedKeys2; //array for remembering the current selected rows by secondary key column value
|
|
|
|
|
2004-12-02 07:43:47 +00:00
|
|
|
protected:
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
virtual bool OnSaveState( wxConfigBase* pConfig );
|
|
|
|
virtual bool OnRestoreState( wxConfigBase* pConfig );
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
virtual void OnListRender( wxTimerEvent& event );
|
2004-09-24 02:01:53 +00:00
|
|
|
virtual void OnListSelected( wxListEvent& event );
|
|
|
|
virtual void OnListDeselected( wxListEvent& event );
|
2014-05-22 03:13:34 +00:00
|
|
|
virtual void OnCacheHint(wxListEvent& event);
|
2014-05-22 02:11:22 +00:00
|
|
|
virtual void OnCheckSelectionChanged(CCheckSelectionChangedEvent& event);
|
2014-05-22 03:13:34 +00:00
|
|
|
virtual void CheckSelectionChanged();
|
2004-09-24 02:01:53 +00:00
|
|
|
virtual wxString OnListGetItemText( long item, long column ) const;
|
|
|
|
virtual int OnListGetItemImage( long item ) const;
|
2004-07-13 05:56:03 +00:00
|
|
|
|
2008-06-26 01:25:31 +00:00
|
|
|
void OnColClick(wxListEvent& event);
|
2023-05-05 18:05:20 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
virtual int GetDocCount();
|
2004-12-02 07:43:47 +00:00
|
|
|
virtual wxString OnDocGetItemImage( long item ) const;
|
|
|
|
virtual wxString OnDocGetItemAttr( long item ) const;
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
virtual int AddCacheElement();
|
|
|
|
virtual int EmptyCache();
|
|
|
|
virtual int GetCacheCount();
|
|
|
|
virtual int RemoveCacheElement();
|
2008-06-25 10:38:16 +00:00
|
|
|
virtual int SynchronizeCache();
|
|
|
|
virtual bool SynchronizeCacheItem(wxInt32 iRowIndex, wxInt32 iColumnIndex);
|
2008-06-26 01:25:31 +00:00
|
|
|
void sortData();
|
2004-09-24 02:01:53 +00:00
|
|
|
|
2005-04-27 06:32:40 +00:00
|
|
|
virtual void EmptyTasks();
|
|
|
|
|
2006-01-09 14:03:13 +00:00
|
|
|
virtual void PreUpdateSelection();
|
2005-04-20 22:22:41 +00:00
|
|
|
virtual void UpdateSelection();
|
2006-01-09 14:03:13 +00:00
|
|
|
virtual void PostUpdateSelection();
|
|
|
|
|
|
|
|
virtual void UpdateWebsiteSelection(long lControlGroup, PROJECT* project);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
|
|
|
|
2008-10-30 01:55:11 +00:00
|
|
|
bool _IsSelectionManagementNeeded();
|
|
|
|
virtual bool IsSelectionManagementNeeded();
|
- client: include precompiled header in rr_sim.cpp so memory
leak detection will work.
- MGR: Have the BaseFrame call a function to determine if the
selection list should be saved instead of traversing
the application pointer. Each view just overrides the function
returning a true/false value. We don't have to worry about null
pointers and the like.
- MGR: BOINCGUIApp should never need to know how either the views
work or the document. Move the code that determines which
RPCs should be fired into each of the views. Have the document
look for it there.
- MGR: Reduce duplicate code for hiding and showing an application
- MGR: Move some Windows and Mac specific code into functions
and streamline the application startup and shutdown rountines.
- MGR: Move the event processing that was in BOINCGUIApp into the
BaseFrame.
- MGR: General cleanup.
- MGR: Doxygen comments.
- MGR: Cleanup some warnings.
client/
rr_sim.cpp
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
BOINCBaseFrame.cpp, .h
BOINCBaseView.cpp, .h
BOINCClientManager.cpp
BOINCGUIApp.cpp, .h
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_BoincSimpleGUI.cpp, .h
ViewProjects.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
WelcomePage.cpp
win_build/installerv2/
BOINC.ism
BOINCx64.ism
win_build/
sim.vcproj
svn path=/trunk/boinc/; revision=16357
2008-10-29 22:44:55 +00:00
|
|
|
|
2005-01-29 00:58:43 +00:00
|
|
|
bool _EnsureLastItemVisible();
|
2004-12-02 07:43:47 +00:00
|
|
|
virtual bool EnsureLastItemVisible();
|
|
|
|
|
2016-04-12 21:19:04 +00:00
|
|
|
static void append_to_status(wxString& existing, const wxString& additional);
|
2008-06-25 13:12:39 +00:00
|
|
|
static wxString HtmlEntityEncode(wxString strRaw);
|
|
|
|
static wxString HtmlEntityDecode(wxString strRaw);
|
2005-06-13 08:47:51 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
bool m_bProcessingTaskRenderEvent;
|
|
|
|
bool m_bProcessingListRenderEvent;
|
2004-10-26 01:59:44 +00:00
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
bool m_bForceUpdateSelection;
|
2008-03-18 18:19:49 +00:00
|
|
|
bool m_bIgnoreUIEvents;
|
2008-10-29 10:24:45 +00:00
|
|
|
bool m_bNeedSort;
|
2023-05-05 18:05:20 +00:00
|
|
|
|
2014-05-21 11:06:47 +00:00
|
|
|
int m_iPreviousSelectionCount;
|
|
|
|
long m_lPreviousFirstSelection;
|
2008-06-24 10:52:12 +00:00
|
|
|
int m_iProgressColumn;
|
2005-07-22 20:19:58 +00:00
|
|
|
|
2008-06-26 01:25:31 +00:00
|
|
|
wxImageList * m_SortArrows;
|
|
|
|
ListSortCompareFunc m_funcSortCompare;
|
|
|
|
wxArrayInt m_iSortedIndexes;
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
CBOINCTaskCtrl* m_pTaskPane;
|
|
|
|
CBOINCListCtrl* m_pListPane;
|
2004-04-10 09:11:03 +00:00
|
|
|
};
|
2004-04-11 04:37:10 +00:00
|
|
|
|
2004-04-11 05:09:18 +00:00
|
|
|
#endif
|