2014-01-28 20:29:59 +00:00
|
|
|
|
// This file is part of BOINC.
|
2005-01-20 23:22:22 +00:00
|
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
|
// Copyright (C) 2008 University of California
|
2004-09-21 01:30:29 +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-09-21 01:30:29 +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-09-21 01:30:29 +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-09-21 01:30:29 +00:00
|
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
|
#pragma implementation "BOINCBaseView.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "stdwx.h"
|
2004-10-26 01:59:44 +00:00
|
|
|
|
#include "BOINCGUIApp.h"
|
|
|
|
|
#include "MainDocument.h"
|
2004-09-21 01:30:29 +00:00
|
|
|
|
#include "BOINCBaseView.h"
|
|
|
|
|
#include "BOINCTaskCtrl.h"
|
|
|
|
|
#include "BOINCListCtrl.h"
|
2006-01-09 14:03:13 +00:00
|
|
|
|
#include "Events.h"
|
2004-09-22 21:53:07 +00:00
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
|
#include "res/boinc.xpm"
|
2008-06-25 13:12:39 +00:00
|
|
|
|
#include "res/sortascending.xpm"
|
|
|
|
|
#include "res/sortdescending.xpm"
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
|
|
|
|
|
2012-01-06 23:37:40 +00:00
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS(CBOINCBaseView, wxPanel)
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
CBOINCBaseView::CBOINCBaseView() {}
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
2005-09-06 06:18:36 +00:00
|
|
|
|
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook) :
|
2012-01-06 23:37:40 +00:00
|
|
|
|
wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
|
2005-04-21 06:04:26 +00:00
|
|
|
|
{
|
|
|
|
|
m_bProcessingTaskRenderEvent = false;
|
|
|
|
|
m_bProcessingListRenderEvent = false;
|
|
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
|
m_bForceUpdateSelection = true;
|
2008-03-18 18:19:49 +00:00
|
|
|
|
m_bIgnoreUIEvents = false;
|
2008-10-29 10:24:45 +00:00
|
|
|
|
m_bNeedSort = false;
|
2005-07-22 20:19:58 +00:00
|
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
|
//
|
|
|
|
|
// Setup View
|
|
|
|
|
//
|
|
|
|
|
m_pTaskPane = NULL;
|
|
|
|
|
m_pListPane = NULL;
|
2008-06-26 01:25:31 +00:00
|
|
|
|
m_iProgressColumn = -1;
|
|
|
|
|
m_iSortColumn = -1;
|
2008-06-25 13:12:39 +00:00
|
|
|
|
m_SortArrows = NULL;
|
|
|
|
|
|
2005-09-06 06:18:36 +00:00
|
|
|
|
SetName(GetViewName());
|
2012-01-06 23:37:40 +00:00
|
|
|
|
SetAutoLayout(TRUE);
|
2005-07-21 09:43:40 +00:00
|
|
|
|
|
2010-03-05 07:04:58 +00:00
|
|
|
|
#if BASEVIEW_STRIPES
|
|
|
|
|
m_pWhiteBackgroundAttr = NULL;
|
|
|
|
|
m_pGrayBackgroundAttr = NULL;
|
|
|
|
|
#endif
|
2005-04-21 06:04:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-12-06 19:01:03 +00:00
|
|
|
|
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID, int iTaskWindowFlags, wxWindowID iListWindowID, int iListWindowFlags) :
|
2012-01-06 23:37:40 +00:00
|
|
|
|
wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
|
2005-09-06 06:18:36 +00:00
|
|
|
|
{
|
2005-04-21 06:04:26 +00:00
|
|
|
|
m_bProcessingTaskRenderEvent = false;
|
|
|
|
|
m_bProcessingListRenderEvent = false;
|
2004-10-26 01:59:44 +00:00
|
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
|
m_bForceUpdateSelection = true;
|
2008-03-18 18:19:49 +00:00
|
|
|
|
m_bIgnoreUIEvents = false;
|
2005-09-30 09:00:50 +00:00
|
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
|
//
|
|
|
|
|
// Setup View
|
|
|
|
|
//
|
|
|
|
|
m_pTaskPane = NULL;
|
|
|
|
|
m_pListPane = NULL;
|
2004-12-15 23:08:18 +00:00
|
|
|
|
|
2005-09-06 06:18:36 +00:00
|
|
|
|
SetName(GetViewName());
|
2012-01-06 23:37:40 +00:00
|
|
|
|
SetAutoLayout(TRUE);
|
2005-07-21 09:43:40 +00:00
|
|
|
|
|
2012-01-06 17:12:19 +00:00
|
|
|
|
wxFlexGridSizer* itemFlexGridSizer = new wxFlexGridSizer(2, 0, 0);
|
|
|
|
|
wxASSERT(itemFlexGridSizer);
|
|
|
|
|
|
|
|
|
|
itemFlexGridSizer->AddGrowableRow(0);
|
|
|
|
|
itemFlexGridSizer->AddGrowableCol(1);
|
|
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
|
m_pTaskPane = new CBOINCTaskCtrl(this, iTaskWindowID, iTaskWindowFlags);
|
2005-04-27 06:55:28 +00:00
|
|
|
|
wxASSERT(m_pTaskPane);
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
2010-03-04 15:46:37 +00:00
|
|
|
|
m_pListPane = new CBOINCListCtrl(this, iListWindowID, iListWindowFlags);
|
2005-04-27 06:55:28 +00:00
|
|
|
|
wxASSERT(m_pListPane);
|
2012-01-06 17:12:19 +00:00
|
|
|
|
|
|
|
|
|
itemFlexGridSizer->Add(m_pTaskPane, 1, wxGROW|wxALL, 1);
|
|
|
|
|
itemFlexGridSizer->Add(m_pListPane, 1, wxGROW|wxALL, 1);
|
2005-04-21 06:04:26 +00:00
|
|
|
|
|
2012-01-06 17:12:19 +00:00
|
|
|
|
SetSizer(itemFlexGridSizer);
|
2005-04-27 06:32:40 +00:00
|
|
|
|
|
2011-12-06 19:01:03 +00:00
|
|
|
|
UpdateSelection();
|
2008-06-24 10:52:12 +00:00
|
|
|
|
|
2008-06-24 11:47:34 +00:00
|
|
|
|
#if USE_NATIVE_LISTCONTROL
|
|
|
|
|
m_pListPane->PushEventHandler(new MyEvtHandler(m_pListPane));
|
2008-06-24 10:52:12 +00:00
|
|
|
|
#else
|
2013-09-09 23:31:49 +00:00
|
|
|
|
m_pListPane->SaveEventHandler((m_pListPane->GetMainWin())->GetEventHandler());
|
2008-06-24 10:52:12 +00:00
|
|
|
|
(m_pListPane->GetMainWin())->PushEventHandler(new MyEvtHandler(m_pListPane));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
m_iProgressColumn = -1;
|
2008-06-25 10:38:16 +00:00
|
|
|
|
m_iSortColumn = -1;
|
|
|
|
|
m_bReverseSort = false;
|
2008-06-25 13:12:39 +00:00
|
|
|
|
|
|
|
|
|
m_SortArrows = new wxImageList(16, 16, true);
|
|
|
|
|
m_SortArrows->Add( wxIcon( sortascending_xpm ) );
|
|
|
|
|
m_SortArrows->Add( wxIcon( sortdescending_xpm ) );
|
|
|
|
|
m_pListPane->SetImageList(m_SortArrows, wxIMAGE_LIST_SMALL);
|
2010-03-05 07:04:58 +00:00
|
|
|
|
|
|
|
|
|
#if BASEVIEW_STRIPES
|
2010-03-12 04:28:15 +00:00
|
|
|
|
m_pWhiteBackgroundAttr = new wxListItemAttr(
|
|
|
|
|
wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT),
|
|
|
|
|
wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW),
|
|
|
|
|
wxNullFont
|
|
|
|
|
);
|
|
|
|
|
m_pGrayBackgroundAttr = new wxListItemAttr(
|
|
|
|
|
wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT),
|
2010-03-19 21:10:16 +00:00
|
|
|
|
wxColour(240, 240, 240),
|
2010-03-12 04:28:15 +00:00
|
|
|
|
wxNullFont
|
2011-03-02 23:31:53 +00:00
|
|
|
|
);
|
2010-03-05 07:04:58 +00:00
|
|
|
|
#endif
|
2011-12-06 19:01:03 +00:00
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-24 10:52:12 +00:00
|
|
|
|
CBOINCBaseView::~CBOINCBaseView() {
|
|
|
|
|
if (m_pListPane) {
|
|
|
|
|
#if USE_NATIVE_LISTCONTROL
|
|
|
|
|
m_pListPane->PopEventHandler(true);
|
|
|
|
|
#else
|
|
|
|
|
(m_pListPane->GetMainWin())->PopEventHandler(true);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2008-06-25 13:12:39 +00:00
|
|
|
|
if (m_SortArrows) {
|
|
|
|
|
delete m_SortArrows;
|
|
|
|
|
}
|
2008-09-14 12:39:19 +00:00
|
|
|
|
m_arrSelectedKeys1.Clear();
|
|
|
|
|
m_arrSelectedKeys2.Clear();
|
|
|
|
|
m_iSortedIndexes.Clear();
|
2010-03-05 07:04:58 +00:00
|
|
|
|
|
|
|
|
|
#if BASEVIEW_STRIPES
|
|
|
|
|
if (m_pWhiteBackgroundAttr) {
|
|
|
|
|
delete m_pWhiteBackgroundAttr;
|
|
|
|
|
m_pWhiteBackgroundAttr = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_pGrayBackgroundAttr) {
|
|
|
|
|
delete m_pGrayBackgroundAttr;
|
|
|
|
|
m_pGrayBackgroundAttr = NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2008-06-24 10:52:12 +00:00
|
|
|
|
}
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
|
|
|
|
|
- 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
|
|
|
|
// The name of the view.
|
2004-09-21 01:30:29 +00:00
|
|
|
|
// If it has not been defined by the view "Undefined" is returned.
|
|
|
|
|
//
|
2005-09-02 21:03:36 +00:00
|
|
|
|
wxString& CBOINCBaseView::GetViewName() {
|
|
|
|
|
static wxString strViewName(wxT("Undefined"));
|
|
|
|
|
return strViewName;
|
2004-09-21 01:30:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
- 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
|
|
|
|
// The user friendly name of the view.
|
|
|
|
|
// If it has not been defined by the view "Undefined" is returned.
|
|
|
|
|
//
|
|
|
|
|
wxString& CBOINCBaseView::GetViewDisplayName() {
|
|
|
|
|
static wxString strViewName(wxT("Undefined"));
|
|
|
|
|
return strViewName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
|
// The user friendly icon of the view.
|
|
|
|
|
// If it has not been defined by the view the BOINC icon is returned.
|
|
|
|
|
//
|
2005-04-07 07:04:50 +00:00
|
|
|
|
const char** CBOINCBaseView::GetViewIcon() {
|
2005-04-08 16:58:55 +00:00
|
|
|
|
wxASSERT(boinc_xpm);
|
2004-09-21 01:30:29 +00:00
|
|
|
|
return boinc_xpm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-12-29 16:35:33 +00:00
|
|
|
|
// The rate at which the view is refreshed.
|
|
|
|
|
// If it has not been defined by the view 1 second is retrned.
|
|
|
|
|
//
|
2013-02-07 18:26:02 +00:00
|
|
|
|
int CBOINCBaseView::GetViewRefreshRate() {
|
2006-12-29 16:35:33 +00:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-12-22 01:22:11 +00:00
|
|
|
|
// Get bit mask of current view(s).
|
|
|
|
|
//
|
2013-02-07 18:26:02 +00:00
|
|
|
|
int CBOINCBaseView::GetViewCurrentViewPage() {
|
2009-12-22 01:22:11 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-09-04 13:00:24 +00:00
|
|
|
|
wxString CBOINCBaseView::GetKeyValue1(int) {
|
|
|
|
|
return wxEmptyString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wxString CBOINCBaseView::GetKeyValue2(int) {
|
|
|
|
|
return wxEmptyString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-09-05 10:03:13 +00:00
|
|
|
|
int CBOINCBaseView::FindRowIndexByKeyValues(wxString&, wxString&) {
|
2008-09-04 13:00:24 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
bool CBOINCBaseView::FireOnSaveState(wxConfigBase* pConfig) {
|
|
|
|
|
return OnSaveState(pConfig);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
bool CBOINCBaseView::FireOnRestoreState(wxConfigBase* pConfig) {
|
|
|
|
|
return OnRestoreState(pConfig);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
|
int CBOINCBaseView::GetListRowCount() {
|
|
|
|
|
wxASSERT(m_pListPane);
|
|
|
|
|
return m_pListPane->GetItemCount();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-06-24 10:49:42 +00:00
|
|
|
|
void CBOINCBaseView::FireOnListRender(wxTimerEvent& event) {
|
2005-04-20 22:22:41 +00:00
|
|
|
|
OnListRender(event);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
void CBOINCBaseView::FireOnListSelected(wxListEvent& event) {
|
|
|
|
|
OnListSelected(event);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
void CBOINCBaseView::FireOnListDeselected(wxListEvent& event) {
|
|
|
|
|
OnListDeselected(event);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
wxString CBOINCBaseView::FireOnListGetItemText(long item, long column) const {
|
|
|
|
|
return OnListGetItemText(item, column);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
int CBOINCBaseView::FireOnListGetItemImage(long item) const {
|
|
|
|
|
return OnListGetItemImage(item);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2010-03-05 07:04:58 +00:00
|
|
|
|
#if BASEVIEW_STRIPES
|
|
|
|
|
wxListItemAttr* CBOINCBaseView::FireOnListGetItemAttr(long item) const {
|
|
|
|
|
return OnListGetItemAttr(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wxListItemAttr* CBOINCBaseView::OnListGetItemAttr(long item) const {
|
2011-03-02 23:31:53 +00:00
|
|
|
|
|
|
|
|
|
// If we are using some theme where the default background color isn't
|
|
|
|
|
// white, then our whole system is boned. Use defaults instead.
|
|
|
|
|
if (wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) != wxColor(wxT("WHITE"))) return NULL;
|
|
|
|
|
|
2010-03-05 07:04:58 +00:00
|
|
|
|
return item % 2 ? m_pGrayBackgroundAttr : m_pWhiteBackgroundAttr;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2006-01-30 23:05:52 +00:00
|
|
|
|
void CBOINCBaseView::OnListRender(wxTimerEvent& event) {
|
2005-04-07 07:04:50 +00:00
|
|
|
|
if (!m_bProcessingListRenderEvent) {
|
2004-10-26 01:59:44 +00:00
|
|
|
|
m_bProcessingListRenderEvent = true;
|
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
|
wxASSERT(m_pListPane);
|
2004-10-26 01:59:44 +00:00
|
|
|
|
|
2008-09-04 22:53:29 +00:00
|
|
|
|
// Remember the key values of currently selected items
|
|
|
|
|
SaveSelections();
|
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
|
int iDocCount = GetDocCount();
|
|
|
|
|
int iCacheCount = GetCacheCount();
|
2005-04-07 07:04:50 +00:00
|
|
|
|
if (iDocCount != iCacheCount) {
|
|
|
|
|
if (0 >= iDocCount) {
|
2004-12-02 07:43:47 +00:00
|
|
|
|
EmptyCache();
|
2004-10-26 01:59:44 +00:00
|
|
|
|
m_pListPane->DeleteAllItems();
|
2008-01-30 03:13:57 +00:00
|
|
|
|
} else {
|
2005-04-10 19:01:23 +00:00
|
|
|
|
int iIndex = 0;
|
|
|
|
|
int iReturnValue = -1;
|
2005-04-07 07:04:50 +00:00
|
|
|
|
if (iDocCount > iCacheCount) {
|
2008-09-08 12:39:41 +00:00
|
|
|
|
for (iIndex = 0; iIndex < (iDocCount - iCacheCount); iIndex++) {
|
2005-01-06 22:06:35 +00:00
|
|
|
|
iReturnValue = AddCacheElement();
|
2005-04-08 16:58:55 +00:00
|
|
|
|
wxASSERT(!iReturnValue);
|
2004-10-26 01:59:44 +00:00
|
|
|
|
}
|
2005-04-07 07:04:50 +00:00
|
|
|
|
wxASSERT(GetDocCount() == GetCacheCount());
|
2008-10-28 21:00:23 +00:00
|
|
|
|
m_pListPane->SetItemCount(iDocCount);
|
2008-10-29 10:24:45 +00:00
|
|
|
|
m_bNeedSort = true;
|
2008-10-28 21:00:23 +00:00
|
|
|
|
} else {
|
2010-03-11 01:14:07 +00:00
|
|
|
|
// The virtual ListCtrl keeps a separate its list of selected rows;
|
|
|
|
|
// make sure it does not reference any rows beyond the new last row.
|
|
|
|
|
// We can ClearSelections() because we called SaveSelections() above.
|
|
|
|
|
ClearSelections();
|
|
|
|
|
m_pListPane->SetItemCount(iDocCount);
|
2009-01-24 00:05:53 +00:00
|
|
|
|
for (iIndex = (iCacheCount - 1); iIndex >= iDocCount; --iIndex) {
|
2005-01-06 22:06:35 +00:00
|
|
|
|
iReturnValue = RemoveCacheElement();
|
2005-04-08 16:58:55 +00:00
|
|
|
|
wxASSERT(!iReturnValue);
|
2004-10-26 01:59:44 +00:00
|
|
|
|
}
|
2005-04-07 07:04:50 +00:00
|
|
|
|
wxASSERT(GetDocCount() == GetCacheCount());
|
2012-10-16 19:56:34 +00:00
|
|
|
|
//fprintf(stderr, "CBOINCBaseView::OnListRender(): m_pListPane->RefreshItems(0, %d)\n", iDocCount - 1);
|
2008-10-28 20:49:56 +00:00
|
|
|
|
m_pListPane->RefreshItems(0, iDocCount - 1);
|
2008-10-29 10:24:45 +00:00
|
|
|
|
m_bNeedSort = true;
|
2004-10-26 01:59:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-12-02 21:43:44 +00:00
|
|
|
|
|
2008-07-11 08:16:38 +00:00
|
|
|
|
if (iDocCount > 0) {
|
2008-06-25 10:38:16 +00:00
|
|
|
|
SynchronizeCache();
|
2009-08-27 01:46:20 +00:00
|
|
|
|
if (iDocCount > 1) {
|
|
|
|
|
if (_EnsureLastItemVisible() && (iDocCount != iCacheCount)) {
|
|
|
|
|
m_pListPane->EnsureVisible(iDocCount - 1);
|
|
|
|
|
}
|
2008-07-11 08:16:38 +00:00
|
|
|
|
}
|
2004-12-08 23:13:20 +00:00
|
|
|
|
|
2008-07-11 08:16:38 +00:00
|
|
|
|
if (m_pListPane->m_bIsSingleSelection) {
|
|
|
|
|
// If no item has been selected yet, select the first item.
|
2006-01-31 12:21:34 +00:00
|
|
|
|
#ifdef __WXMSW__
|
2008-07-11 08:16:38 +00:00
|
|
|
|
if ((m_pListPane->GetSelectedItemCount() == 0) &&
|
|
|
|
|
(m_pListPane->GetItemCount() >= 1)) {
|
2006-01-30 23:05:52 +00:00
|
|
|
|
|
2008-07-11 08:16:38 +00:00
|
|
|
|
long desiredstate = wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED;
|
|
|
|
|
m_pListPane->SetItemState(0, desiredstate, desiredstate);
|
|
|
|
|
}
|
2006-01-31 12:21:34 +00:00
|
|
|
|
#else
|
2008-07-11 08:16:38 +00:00
|
|
|
|
if ((m_pListPane->GetFirstSelected() < 0) &&
|
2008-09-12 12:09:15 +00:00
|
|
|
|
(m_pListPane->GetItemCount() >= 1)) {
|
2008-07-11 08:16:38 +00:00
|
|
|
|
m_pListPane->SetItemState(0, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED,
|
|
|
|
|
wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED);
|
2008-09-12 12:09:15 +00:00
|
|
|
|
}
|
2006-01-31 12:21:34 +00:00
|
|
|
|
#endif
|
2008-07-11 08:16:38 +00:00
|
|
|
|
}
|
2008-06-27 04:34:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-09-04 14:07:29 +00:00
|
|
|
|
// Find the previously selected items by their key values and reselect them
|
|
|
|
|
RestoreSelections();
|
2009-10-14 17:11:57 +00:00
|
|
|
|
|
2009-01-30 07:03:42 +00:00
|
|
|
|
UpdateSelection();
|
2008-09-13 00:27:13 +00:00
|
|
|
|
|
2004-10-26 01:59:44 +00:00
|
|
|
|
m_bProcessingListRenderEvent = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
event.Skip();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
bool CBOINCBaseView::OnSaveState(wxConfigBase* pConfig) {
|
2004-09-21 01:30:29 +00:00
|
|
|
|
bool bReturnValue = true;
|
|
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
|
wxASSERT(pConfig);
|
|
|
|
|
wxASSERT(m_pTaskPane);
|
|
|
|
|
wxASSERT(m_pListPane);
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
|
if (!m_pTaskPane->OnSaveState(pConfig)) {
|
2004-09-21 01:30:29 +00:00
|
|
|
|
bReturnValue = false;
|
2005-04-08 16:58:55 +00:00
|
|
|
|
}
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
|
if (!m_pListPane->OnSaveState(pConfig)) {
|
2004-09-21 01:30:29 +00:00
|
|
|
|
bReturnValue = false;
|
2005-04-08 16:58:55 +00:00
|
|
|
|
}
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
|
|
|
|
return bReturnValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
|
bool CBOINCBaseView::OnRestoreState(wxConfigBase* pConfig) {
|
|
|
|
|
wxASSERT(pConfig);
|
|
|
|
|
wxASSERT(m_pTaskPane);
|
|
|
|
|
wxASSERT(m_pListPane);
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
|
if (!m_pTaskPane->OnRestoreState(pConfig)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
|
if (!m_pListPane->OnRestoreState(pConfig)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
2004-09-21 01:30:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
void CBOINCBaseView::OnListSelected(wxListEvent& event) {
|
2005-04-21 23:14:10 +00:00
|
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListSelected - Function Begin"));
|
|
|
|
|
|
2008-03-18 18:19:49 +00:00
|
|
|
|
if (!m_bIgnoreUIEvents) {
|
2008-12-04 11:39:51 +00:00
|
|
|
|
m_bForceUpdateSelection = true;
|
2008-03-18 18:19:49 +00:00
|
|
|
|
UpdateSelection();
|
|
|
|
|
event.Skip();
|
|
|
|
|
}
|
2005-04-21 23:14:10 +00:00
|
|
|
|
|
|
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListSelected - Function End"));
|
2004-09-24 02:01:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
void CBOINCBaseView::OnListDeselected(wxListEvent& event) {
|
2005-04-21 23:14:10 +00:00
|
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function Begin"));
|
|
|
|
|
|
2008-03-18 18:19:49 +00:00
|
|
|
|
if (!m_bIgnoreUIEvents) {
|
2008-12-04 11:39:51 +00:00
|
|
|
|
m_bForceUpdateSelection = true;
|
2008-03-18 18:19:49 +00:00
|
|
|
|
UpdateSelection();
|
|
|
|
|
event.Skip();
|
|
|
|
|
}
|
2005-04-21 23:14:10 +00:00
|
|
|
|
|
|
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function End"));
|
2004-09-24 02:01:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-27 04:34:47 +00:00
|
|
|
|
// Work around a bug (feature?) in virtual list control
|
|
|
|
|
// which does not send deselection events
|
|
|
|
|
void CBOINCBaseView::OnCacheHint(wxListEvent& event) {
|
|
|
|
|
static int oldSelectionCount = 0;
|
|
|
|
|
int newSelectionCount = m_pListPane->GetSelectedItemCount();
|
2008-06-27 10:05:47 +00:00
|
|
|
|
|
2008-06-27 04:34:47 +00:00
|
|
|
|
if (newSelectionCount < oldSelectionCount) {
|
|
|
|
|
wxListEvent leDeselectedEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED, m_windowId);
|
|
|
|
|
leDeselectedEvent.SetEventObject(this);
|
|
|
|
|
OnListDeselected(leDeselectedEvent);
|
|
|
|
|
}
|
|
|
|
|
oldSelectionCount = newSelectionCount;
|
|
|
|
|
event.Skip();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-03-23 09:10:47 +00:00
|
|
|
|
wxString CBOINCBaseView::OnListGetItemText(long WXUNUSED(item), long WXUNUSED(column)) const {
|
|
|
|
|
return wxString(wxT("Undefined"));
|
2004-09-21 01:30:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
int CBOINCBaseView::OnListGetItemImage(long WXUNUSED(item)) const {
|
2004-09-21 01:30:29 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
|
int CBOINCBaseView::GetDocCount() {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
wxString CBOINCBaseView::OnDocGetItemImage(long WXUNUSED(item)) const {
|
2006-03-23 01:17:07 +00:00
|
|
|
|
return wxString(wxT("Undefined"));
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
wxString CBOINCBaseView::OnDocGetItemAttr(long WXUNUSED(item)) const {
|
2006-03-23 01:17:07 +00:00
|
|
|
|
return wxString(wxT("Undefined"));
|
2004-10-26 01:59:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
|
int CBOINCBaseView::AddCacheElement() {
|
2004-12-02 07:43:47 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
|
int CBOINCBaseView::EmptyCache() {
|
2004-12-02 07:43:47 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
|
int CBOINCBaseView::GetCacheCount() {
|
2004-12-02 07:43:47 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-10 19:01:23 +00:00
|
|
|
|
int CBOINCBaseView::RemoveCacheElement() {
|
2004-12-02 07:43:47 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-25 10:38:16 +00:00
|
|
|
|
int CBOINCBaseView::SynchronizeCache() {
|
2005-04-10 19:01:23 +00:00
|
|
|
|
int iRowIndex = 0;
|
|
|
|
|
int iRowTotal = 0;
|
|
|
|
|
int iColumnIndex = 0;
|
|
|
|
|
int iColumnTotal = 0;
|
2005-11-02 18:28:45 +00:00
|
|
|
|
bool bNeedRefreshData = false;
|
2004-12-02 07:43:47 +00:00
|
|
|
|
|
|
|
|
|
iRowTotal = GetDocCount();
|
|
|
|
|
iColumnTotal = m_pListPane->GetColumnCount();
|
2008-09-04 13:00:24 +00:00
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
for (iRowIndex = 0; iRowIndex < iRowTotal; iRowIndex++) {
|
2004-12-02 07:43:47 +00:00
|
|
|
|
bNeedRefreshData = false;
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
for (iColumnIndex = 0; iColumnIndex < iColumnTotal; iColumnIndex++) {
|
2008-06-25 10:38:16 +00:00
|
|
|
|
if (SynchronizeCacheItem(iRowIndex, iColumnIndex)) {
|
2008-10-10 08:47:02 +00:00
|
|
|
|
#ifdef __WXMAC__
|
2004-12-02 07:43:47 +00:00
|
|
|
|
bNeedRefreshData = true;
|
2008-10-10 08:47:02 +00:00
|
|
|
|
#else
|
|
|
|
|
// To reduce flicker, refresh only changed columns
|
|
|
|
|
m_pListPane->RefreshCell(iRowIndex, iColumnIndex);
|
|
|
|
|
#endif
|
2008-06-25 13:53:52 +00:00
|
|
|
|
if (iColumnIndex == m_iSortColumn) {
|
2008-10-29 10:24:45 +00:00
|
|
|
|
m_bNeedSort = true;
|
2008-06-25 13:53:52 +00:00
|
|
|
|
}
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-10 08:47:02 +00:00
|
|
|
|
// Mac is double-buffered to avoid flicker, so this is more efficient
|
2005-04-07 07:04:50 +00:00
|
|
|
|
if (bNeedRefreshData) {
|
|
|
|
|
m_pListPane->RefreshItem(iRowIndex);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-29 10:24:45 +00:00
|
|
|
|
if (m_bNeedSort) {
|
2008-09-04 13:00:24 +00:00
|
|
|
|
sortData(); // Will mark moved items as needing refresh
|
2008-10-29 10:24:45 +00:00
|
|
|
|
m_bNeedSort = false;
|
2008-06-25 14:45:03 +00:00
|
|
|
|
}
|
2008-09-04 13:00:24 +00:00
|
|
|
|
|
2004-12-02 07:43:47 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-27 10:05:47 +00:00
|
|
|
|
bool CBOINCBaseView::SynchronizeCacheItem(wxInt32 WXUNUSED(iRowIndex), wxInt32 WXUNUSED(iColumnIndex)) {
|
2008-06-25 10:38:16 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2008-06-25 13:53:52 +00:00
|
|
|
|
|
2008-06-26 01:25:31 +00:00
|
|
|
|
void CBOINCBaseView::OnColClick(wxListEvent& event) {
|
|
|
|
|
wxListItem item;
|
|
|
|
|
int newSortColumn = event.GetColumn();
|
2009-10-29 11:23:15 +00:00
|
|
|
|
wxArrayInt selections;
|
2009-10-29 11:13:48 +00:00
|
|
|
|
int i, j, m;
|
2008-06-26 01:25:31 +00:00
|
|
|
|
|
|
|
|
|
item.SetMask(wxLIST_MASK_IMAGE);
|
|
|
|
|
if (newSortColumn == m_iSortColumn) {
|
|
|
|
|
m_bReverseSort = !m_bReverseSort;
|
|
|
|
|
} else {
|
|
|
|
|
// Remove sort arrow from old sort column
|
|
|
|
|
if (m_iSortColumn >= 0) {
|
|
|
|
|
item.SetImage(-1);
|
|
|
|
|
m_pListPane->SetColumn(m_iSortColumn, item);
|
|
|
|
|
}
|
|
|
|
|
m_iSortColumn = newSortColumn;
|
|
|
|
|
m_bReverseSort = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item.SetImage(m_bReverseSort ? 0 : 1);
|
|
|
|
|
m_pListPane->SetColumn(newSortColumn, item);
|
2008-09-04 13:00:24 +00:00
|
|
|
|
|
|
|
|
|
Freeze(); // To reduce flicker
|
|
|
|
|
// Remember which cache elements are selected and deselect them
|
|
|
|
|
m_bIgnoreUIEvents = true;
|
|
|
|
|
i = -1;
|
|
|
|
|
while (1) {
|
|
|
|
|
i = m_pListPane->GetNextSelected(i);
|
|
|
|
|
if (i < 0) break;
|
|
|
|
|
selections.Add(m_iSortedIndexes[i]);
|
|
|
|
|
m_pListPane->SelectRow(i, false);
|
|
|
|
|
}
|
|
|
|
|
|
2008-06-26 01:25:31 +00:00
|
|
|
|
sortData();
|
2008-09-04 13:00:24 +00:00
|
|
|
|
|
|
|
|
|
// Reselect previously selected cache elements in the sorted list
|
|
|
|
|
m = (int)selections.GetCount();
|
|
|
|
|
for (i=0; i<m; i++) {
|
|
|
|
|
if (selections[i] >= 0) {
|
|
|
|
|
j = m_iSortedIndexes.Index(selections[i]);
|
|
|
|
|
m_pListPane->SelectRow(j, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_bIgnoreUIEvents = false;
|
|
|
|
|
|
|
|
|
|
Thaw();
|
2008-06-26 01:25:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-26 11:49:43 +00:00
|
|
|
|
void CBOINCBaseView::InitSort() {
|
|
|
|
|
wxListItem item;
|
|
|
|
|
|
|
|
|
|
if (m_iSortColumn < 0) return;
|
|
|
|
|
item.SetMask(wxLIST_MASK_IMAGE);
|
|
|
|
|
item.SetImage(m_bReverseSort ? 0 : 1);
|
|
|
|
|
m_pListPane->SetColumn(m_iSortColumn, item);
|
2008-09-04 13:00:24 +00:00
|
|
|
|
Freeze(); // To reduce flicker
|
2008-06-26 11:49:43 +00:00
|
|
|
|
sortData();
|
2008-09-04 13:00:24 +00:00
|
|
|
|
Thaw();
|
2008-06-26 11:49:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-26 01:25:31 +00:00
|
|
|
|
void CBOINCBaseView::sortData() {
|
|
|
|
|
if (m_iSortColumn < 0) return;
|
|
|
|
|
|
|
|
|
|
wxArrayInt oldSortedIndexes(m_iSortedIndexes);
|
2008-09-04 13:00:24 +00:00
|
|
|
|
int i, n = (int)m_iSortedIndexes.GetCount();
|
2008-06-26 01:25:31 +00:00
|
|
|
|
|
2008-07-08 15:13:34 +00:00
|
|
|
|
std::stable_sort(m_iSortedIndexes.begin(), m_iSortedIndexes.end(), m_funcSortCompare);
|
2008-06-26 01:25:31 +00:00
|
|
|
|
|
|
|
|
|
// Refresh rows which have moved
|
|
|
|
|
for (i=0; i<n; i++) {
|
|
|
|
|
if (m_iSortedIndexes[i] != oldSortedIndexes[i]) {
|
|
|
|
|
m_pListPane->RefreshItem(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-06-25 13:53:52 +00:00
|
|
|
|
|
|
|
|
|
|
2005-04-27 06:32:40 +00:00
|
|
|
|
void CBOINCBaseView::EmptyTasks() {
|
|
|
|
|
unsigned int i;
|
|
|
|
|
unsigned int j;
|
|
|
|
|
for (i=0; i<m_TaskGroups.size(); i++) {
|
|
|
|
|
for (j=0; j<m_TaskGroups[i]->m_Tasks.size(); j++) {
|
|
|
|
|
delete m_TaskGroups[i]->m_Tasks[j];
|
|
|
|
|
}
|
|
|
|
|
m_TaskGroups[i]->m_Tasks.clear();
|
|
|
|
|
delete m_TaskGroups[i];
|
|
|
|
|
}
|
|
|
|
|
m_TaskGroups.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-09-04 13:00:24 +00:00
|
|
|
|
void CBOINCBaseView::ClearSavedSelections() {
|
2008-09-14 12:39:19 +00:00
|
|
|
|
m_arrSelectedKeys1.Clear();
|
|
|
|
|
m_arrSelectedKeys2.Clear();
|
2008-09-04 13:00:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Save the key values of the currently selected rows for later restore
|
|
|
|
|
void CBOINCBaseView::SaveSelections() {
|
2008-10-30 01:55:11 +00:00
|
|
|
|
if (!_IsSelectionManagementNeeded()) {
|
2008-09-04 13:00:24 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2008-09-14 12:39:19 +00:00
|
|
|
|
m_arrSelectedKeys1.Clear();
|
|
|
|
|
m_arrSelectedKeys2.Clear();
|
2008-09-04 13:00:24 +00:00
|
|
|
|
m_bIgnoreUIEvents = true;
|
|
|
|
|
int i = -1;
|
|
|
|
|
while (1) {
|
|
|
|
|
i = m_pListPane->GetNextSelected(i);
|
|
|
|
|
if (i < 0) break;
|
2008-09-12 12:09:15 +00:00
|
|
|
|
m_arrSelectedKeys1.Add(GetKeyValue1(i));
|
|
|
|
|
m_arrSelectedKeys2.Add(GetKeyValue2(i));
|
2008-09-04 13:00:24 +00:00
|
|
|
|
}
|
|
|
|
|
m_bIgnoreUIEvents = false;
|
|
|
|
|
}
|
|
|
|
|
|
2008-09-12 12:09:15 +00:00
|
|
|
|
// Select all rows with formerly selected data based on key values
|
|
|
|
|
//
|
|
|
|
|
// Each RPC may add (insert) or delete items from the list, so
|
|
|
|
|
// the selected row numbers may now point to different data.
|
|
|
|
|
// We called SaveSelections() before updating the underlying
|
|
|
|
|
// data; this routine finds the data corresponding to each
|
|
|
|
|
// previous selection and makes any adjustments to ensure that
|
|
|
|
|
// the rows containing the originally selected data are selected.
|
2008-09-04 13:00:24 +00:00
|
|
|
|
void CBOINCBaseView::RestoreSelections() {
|
2008-10-30 01:55:11 +00:00
|
|
|
|
if (!_IsSelectionManagementNeeded()) {
|
2008-09-04 13:00:24 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2008-09-12 12:09:15 +00:00
|
|
|
|
|
|
|
|
|
// To minimize flicker, this method selects or deselects only
|
|
|
|
|
// those rows which actually need their selection status changed.
|
|
|
|
|
// First, get a list of which rows should be selected
|
2008-09-12 12:27:17 +00:00
|
|
|
|
int i, j, m = 0, newCount = 0, oldCount = (int)m_arrSelectedKeys1.size();
|
2008-09-12 12:09:15 +00:00
|
|
|
|
bool found;
|
|
|
|
|
wxArrayInt arrSelRows;
|
|
|
|
|
for(i=0; i< oldCount; ++i) {
|
2008-09-04 13:00:24 +00:00
|
|
|
|
int index = FindRowIndexByKeyValues(m_arrSelectedKeys1[i], m_arrSelectedKeys2[i]);
|
2008-09-12 12:09:15 +00:00
|
|
|
|
if(index >= 0) {
|
|
|
|
|
arrSelRows.Add(index);
|
2008-09-04 13:00:24 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2008-09-12 12:27:17 +00:00
|
|
|
|
newCount = (int)arrSelRows.GetCount();
|
2008-09-12 12:09:15 +00:00
|
|
|
|
|
|
|
|
|
// Step through the currently selected row numbers and for each one determine
|
|
|
|
|
// whether it should remain selected.
|
|
|
|
|
m_bIgnoreUIEvents = true;
|
|
|
|
|
i = -1;
|
|
|
|
|
while (1) {
|
|
|
|
|
found = false;
|
|
|
|
|
i = m_pListPane->GetNextSelected(i);
|
|
|
|
|
if (i < 0) break;
|
2008-09-12 12:27:17 +00:00
|
|
|
|
m = (int)arrSelRows.GetCount();
|
2008-09-12 12:09:15 +00:00
|
|
|
|
for (j=0; j<m; ++j) {
|
|
|
|
|
if (arrSelRows[j] == i) {
|
|
|
|
|
arrSelRows.RemoveAt(j); // We have handled this one so remove from list
|
|
|
|
|
found = true; // Already selected, so no change needed
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!found) {
|
|
|
|
|
m_pListPane->SelectRow(i, false); // This row should no longer be selected
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Now select those rows which were not previously selected but should now be
|
2008-09-12 12:27:17 +00:00
|
|
|
|
m = (int)arrSelRows.GetCount();
|
2008-09-12 12:09:15 +00:00
|
|
|
|
for (j=0; j<m; ++j) {
|
|
|
|
|
m_pListPane->SelectRow(arrSelRows[j], true);
|
|
|
|
|
}
|
2008-09-04 13:00:24 +00:00
|
|
|
|
m_bIgnoreUIEvents = false;
|
2008-09-12 12:09:15 +00:00
|
|
|
|
|
|
|
|
|
if (oldCount != newCount) {
|
2009-01-30 07:03:42 +00:00
|
|
|
|
m_bForceUpdateSelection = true; // OnListRender() will call UpdateSelection()
|
2008-09-12 12:09:15 +00:00
|
|
|
|
}
|
2008-09-04 13:00:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CBOINCBaseView::ClearSelections() {
|
|
|
|
|
if (!m_pListPane) return;
|
|
|
|
|
|
|
|
|
|
m_bIgnoreUIEvents = true;
|
|
|
|
|
int i = -1;
|
|
|
|
|
while (1) {
|
|
|
|
|
i = m_pListPane->GetNextSelected(i);
|
|
|
|
|
if (i < 0) break;
|
|
|
|
|
m_pListPane->SelectRow(i, false);
|
|
|
|
|
}
|
|
|
|
|
m_bIgnoreUIEvents = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-01-09 14:03:13 +00:00
|
|
|
|
void CBOINCBaseView::PreUpdateSelection(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-07-24 08:35:57 +00:00
|
|
|
|
void CBOINCBaseView::UpdateSelection(){
|
2006-01-09 14:03:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CBOINCBaseView::PostUpdateSelection(){
|
2005-07-24 08:35:57 +00:00
|
|
|
|
wxASSERT(m_pTaskPane);
|
2012-10-16 19:56:34 +00:00
|
|
|
|
if (m_pTaskPane->UpdateControls()) {
|
|
|
|
|
// Under wxWidgets 2.9.4, Layout() causes ListCtrl
|
|
|
|
|
// to repaint, so call only when actually needed.
|
|
|
|
|
Layout();
|
|
|
|
|
}
|
2005-07-24 08:35:57 +00:00
|
|
|
|
}
|
2005-04-20 22:22:41 +00:00
|
|
|
|
|
|
|
|
|
|
2006-01-09 14:03:13 +00:00
|
|
|
|
void CBOINCBaseView::UpdateWebsiteSelection(long lControlGroup, PROJECT* project){
|
|
|
|
|
unsigned int i;
|
|
|
|
|
CTaskItemGroup* pGroup = NULL;
|
|
|
|
|
CTaskItem* pItem = NULL;
|
|
|
|
|
|
|
|
|
|
wxASSERT(m_pTaskPane);
|
|
|
|
|
wxASSERT(m_pListPane);
|
|
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
|
if (m_bForceUpdateSelection) {
|
2011-12-06 19:01:03 +00:00
|
|
|
|
|
|
|
|
|
// Update the websites list
|
|
|
|
|
//
|
2008-12-04 11:39:51 +00:00
|
|
|
|
if (m_TaskGroups.size() > 1) {
|
2006-01-09 14:03:13 +00:00
|
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
|
// Delete task group, objects, and controls.
|
|
|
|
|
pGroup = m_TaskGroups[lControlGroup];
|
2006-01-09 14:03:13 +00:00
|
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
|
m_pTaskPane->DeleteTaskGroupAndTasks(pGroup);
|
|
|
|
|
for (i=0; i<pGroup->m_Tasks.size(); i++) {
|
|
|
|
|
delete pGroup->m_Tasks[i];
|
|
|
|
|
}
|
|
|
|
|
pGroup->m_Tasks.clear();
|
|
|
|
|
delete pGroup;
|
2006-01-09 14:03:13 +00:00
|
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
|
pGroup = NULL;
|
2006-01-09 14:03:13 +00:00
|
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
|
m_TaskGroups.erase( m_TaskGroups.begin() + 1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If something is selected create the tasks and controls
|
2011-12-06 19:01:03 +00:00
|
|
|
|
//
|
2008-12-04 11:39:51 +00:00
|
|
|
|
if (m_pListPane->GetSelectedItemCount()) {
|
|
|
|
|
if (project) {
|
|
|
|
|
// Create the web sites task group
|
2012-01-19 03:49:37 +00:00
|
|
|
|
pGroup = new CTaskItemGroup( _("Project web pages") );
|
2008-12-04 11:39:51 +00:00
|
|
|
|
m_TaskGroups.push_back( pGroup );
|
2008-12-02 01:24:32 +00:00
|
|
|
|
|
2008-12-04 11:39:51 +00:00
|
|
|
|
// Default project url
|
2006-01-09 14:03:13 +00:00
|
|
|
|
pItem = new CTaskItem(
|
2012-01-19 03:49:37 +00:00
|
|
|
|
wxString("Home page", wxConvUTF8),
|
2012-01-27 21:29:35 +00:00
|
|
|
|
wxString(project->project_name.c_str(), wxConvUTF8) + wxT(" web site"),
|
2010-03-12 17:47:17 +00:00
|
|
|
|
wxString(project->master_url, wxConvUTF8),
|
2008-12-04 11:39:51 +00:00
|
|
|
|
ID_TASK_PROJECT_WEB_PROJDEF_MIN
|
2006-01-09 14:03:13 +00:00
|
|
|
|
);
|
|
|
|
|
pGroup->m_Tasks.push_back(pItem);
|
2008-12-04 11:39:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Project defined urls
|
|
|
|
|
for (i=0;(i<project->gui_urls.size())&&(i<=ID_TASK_PROJECT_WEB_PROJDEF_MAX);i++) {
|
|
|
|
|
pItem = new CTaskItem(
|
|
|
|
|
wxGetTranslation(wxString(project->gui_urls[i].name.c_str(), wxConvUTF8)),
|
|
|
|
|
wxGetTranslation(wxString(project->gui_urls[i].description.c_str(), wxConvUTF8)),
|
|
|
|
|
wxString(project->gui_urls[i].url.c_str(), wxConvUTF8),
|
|
|
|
|
ID_TASK_PROJECT_WEB_PROJDEF_MIN + 1 + i
|
|
|
|
|
);
|
|
|
|
|
pGroup->m_Tasks.push_back(pItem);
|
|
|
|
|
}
|
2006-01-09 14:03:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2011-12-06 19:01:03 +00:00
|
|
|
|
|
2008-12-05 01:44:38 +00:00
|
|
|
|
m_bForceUpdateSelection = false;
|
2008-11-12 09:30:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-12-05 01:13:16 +00:00
|
|
|
|
// Make sure task pane background is properly erased
|
|
|
|
|
void CBOINCBaseView::RefreshTaskPane() {
|
|
|
|
|
if (m_pTaskPane) {
|
|
|
|
|
m_pTaskPane->Refresh(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-10-30 01:55:11 +00:00
|
|
|
|
bool CBOINCBaseView::_IsSelectionManagementNeeded() {
|
|
|
|
|
return 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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-10-30 01:55:11 +00:00
|
|
|
|
bool CBOINCBaseView::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
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
bool CBOINCBaseView::_EnsureLastItemVisible() {
|
2005-01-29 00:58:43 +00:00
|
|
|
|
return EnsureLastItemVisible();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
|
bool CBOINCBaseView::EnsureLastItemVisible() {
|
2004-12-02 07:43:47 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-06-24 11:47:34 +00:00
|
|
|
|
double CBOINCBaseView::GetProgressValue(long) {
|
2008-06-24 10:52:12 +00:00
|
|
|
|
return 0.0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-10-27 20:17:22 +00:00
|
|
|
|
wxString CBOINCBaseView::GetProgressText( long ) {
|
2008-10-06 11:33:28 +00:00
|
|
|
|
return wxEmptyString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
|
void CBOINCBaseView::append_to_status(wxString& existing, const wxChar* additional) {
|
|
|
|
|
if (existing.size() == 0) {
|
|
|
|
|
existing = additional;
|
|
|
|
|
} else {
|
2006-03-23 01:17:07 +00:00
|
|
|
|
existing = existing + wxT(", ") + additional;
|
2005-06-13 08:47:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
- 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
|
|
|
|
// HTML Entity Conversion:
|
|
|
|
|
// http://www.webreference.com/html/reference/character/
|
|
|
|
|
// Completed: The ISO Latin 1 Character Set
|
|
|
|
|
//
|
|
|
|
|
wxString CBOINCBaseView::HtmlEntityEncode(wxString strRaw) {
|
|
|
|
|
wxString strEncodedHtml(strRaw);
|
|
|
|
|
|
2007-05-29 16:16:33 +00:00
|
|
|
|
#ifdef __WXMSW__
|
- 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
|
|
|
|
strEncodedHtml.Replace(wxT("&"), wxT("&"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("\""), wxT("""), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("<"), wxT("<"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT(">"), wxT(">"), true);
|
2014-01-28 20:29:59 +00:00
|
|
|
|
strEncodedHtml.Replace(wxT("‚"), wxT("‚"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ƒ"), wxT("ƒ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("„"), wxT("„"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("…"), wxT("…"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("†"), wxT("†"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("‡"), wxT("‡"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Š"), wxT("Š"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Œ"), wxT("Œ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("‘"), wxT("‘"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("’"), wxT("’"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("“"), wxT("“"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("”"), wxT("”"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("•"), wxT("•"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("–"), wxT("–"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("—"), wxT("—"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("˜˜~"), wxT("˜"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("™"), wxT("™"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("š"), wxT("š"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("œ"), wxT("œ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ÿ"), wxT("Ÿ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¡"), wxT("¡"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¢"), wxT("¢"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("£"), wxT("£"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¤"), wxT("¤"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¥"), wxT("¥"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¦"), wxT("¦"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("§"), wxT("§"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¨"), wxT("¨"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("©"), wxT("©"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ª"), wxT("ª"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("«"), wxT("«"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¬"), wxT("¬"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("®"), wxT("®"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¯"), wxT("¯"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("°"), wxT("°"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("±"), wxT("±"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("²"), wxT("²"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("³"), wxT("³"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("´"), wxT("´"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("µ"), wxT("µ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¶"), wxT("¶"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("·"), wxT("·"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¸"), wxT("¸"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¹"), wxT("¹"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("º"), wxT("º"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("»"), wxT("»"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¼"), wxT("¼"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("½"), wxT("½"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¾"), wxT("¾"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("¿"), wxT("¿"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("À"), wxT("À"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Á"), wxT("Á"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Â"), wxT("Â"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ã"), wxT("Ã"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ä"), wxT("Ä"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Å"), wxT("Å"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Æ"), wxT("Æ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ç"), wxT("Ç"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("È"), wxT("È"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("É"), wxT("É"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ê"), wxT("Ê"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ë"), wxT("Ë"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ì"), wxT("Ì"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Í"), wxT("Í"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Î"), wxT("Î"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ï"), wxT("Ï"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ð"), wxT("Ð"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ñ"), wxT("Ñ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ò"), wxT("Ò"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ó"), wxT("Ó"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ô"), wxT("Ô"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Õ"), wxT("Õ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ö"), wxT("Ö"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("×"), wxT("×"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ø"), wxT("Ø"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ù"), wxT("Ù"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ú"), wxT("Ú"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Û"), wxT("Û"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ü"), wxT("Ü"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Ý"), wxT("Ý"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("Þ"), wxT("Þ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ß"), wxT("ß"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("à"), wxT("à"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("á"), wxT("á"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("â"), wxT("â"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ã"), wxT("ã"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ä"), wxT("ä"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("å"), wxT("å"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("æ"), wxT("æ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ç"), wxT("ç"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("è"), wxT("è"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("é"), wxT("é"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ê"), wxT("ê"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ë"), wxT("ë"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ì"), wxT("ì"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("í"), wxT("í"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("î"), wxT("î"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ï"), wxT("ï"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ð"), wxT("ð"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ñ"), wxT("ñ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ò"), wxT("ò"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ó"), wxT("ó"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ô"), wxT("ô"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("õ"), wxT("õ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ö"), wxT("ö"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("÷"), wxT("÷"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ø"), wxT("ø"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ù"), wxT("ù"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ú"), wxT("ú"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("û"), wxT("û"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ü"), wxT("ü"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ý"), wxT("ý"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("þ"), wxT("þ"), true);
|
|
|
|
|
strEncodedHtml.Replace(wxT("ÿ"), wxT("ÿ"), true);
|
2007-05-29 16:16:33 +00:00
|
|
|
|
#endif
|
- 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
|
|
|
|
|
|
|
|
|
return strEncodedHtml;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wxString CBOINCBaseView::HtmlEntityDecode(wxString strRaw) {
|
|
|
|
|
wxString strDecodedHtml(strRaw);
|
|
|
|
|
|
|
|
|
|
if (0 <= strDecodedHtml.Find(wxT("&"))) {
|
2007-05-29 16:16:33 +00:00
|
|
|
|
#ifdef __WXMSW__
|
- 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
|
|
|
|
strDecodedHtml.Replace(wxT("&"), wxT("&"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("""), wxT("\""), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("<"), wxT("<"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT(">"), wxT(">"), true);
|
2014-01-28 20:29:59 +00:00
|
|
|
|
strDecodedHtml.Replace(wxT("‚"), wxT("‚"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ƒ"), wxT("ƒ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("„"), wxT("„"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("…"), wxT("…"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("†"), wxT("†"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("‡"), wxT("‡"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Š"), wxT("Š"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Œ"), wxT("Œ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("‘"), wxT("‘"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("’"), wxT("’"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("“"), wxT("“"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("”"), wxT("”"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("•"), wxT("•"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("–"), wxT("–"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("—"), wxT("—"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("˜"), wxT("˜˜~"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("™"), wxT("™"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("š"), wxT("š"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("œ"), wxT("œ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ÿ"), wxT("Ÿ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¡"), wxT("¡"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¢"), wxT("¢"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("£"), wxT("£"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¤"), wxT("¤"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¥"), wxT("¥"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¦"), wxT("¦"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("§"), wxT("§"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¨"), wxT("¨"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("©"), wxT("©"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ª"), wxT("ª"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("«"), wxT("«"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¬"), wxT("¬"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("®"), wxT("®"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¯"), wxT("¯"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("°"), wxT("°"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("±"), wxT("±"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("²"), wxT("²"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("³"), wxT("³"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("´"), wxT("´"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("µ"), wxT("µ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¶"), wxT("¶"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("·"), wxT("·"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¸"), wxT("¸"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¹"), wxT("¹"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("º"), wxT("º"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("»"), wxT("»"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¼"), wxT("¼"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("½"), wxT("½"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¾"), wxT("¾"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("¿"), wxT("¿"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("À"), wxT("À"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Á"), wxT("Á"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Â"), wxT("Â"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ã"), wxT("Ã"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ä"), wxT("Ä"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Å"), wxT("Å"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Æ"), wxT("Æ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ç"), wxT("Ç"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("È"), wxT("È"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("É"), wxT("É"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ê"), wxT("Ê"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ë"), wxT("Ë"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ì"), wxT("Ì"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Í"), wxT("Í"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Î"), wxT("Î"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ï"), wxT("Ï"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ð"), wxT("Ð"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ñ"), wxT("Ñ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ò"), wxT("Ò"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ó"), wxT("Ó"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ô"), wxT("Ô"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Õ"), wxT("Õ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ö"), wxT("Ö"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("×"), wxT("×"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ø"), wxT("Ø"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ù"), wxT("Ù"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ú"), wxT("Ú"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Û"), wxT("Û"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ü"), wxT("Ü"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Ý"), wxT("Ý"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("Þ"), wxT("Þ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ß"), wxT("ß"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("à"), wxT("à"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("á"), wxT("á"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("â"), wxT("â"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ã"), wxT("ã"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ä"), wxT("ä"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("å"), wxT("å"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("æ"), wxT("æ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ç"), wxT("ç"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("è"), wxT("è"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("é"), wxT("é"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ê"), wxT("ê"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ë"), wxT("ë"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ì"), wxT("ì"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("í"), wxT("í"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("î"), wxT("î"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ï"), wxT("ï"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ð"), wxT("ð"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ñ"), wxT("ñ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ò"), wxT("ò"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ó"), wxT("ó"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ô"), wxT("ô"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("õ"), wxT("õ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ö"), wxT("ö"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("÷"), wxT("÷"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ø"), wxT("ø"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ù"), wxT("ù"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ú"), wxT("ú"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("û"), wxT("û"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ü"), wxT("ü"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ý"), wxT("ý"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("þ"), wxT("þ"), true);
|
|
|
|
|
strDecodedHtml.Replace(wxT("ÿ"), wxT("ÿ"), true);
|
2007-05-29 16:16:33 +00:00
|
|
|
|
#endif
|
- 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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return strDecodedHtml;
|
|
|
|
|
}
|
|
|
|
|
|