2005-01-20 23:22:22 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
2004-09-21 01:30:29 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This 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 2.1 of the License, or (at your option) any later version.
|
2004-09-21 01:30:29 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This software is distributed in the hope that it will be useful,
|
|
|
|
// 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
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma implementation "ViewProjects.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "stdwx.h"
|
2007-02-21 17:06:11 +00:00
|
|
|
#include "str_util.h"
|
2004-09-21 01:30:29 +00:00
|
|
|
#include "BOINCGUIApp.h"
|
2006-10-20 15:00:14 +00:00
|
|
|
#include "BOINCBaseFrame.h"
|
2004-09-21 01:30:29 +00:00
|
|
|
#include "MainDocument.h"
|
2006-06-24 05:00:57 +00:00
|
|
|
#include "AdvancedFrame.h"
|
2004-09-24 22:19:02 +00:00
|
|
|
#include "BOINCTaskCtrl.h"
|
|
|
|
#include "BOINCListCtrl.h"
|
2004-09-21 01:30:29 +00:00
|
|
|
#include "ViewProjects.h"
|
|
|
|
#include "Events.h"
|
|
|
|
|
2004-12-02 07:43:47 +00:00
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
#include "res/proj.xpm"
|
|
|
|
|
|
|
|
|
|
|
|
#define COLUMN_PROJECT 0
|
|
|
|
#define COLUMN_ACCOUNTNAME 1
|
|
|
|
#define COLUMN_TEAMNAME 2
|
|
|
|
#define COLUMN_TOTALCREDIT 3
|
|
|
|
#define COLUMN_AVGCREDIT 4
|
|
|
|
#define COLUMN_RESOURCESHARE 5
|
2004-09-29 22:21:45 +00:00
|
|
|
#define COLUMN_STATUS 6
|
2004-09-21 01:30:29 +00:00
|
|
|
|
2005-04-27 06:32:40 +00:00
|
|
|
// groups that contain buttons
|
|
|
|
#define GRP_TASKS 0
|
|
|
|
#define GRP_WEBSITES 1
|
|
|
|
|
2005-04-21 22:21:54 +00:00
|
|
|
// buttons in the "tasks" area
|
2005-06-24 10:49:42 +00:00
|
|
|
#define BTN_UPDATE 0
|
2005-10-05 19:01:28 +00:00
|
|
|
#define BTN_SUSPEND 1
|
|
|
|
#define BTN_NOWORK 2
|
|
|
|
#define BTN_RESET 3
|
|
|
|
#define BTN_DETACH 4
|
2004-09-21 01:30:29 +00:00
|
|
|
|
2005-04-22 06:06:22 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
CProject::CProject() {
|
2004-12-02 07:43:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
CProject::~CProject() {
|
2004-12-02 07:43:47 +00:00
|
|
|
m_strProjectName.Clear();
|
|
|
|
m_strAccountName.Clear();
|
|
|
|
m_strTeamName.Clear();
|
|
|
|
m_strTotalCredit.Clear();
|
|
|
|
m_strAVGCredit.Clear();
|
|
|
|
m_strResourceShare.Clear();
|
|
|
|
m_strStatus.Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
IMPLEMENT_DYNAMIC_CLASS(CViewProjects, CBOINCBaseView)
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
BEGIN_EVENT_TABLE (CViewProjects, CBOINCBaseView)
|
|
|
|
EVT_BUTTON(ID_TASK_PROJECT_UPDATE, CViewProjects::OnProjectUpdate)
|
|
|
|
EVT_BUTTON(ID_TASK_PROJECT_SUSPEND, CViewProjects::OnProjectSuspend)
|
|
|
|
EVT_BUTTON(ID_TASK_PROJECT_NONEWWORK, CViewProjects::OnProjectNoNewWork)
|
|
|
|
EVT_BUTTON(ID_TASK_PROJECT_RESET, CViewProjects::OnProjectReset)
|
|
|
|
EVT_BUTTON(ID_TASK_PROJECT_DETACH, CViewProjects::OnProjectDetach)
|
2005-04-22 01:46:32 +00:00
|
|
|
EVT_CUSTOM_RANGE(wxEVT_COMMAND_BUTTON_CLICKED, ID_TASK_PROJECT_WEB_PROJDEF_MIN, ID_TASK_PROJECT_WEB_PROJDEF_MAX, CViewProjects::OnProjectWebsiteClicked)
|
2005-04-21 23:14:10 +00:00
|
|
|
EVT_LIST_ITEM_SELECTED(ID_LIST_PROJECTSVIEW, CViewProjects::OnListSelected)
|
|
|
|
EVT_LIST_ITEM_DESELECTED(ID_LIST_PROJECTSVIEW, CViewProjects::OnListDeselected)
|
2005-04-20 22:22:41 +00:00
|
|
|
END_EVENT_TABLE ()
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
|
2005-09-02 18:40:06 +00:00
|
|
|
CViewProjects::CViewProjects()
|
|
|
|
{}
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
CViewProjects::CViewProjects(wxNotebook* pNotebook) :
|
2005-09-06 06:18:36 +00:00
|
|
|
CBOINCBaseView(pNotebook, ID_TASK_PROJECTSVIEW, DEFAULT_TASK_FLAGS, ID_LIST_PROJECTSVIEW, DEFAULT_LIST_SINGLE_SEL_FLAGS)
|
2004-09-21 01:30:29 +00:00
|
|
|
{
|
2005-04-20 22:22:41 +00:00
|
|
|
CTaskItemGroup* pGroup = NULL;
|
|
|
|
CTaskItem* pItem = NULL;
|
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(m_pTaskPane);
|
|
|
|
wxASSERT(m_pListPane);
|
2004-09-21 01:30:29 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2004-12-23 01:06:41 +00:00
|
|
|
//
|
2005-04-20 22:22:41 +00:00
|
|
|
// Setup View
|
2004-12-23 01:06:41 +00:00
|
|
|
//
|
2006-02-08 06:56:34 +00:00
|
|
|
pGroup = new CTaskItemGroup( _("Commands") );
|
2005-04-20 22:22:41 +00:00
|
|
|
m_TaskGroups.push_back( pGroup );
|
|
|
|
|
|
|
|
pItem = new CTaskItem(
|
2005-04-21 23:53:39 +00:00
|
|
|
_("Update"),
|
2006-01-23 11:30:25 +00:00
|
|
|
_("Report all completed tasks, get latest credit, "
|
|
|
|
"get latest preferences, and possibly get more tasks."),
|
2005-04-20 22:22:41 +00:00
|
|
|
ID_TASK_PROJECT_UPDATE
|
|
|
|
);
|
|
|
|
pGroup->m_Tasks.push_back( pItem );
|
2004-12-23 01:06:41 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
pItem = new CTaskItem(
|
2005-04-21 23:53:39 +00:00
|
|
|
_("Suspend"),
|
2006-01-23 11:30:25 +00:00
|
|
|
_("Suspend tasks for this project."),
|
2005-04-20 22:22:41 +00:00
|
|
|
ID_TASK_PROJECT_SUSPEND
|
|
|
|
);
|
|
|
|
pGroup->m_Tasks.push_back( pItem );
|
|
|
|
|
|
|
|
pItem = new CTaskItem(
|
2006-01-23 11:30:25 +00:00
|
|
|
_("No new tasks"),
|
|
|
|
_("Don't get new tasks for this project."),
|
2005-04-20 22:22:41 +00:00
|
|
|
ID_TASK_PROJECT_NONEWWORK
|
|
|
|
);
|
|
|
|
pGroup->m_Tasks.push_back( pItem );
|
2004-12-23 01:06:41 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
pItem = new CTaskItem(
|
|
|
|
_("Reset project"),
|
2006-01-23 11:30:25 +00:00
|
|
|
_("Delete all files and tasks associated with this project, "
|
|
|
|
"and get new tasks. "
|
2005-04-20 22:22:41 +00:00
|
|
|
"You can update the project "
|
2006-01-23 11:30:25 +00:00
|
|
|
"first to report any completed tasks."),
|
2005-04-20 22:22:41 +00:00
|
|
|
ID_TASK_PROJECT_RESET
|
|
|
|
);
|
|
|
|
pGroup->m_Tasks.push_back( pItem );
|
2004-12-23 01:06:41 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
pItem = new CTaskItem(
|
2005-04-21 23:53:39 +00:00
|
|
|
_("Detach"),
|
2005-09-10 04:37:27 +00:00
|
|
|
_("Detach computer from this project. "
|
2006-01-23 11:30:25 +00:00
|
|
|
"Tasks in progress will be lost "
|
|
|
|
"(use 'Update' first to report any completed tasks)."),
|
2005-04-20 22:22:41 +00:00
|
|
|
ID_TASK_PROJECT_DETACH
|
|
|
|
);
|
|
|
|
pGroup->m_Tasks.push_back( pItem );
|
2004-12-23 01:06:41 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
// Create Task Pane Items
|
2005-04-21 23:14:10 +00:00
|
|
|
m_pTaskPane->UpdateControls();
|
2005-04-20 22:22:41 +00:00
|
|
|
|
|
|
|
// Create List Pane Items
|
2004-10-19 19:41:29 +00:00
|
|
|
m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 150);
|
|
|
|
m_pListPane->InsertColumn(COLUMN_ACCOUNTNAME, _("Account"), wxLIST_FORMAT_LEFT, 80);
|
|
|
|
m_pListPane->InsertColumn(COLUMN_TEAMNAME, _("Team"), wxLIST_FORMAT_LEFT, 80);
|
2006-02-09 21:51:07 +00:00
|
|
|
m_pListPane->InsertColumn(COLUMN_TOTALCREDIT, _("Work done"), wxLIST_FORMAT_RIGHT, 80);
|
|
|
|
m_pListPane->InsertColumn(COLUMN_AVGCREDIT, _("Avg. work done"), wxLIST_FORMAT_RIGHT, 80);
|
2004-12-19 20:35:37 +00:00
|
|
|
m_pListPane->InsertColumn(COLUMN_RESOURCESHARE, _("Resource share"), wxLIST_FORMAT_CENTRE, 85);
|
2004-10-19 19:41:29 +00:00
|
|
|
m_pListPane->InsertColumn(COLUMN_STATUS, _("Status"), wxLIST_FORMAT_LEFT, 150);
|
2005-04-21 23:53:39 +00:00
|
|
|
|
|
|
|
UpdateSelection();
|
2004-09-21 01:30:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
CViewProjects::~CViewProjects() {
|
2005-02-01 00:54:06 +00:00
|
|
|
EmptyCache();
|
2005-04-21 06:04:26 +00:00
|
|
|
EmptyTasks();
|
2004-09-21 01:30:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-02 21:03:36 +00:00
|
|
|
wxString& CViewProjects::GetViewName() {
|
2005-09-02 20:56:08 +00:00
|
|
|
static wxString strViewName(_("Projects"));
|
|
|
|
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
|
|
|
wxString& CViewProjects::GetViewDisplayName() {
|
|
|
|
static wxString strViewName(_("Projects"));
|
|
|
|
return strViewName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
const char** CViewProjects::GetViewIcon() {
|
2004-09-21 01:30:29 +00:00
|
|
|
return proj_xpm;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-07 22:26:49 +00:00
|
|
|
void CViewProjects::OnProjectUpdate( wxCommandEvent& WXUNUSED(event) ) {
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectUpdate - Function Begin"));
|
|
|
|
|
- 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
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pDoc);
|
2005-04-20 22:22:41 +00:00
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pFrame);
|
2006-06-24 05:00:57 +00:00
|
|
|
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
|
2005-04-20 22:22:41 +00:00
|
|
|
|
|
|
|
pFrame->UpdateStatusText(_("Updating project..."));
|
|
|
|
pDoc->ProjectUpdate(m_pListPane->GetFirstSelected());
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
|
2005-09-30 09:00:50 +00:00
|
|
|
m_bForceUpdateSelection = true;
|
2005-04-21 23:14:10 +00:00
|
|
|
UpdateSelection();
|
2006-02-17 20:59:15 +00:00
|
|
|
pFrame->ResetReminderTimers();
|
2005-05-05 06:07:14 +00:00
|
|
|
pFrame->FireRefreshView();
|
2005-04-21 23:14:10 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectUpdate - Function End"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-07 22:26:49 +00:00
|
|
|
void CViewProjects::OnProjectSuspend( wxCommandEvent& WXUNUSED(event) ) {
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectSuspend - Function Begin"));
|
|
|
|
|
- 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
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pDoc);
|
2005-04-20 22:22:41 +00:00
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pFrame);
|
2006-06-24 05:00:57 +00:00
|
|
|
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(m_pListPane);
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-04-21 23:53:39 +00:00
|
|
|
PROJECT* project = pDoc->project(m_pListPane->GetFirstSelected());
|
|
|
|
if (project->suspended_via_gui) {
|
|
|
|
pFrame->UpdateStatusText(_("Resuming project..."));
|
|
|
|
pDoc->ProjectResume(m_pListPane->GetFirstSelected());
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
} else {
|
|
|
|
pFrame->UpdateStatusText(_("Suspending project..."));
|
|
|
|
pDoc->ProjectSuspend(m_pListPane->GetFirstSelected());
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
}
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-09-30 09:00:50 +00:00
|
|
|
m_bForceUpdateSelection = true;
|
2005-04-21 23:14:10 +00:00
|
|
|
UpdateSelection();
|
2005-05-05 06:07:14 +00:00
|
|
|
pFrame->FireRefreshView();
|
2005-04-21 23:14:10 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectSuspend - Function End"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-07 22:26:49 +00:00
|
|
|
void CViewProjects::OnProjectNoNewWork( wxCommandEvent& WXUNUSED(event) ) {
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectNoNewWork - Function Begin"));
|
|
|
|
|
- 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
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pDoc);
|
2005-04-20 22:22:41 +00:00
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pFrame);
|
2006-06-24 05:00:57 +00:00
|
|
|
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(m_pListPane);
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-04-21 23:53:39 +00:00
|
|
|
PROJECT* project = pDoc->project(m_pListPane->GetFirstSelected());
|
|
|
|
if (project->dont_request_more_work) {
|
2006-01-23 11:30:25 +00:00
|
|
|
pFrame->UpdateStatusText(_("Telling project to allow additional task downloads..."));
|
2005-04-21 23:53:39 +00:00
|
|
|
pDoc->ProjectAllowMoreWork(m_pListPane->GetFirstSelected());
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
} else {
|
2006-01-23 11:30:25 +00:00
|
|
|
pFrame->UpdateStatusText(_("Telling project to not fetch any additional tasks..."));
|
2005-04-21 23:53:39 +00:00
|
|
|
pDoc->ProjectNoMoreWork(m_pListPane->GetFirstSelected());
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
}
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-09-30 09:00:50 +00:00
|
|
|
m_bForceUpdateSelection = true;
|
2005-04-21 23:14:10 +00:00
|
|
|
UpdateSelection();
|
2005-05-05 06:07:14 +00:00
|
|
|
pFrame->FireRefreshView();
|
2005-04-21 23:14:10 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectNoNewWork - Function End"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-07-07 22:26:49 +00:00
|
|
|
void CViewProjects::OnProjectReset( wxCommandEvent& WXUNUSED(event) ) {
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectReset - Function Begin"));
|
|
|
|
|
- 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
|
|
|
wxInt32 iAnswer = 0;
|
|
|
|
wxString strMessage = wxEmptyString;
|
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
|
|
|
|
CProject* pProject = NULL;
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pDoc);
|
2005-04-20 22:22:41 +00:00
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pFrame);
|
2006-06-24 05:00:57 +00:00
|
|
|
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2006-06-22 10:10:51 +00:00
|
|
|
if (!pDoc->IsUserAuthorized())
|
|
|
|
return;
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
pFrame->UpdateStatusText(_("Resetting project..."));
|
|
|
|
|
- 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
|
|
|
pProject = m_ProjectCache.at(m_pListPane->GetFirstSelected());
|
2005-04-20 22:22:41 +00:00
|
|
|
|
|
|
|
strMessage.Printf(
|
|
|
|
_("Are you sure you want to reset project '%s'?"),
|
- 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
|
|
|
pProject->m_strProjectName.c_str()
|
2005-04-27 06:55:28 +00:00
|
|
|
);
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-06-24 10:49:42 +00:00
|
|
|
iAnswer = ::wxMessageBox(
|
2005-04-20 22:22:41 +00:00
|
|
|
strMessage,
|
|
|
|
_("Reset Project"),
|
2005-06-24 10:49:42 +00:00
|
|
|
wxYES_NO | wxICON_QUESTION,
|
2005-04-20 22:22:41 +00:00
|
|
|
this
|
|
|
|
);
|
|
|
|
|
|
|
|
if (wxYES == iAnswer) {
|
|
|
|
pDoc->ProjectReset(m_pListPane->GetFirstSelected());
|
|
|
|
}
|
|
|
|
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
|
2005-09-30 09:00:50 +00:00
|
|
|
m_bForceUpdateSelection = true;
|
2005-04-21 23:14:10 +00:00
|
|
|
UpdateSelection();
|
2005-05-05 06:07:14 +00:00
|
|
|
pFrame->FireRefreshView();
|
2005-04-21 23:14:10 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectReset - Function End"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-07 22:26:49 +00:00
|
|
|
void CViewProjects::OnProjectDetach( wxCommandEvent& WXUNUSED(event) ) {
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectDetach - Function Begin"));
|
|
|
|
|
- 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
|
|
|
wxInt32 iAnswer = 0;
|
|
|
|
wxString strMessage = wxEmptyString;
|
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
|
|
|
|
CProject* pProject = NULL;
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pDoc);
|
2005-04-20 22:22:41 +00:00
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pFrame);
|
2006-06-24 05:00:57 +00:00
|
|
|
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
|
2005-04-20 22:22:41 +00:00
|
|
|
|
2006-06-22 10:10:51 +00:00
|
|
|
if (!pDoc->IsUserAuthorized())
|
|
|
|
return;
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
pFrame->UpdateStatusText(_("Detaching from project..."));
|
|
|
|
|
- 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
|
|
|
pProject = m_ProjectCache.at(m_pListPane->GetFirstSelected());
|
2005-04-20 22:22:41 +00:00
|
|
|
|
|
|
|
strMessage.Printf(
|
|
|
|
_("Are you sure you want to detach from project '%s'?"),
|
- 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
|
|
|
pProject->m_strProjectName.c_str()
|
2005-04-20 22:22:41 +00:00
|
|
|
);
|
|
|
|
|
2005-06-24 10:49:42 +00:00
|
|
|
iAnswer = ::wxMessageBox(
|
2005-04-20 22:22:41 +00:00
|
|
|
strMessage,
|
|
|
|
_("Detach from Project"),
|
2005-06-24 10:49:42 +00:00
|
|
|
wxYES_NO | wxICON_QUESTION,
|
2005-04-20 22:22:41 +00:00
|
|
|
this
|
|
|
|
);
|
|
|
|
|
|
|
|
if (wxYES == iAnswer) {
|
|
|
|
pDoc->ProjectDetach(m_pListPane->GetFirstSelected());
|
|
|
|
}
|
|
|
|
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
|
2005-09-30 09:00:50 +00:00
|
|
|
m_bForceUpdateSelection = true;
|
2005-04-21 23:14:10 +00:00
|
|
|
UpdateSelection();
|
2005-05-05 06:07:14 +00:00
|
|
|
pFrame->FireRefreshView();
|
2005-04-21 23:14:10 +00:00
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectDetach - Function End"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-22 06:37:14 +00:00
|
|
|
void CViewProjects::OnProjectWebsiteClicked( wxEvent& event ) {
|
2005-04-22 01:46:32 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectWebsiteClicked - Function Begin"));
|
2004-10-26 08:41:02 +00:00
|
|
|
|
2006-06-24 05:00:57 +00:00
|
|
|
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
|
2004-10-26 08:41:02 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pFrame);
|
2006-06-24 05:00:57 +00:00
|
|
|
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
|
2004-10-26 08:41:02 +00:00
|
|
|
|
2005-04-22 01:46:32 +00:00
|
|
|
pFrame->UpdateStatusText(_("Launching browser..."));
|
2004-10-26 08:41:02 +00:00
|
|
|
|
2005-04-22 01:46:32 +00:00
|
|
|
int website_task_index = event.GetId() - ID_TASK_PROJECT_WEB_PROJDEF_MIN;
|
|
|
|
pFrame->ExecuteBrowserLink(
|
|
|
|
m_TaskGroups[1]->m_Tasks[website_task_index]->m_strWebSiteLink
|
2005-04-27 06:55:28 +00:00
|
|
|
);
|
2005-04-21 23:14:10 +00:00
|
|
|
|
2005-04-22 01:46:32 +00:00
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
2005-04-21 23:14:10 +00:00
|
|
|
|
|
|
|
UpdateSelection();
|
2005-05-05 06:07:14 +00:00
|
|
|
pFrame->FireRefreshView();
|
2005-04-21 23:14:10 +00:00
|
|
|
|
2005-04-22 01:46:32 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectWebsiteClicked - Function End"));
|
2005-04-21 23:14:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-22 01:46:32 +00:00
|
|
|
wxInt32 CViewProjects::GetDocCount() {
|
2006-04-17 20:26:59 +00:00
|
|
|
return wxGetApp().GetDocument()->GetProjectCount();
|
2005-04-21 23:14:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxString CViewProjects::OnListGetItemText(long item, long column) const {
|
2005-11-02 18:28:45 +00:00
|
|
|
CProject* project = NULL;
|
2004-12-02 07:43:47 +00:00
|
|
|
wxString strBuffer = wxEmptyString;
|
2004-10-21 21:19:49 +00:00
|
|
|
|
2005-11-02 18:28:45 +00:00
|
|
|
try {
|
|
|
|
project = m_ProjectCache.at(item);
|
|
|
|
} catch ( std::out_of_range ) {
|
|
|
|
project = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (project) {
|
|
|
|
switch(column) {
|
|
|
|
case COLUMN_PROJECT:
|
|
|
|
strBuffer = project->m_strProjectName;
|
|
|
|
break;
|
|
|
|
case COLUMN_ACCOUNTNAME:
|
|
|
|
strBuffer = project->m_strAccountName;
|
|
|
|
break;
|
|
|
|
case COLUMN_TEAMNAME:
|
|
|
|
strBuffer = project->m_strTeamName;
|
|
|
|
break;
|
|
|
|
case COLUMN_TOTALCREDIT:
|
|
|
|
strBuffer = project->m_strTotalCredit;
|
|
|
|
break;
|
|
|
|
case COLUMN_AVGCREDIT:
|
|
|
|
strBuffer = project->m_strAVGCredit;
|
|
|
|
break;
|
|
|
|
case COLUMN_RESOURCESHARE:
|
|
|
|
strBuffer = project->m_strResourceShare;
|
|
|
|
break;
|
|
|
|
case COLUMN_STATUS:
|
|
|
|
strBuffer = project->m_strStatus;
|
|
|
|
break;
|
|
|
|
}
|
2004-12-02 07:43:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return strBuffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxString CViewProjects::OnDocGetItemText(long item, long column) const {
|
2004-12-02 07:43:47 +00:00
|
|
|
wxString strBuffer = wxEmptyString;
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
switch(column) {
|
2005-04-17 02:10:52 +00:00
|
|
|
case COLUMN_PROJECT:
|
2005-06-13 08:47:51 +00:00
|
|
|
FormatProjectName(item, strBuffer);
|
2005-04-17 02:10:52 +00:00
|
|
|
break;
|
|
|
|
case COLUMN_ACCOUNTNAME:
|
|
|
|
FormatAccountName(item, strBuffer);
|
|
|
|
break;
|
|
|
|
case COLUMN_TEAMNAME:
|
|
|
|
FormatTeamName(item, strBuffer);
|
|
|
|
break;
|
|
|
|
case COLUMN_TOTALCREDIT:
|
|
|
|
FormatTotalCredit(item, strBuffer);
|
|
|
|
break;
|
|
|
|
case COLUMN_AVGCREDIT:
|
|
|
|
FormatAVGCredit(item, strBuffer);
|
|
|
|
break;
|
|
|
|
case COLUMN_RESOURCESHARE:
|
|
|
|
FormatResourceShare(item, strBuffer);
|
|
|
|
break;
|
|
|
|
case COLUMN_STATUS:
|
|
|
|
FormatStatus(item, strBuffer);
|
|
|
|
break;
|
2004-09-21 01:30:29 +00:00
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
return strBuffer;
|
|
|
|
}
|
|
|
|
|
2004-09-22 21:53:07 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::AddCacheElement() {
|
2004-12-02 07:43:47 +00:00
|
|
|
CProject* pItem = new CProject();
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pItem);
|
|
|
|
if (pItem) {
|
2005-04-07 07:04:50 +00:00
|
|
|
m_ProjectCache.push_back(pItem);
|
2004-12-02 07:43:47 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-17 02:10:52 +00:00
|
|
|
wxInt32 CViewProjects::EmptyCache() {
|
2005-01-29 00:58:43 +00:00
|
|
|
unsigned int i;
|
|
|
|
for (i=0; i<m_ProjectCache.size(); i++) {
|
|
|
|
delete m_ProjectCache[i];
|
|
|
|
}
|
|
|
|
m_ProjectCache.clear();
|
2004-12-02 07:43:47 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::GetCacheCount() {
|
2006-07-21 08:23:26 +00:00
|
|
|
return (wxInt32)m_ProjectCache.size();
|
2004-12-02 07:43:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::RemoveCacheElement() {
|
2005-01-29 21:30:45 +00:00
|
|
|
delete m_ProjectCache.back();
|
2005-04-07 07:04:50 +00:00
|
|
|
m_ProjectCache.erase(m_ProjectCache.end() - 1);
|
2004-12-02 07:43:47 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::UpdateCache(long item, long column, wxString& strNewData) {
|
|
|
|
CProject* project = m_ProjectCache.at(item);
|
2004-12-02 07:43:47 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
switch(column) {
|
2005-06-13 08:47:51 +00:00
|
|
|
case COLUMN_PROJECT:
|
|
|
|
project->m_strProjectName = strNewData;
|
|
|
|
break;
|
|
|
|
case COLUMN_ACCOUNTNAME:
|
|
|
|
project->m_strAccountName = strNewData;
|
|
|
|
break;
|
|
|
|
case COLUMN_TEAMNAME:
|
|
|
|
project->m_strTeamName = strNewData;
|
|
|
|
break;
|
|
|
|
case COLUMN_TOTALCREDIT:
|
|
|
|
project->m_strTotalCredit = strNewData;
|
|
|
|
break;
|
|
|
|
case COLUMN_AVGCREDIT:
|
|
|
|
project->m_strAVGCredit = strNewData;
|
|
|
|
break;
|
|
|
|
case COLUMN_RESOURCESHARE:
|
|
|
|
project->m_strResourceShare = strNewData;
|
|
|
|
break;
|
|
|
|
case COLUMN_STATUS:
|
|
|
|
project->m_strStatus = strNewData;
|
|
|
|
break;
|
2004-12-02 07:43:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
void CViewProjects::UpdateSelection() {
|
2005-04-22 01:46:32 +00:00
|
|
|
CTaskItemGroup* pGroup = NULL;
|
|
|
|
PROJECT* project = NULL;
|
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pDoc);
|
2005-04-22 01:46:32 +00:00
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
2005-07-24 08:35:57 +00:00
|
|
|
wxASSERT(m_pTaskPane);
|
2006-01-09 14:03:13 +00:00
|
|
|
wxASSERT(m_pListPane);
|
|
|
|
|
|
|
|
|
|
|
|
CBOINCBaseView::PreUpdateSelection();
|
|
|
|
|
2005-04-22 01:46:32 +00:00
|
|
|
|
2005-04-21 23:14:10 +00:00
|
|
|
// Update the tasks static box buttons
|
2005-04-27 06:32:40 +00:00
|
|
|
//
|
2005-04-22 01:46:32 +00:00
|
|
|
pGroup = m_TaskGroups[0];
|
2005-04-27 06:32:40 +00:00
|
|
|
if (m_pListPane->GetSelectedItemCount()) {
|
2005-04-22 01:46:32 +00:00
|
|
|
project = pDoc->project(m_pListPane->GetFirstSelected());
|
2005-04-27 06:32:40 +00:00
|
|
|
m_pTaskPane->EnableTask(pGroup->m_Tasks[BTN_UPDATE]);
|
|
|
|
m_pTaskPane->EnableTask(pGroup->m_Tasks[BTN_SUSPEND]);
|
2005-08-26 06:50:46 +00:00
|
|
|
if (project) {
|
|
|
|
if (project->suspended_via_gui) {
|
|
|
|
m_pTaskPane->UpdateTask(
|
2006-01-23 11:30:25 +00:00
|
|
|
pGroup->m_Tasks[BTN_SUSPEND], _("Resume"), _("Resume tasks for this project.")
|
2005-08-26 06:50:46 +00:00
|
|
|
);
|
|
|
|
} else {
|
|
|
|
m_pTaskPane->UpdateTask(
|
2006-01-23 11:30:25 +00:00
|
|
|
pGroup->m_Tasks[BTN_SUSPEND], _("Suspend"), _("Suspend tasks for this project.")
|
2005-08-26 06:50:46 +00:00
|
|
|
);
|
|
|
|
}
|
2005-04-21 22:21:54 +00:00
|
|
|
}
|
2005-04-27 06:32:40 +00:00
|
|
|
m_pTaskPane->EnableTask(pGroup->m_Tasks[BTN_NOWORK]);
|
2005-08-26 06:50:46 +00:00
|
|
|
if (project) {
|
|
|
|
if (project->dont_request_more_work) {
|
|
|
|
m_pTaskPane->UpdateTask(
|
2006-01-23 11:30:25 +00:00
|
|
|
pGroup->m_Tasks[BTN_NOWORK], _("Allow new tasks"), _("Allow fetching new tasks for this project.")
|
2005-08-26 06:50:46 +00:00
|
|
|
);
|
|
|
|
} else {
|
|
|
|
m_pTaskPane->UpdateTask(
|
2006-01-23 11:30:25 +00:00
|
|
|
pGroup->m_Tasks[BTN_NOWORK], _("No new tasks"), _("Don't fetch new tasks for this project.")
|
2005-08-26 06:50:46 +00:00
|
|
|
);
|
|
|
|
}
|
2005-04-21 22:21:54 +00:00
|
|
|
}
|
2005-04-27 06:32:40 +00:00
|
|
|
m_pTaskPane->EnableTask(pGroup->m_Tasks[BTN_RESET]);
|
2007-01-29 23:23:26 +00:00
|
|
|
if (project && project->attached_via_acct_mgr) {
|
2006-02-14 21:47:18 +00:00
|
|
|
m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_DETACH]);
|
2006-02-14 22:50:32 +00:00
|
|
|
} else {
|
|
|
|
m_pTaskPane->EnableTask(pGroup->m_Tasks[BTN_DETACH]);
|
2006-02-14 21:47:18 +00:00
|
|
|
}
|
2005-04-27 06:32:40 +00:00
|
|
|
|
2006-01-09 14:03:13 +00:00
|
|
|
CBOINCBaseView::UpdateWebsiteSelection(GRP_WEBSITES, project);
|
2005-07-22 20:19:58 +00:00
|
|
|
|
2006-01-09 14:03:13 +00:00
|
|
|
} else {
|
|
|
|
m_pTaskPane->DisableTaskGroupTasks(pGroup);
|
2005-04-22 01:46:32 +00:00
|
|
|
}
|
2005-04-27 06:32:40 +00:00
|
|
|
|
2006-01-09 14:03:13 +00:00
|
|
|
CBOINCBaseView::PostUpdateSelection();
|
2004-09-24 02:01:53 +00:00
|
|
|
}
|
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
|
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
wxInt32 CViewProjects::FormatProjectName(wxInt32 item, wxString& strBuffer) const {
|
|
|
|
PROJECT* project = wxGetApp().GetDocument()->project(item);
|
|
|
|
std::string project_name;
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (project) {
|
|
|
|
project->get_name(project_name);
|
- 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
|
|
|
strBuffer = HtmlEntityDecode(wxString(project_name.c_str(), wxConvUTF8));
|
2005-06-13 08:47:51 +00:00
|
|
|
}
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
|
|
|
|
wxInt32 CViewProjects::FormatAccountName(wxInt32 item, wxString& strBuffer) const {
|
|
|
|
PROJECT* project = wxGetApp().GetDocument()->project(item);
|
|
|
|
|
|
|
|
if (project) {
|
- 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
|
|
|
strBuffer = HtmlEntityDecode(wxString(project->user_name.c_str(), wxConvUTF8));
|
2005-06-13 08:47:51 +00:00
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::FormatTeamName(wxInt32 item, wxString& strBuffer) const {
|
2005-06-13 08:47:51 +00:00
|
|
|
PROJECT* project = wxGetApp().GetDocument()->project(item);
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (project) {
|
- 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
|
|
|
strBuffer = HtmlEntityDecode(wxString(project->team_name.c_str(), wxConvUTF8));
|
2005-06-13 08:47:51 +00:00
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::FormatTotalCredit(wxInt32 item, wxString& strBuffer) const {
|
2005-06-13 08:47:51 +00:00
|
|
|
PROJECT* project = wxGetApp().GetDocument()->project(item);
|
2004-10-05 02:55:26 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (project) {
|
|
|
|
strBuffer.Printf(wxT("%0.2f"), project->user_total_credit);
|
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::FormatAVGCredit(wxInt32 item, wxString& strBuffer) const {
|
2005-06-13 08:47:51 +00:00
|
|
|
PROJECT* project = wxGetApp().GetDocument()->project(item);
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (project) {
|
|
|
|
strBuffer.Printf(wxT("%0.2f"), project->user_expavg_credit);
|
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::FormatResourceShare(wxInt32 item, wxString& strBuffer) const {
|
2004-10-09 03:05:01 +00:00
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
2005-06-13 08:47:51 +00:00
|
|
|
PROJECT* project = wxGetApp().GetDocument()->project(item);
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pDoc);
|
2004-10-09 03:05:01 +00:00
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
2004-10-05 02:55:26 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (project && pDoc) {
|
|
|
|
strBuffer.Printf(wxT("%0.0f (%0.2f%%)"),
|
|
|
|
project->resource_share,
|
|
|
|
((project->resource_share / pDoc->m_fProjectTotalResourceShare) * 100)
|
|
|
|
);
|
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-10 19:38:48 +00:00
|
|
|
wxInt32 CViewProjects::FormatStatus(wxInt32 item, wxString& status) const {
|
2005-06-13 08:47:51 +00:00
|
|
|
PROJECT* project = wxGetApp().GetDocument()->project(item);
|
2004-10-05 02:55:26 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (project) {
|
|
|
|
if (project->suspended_via_gui) {
|
|
|
|
append_to_status(status, _("Suspended by user"));
|
|
|
|
}
|
|
|
|
if (project->dont_request_more_work) {
|
2006-01-23 11:30:25 +00:00
|
|
|
append_to_status(status, _("Won't get new tasks"));
|
2005-06-13 08:47:51 +00:00
|
|
|
}
|
2007-05-24 16:07:21 +00:00
|
|
|
if (project->ended) {
|
|
|
|
append_to_status(status, _("Project ended - OK to detach"));
|
|
|
|
}
|
2007-03-23 18:51:08 +00:00
|
|
|
if (project->detach_when_done) {
|
2007-05-24 16:07:21 +00:00
|
|
|
append_to_status(status, _("Will detach when tasks done"));
|
2007-03-23 18:51:08 +00:00
|
|
|
}
|
2005-06-13 08:47:51 +00:00
|
|
|
if (project->sched_rpc_pending) {
|
2006-09-01 22:32:51 +00:00
|
|
|
append_to_status(status, _("Scheduler request pending"));
|
2006-09-05 23:10:10 +00:00
|
|
|
append_to_status(status, wxString(rpc_reason_string(project->sched_rpc_pending), wxConvUTF8));
|
2005-06-13 08:47:51 +00:00
|
|
|
}
|
2007-05-11 18:27:16 +00:00
|
|
|
if (project->scheduler_rpc_in_progress) {
|
2007-05-11 18:34:14 +00:00
|
|
|
append_to_status(status, _("Scheduler request in progress"));
|
2007-05-11 18:27:16 +00:00
|
|
|
}
|
2005-06-13 08:47:51 +00:00
|
|
|
wxDateTime dtNextRPC((time_t)project->min_rpc_time);
|
|
|
|
wxDateTime dtNow(wxDateTime::Now());
|
|
|
|
if (dtNextRPC > dtNow) {
|
|
|
|
wxTimeSpan tsNextRPC(dtNextRPC - dtNow);
|
|
|
|
append_to_status(status, _("Communication deferred ") + tsNextRPC.Format());
|
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
bool CViewProjects::IsWebsiteLink(const wxString& strLink) {
|
2004-10-09 03:05:01 +00:00
|
|
|
bool bReturnValue = false;
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
if (strLink.StartsWith(wxT("web:")))
|
2004-10-09 03:05:01 +00:00
|
|
|
bReturnValue = true;
|
|
|
|
|
|
|
|
return bReturnValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::ConvertWebsiteIndexToLink(wxInt32 iProjectIndex, wxInt32 iWebsiteIndex, wxString& strLink) {
|
2005-04-20 22:22:41 +00:00
|
|
|
strLink.Printf(wxT("web:%d:%d"), iProjectIndex, iWebsiteIndex);
|
2004-10-09 03:05:01 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewProjects::ConvertLinkToWebsiteIndex(const wxString& strLink, wxInt32& iProjectIndex, wxInt32& iWebsiteIndex) {
|
2004-10-09 03:05:01 +00:00
|
|
|
wxString strTemplate = strLink;
|
|
|
|
wxString strBuffer = wxEmptyString;
|
|
|
|
|
2005-04-20 22:22:41 +00:00
|
|
|
strTemplate.Replace(wxT("web:"), wxEmptyString);
|
2004-10-09 03:05:01 +00:00
|
|
|
|
|
|
|
strBuffer = strTemplate;
|
2005-04-07 07:04:50 +00:00
|
|
|
strBuffer.Remove(strBuffer.Find(wxT(":")));
|
|
|
|
strBuffer.ToLong((long*) &iProjectIndex);
|
2004-10-09 03:05:01 +00:00
|
|
|
|
|
|
|
strBuffer = strTemplate;
|
2005-04-07 07:04:50 +00:00
|
|
|
strBuffer = strBuffer.Mid(strBuffer.Find(wxT(":")) + 1);
|
|
|
|
strBuffer.ToLong((long*) &iWebsiteIndex);
|
2004-10-09 03:05:01 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-02 18:29:53 +00:00
|
|
|
const char *BOINC_RCSID_b4edf777fc = "$Id$";
|