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-05-17 22:15:10 +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-04-10 09:11:03 +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-05-17 22:15:10 +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-04-10 09:11:03 +00:00
|
|
|
|
2004-04-11 04:37:10 +00:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
2004-09-21 01:30:29 +00:00
|
|
|
#pragma implementation "ViewMessages.h"
|
2004-04-11 04:37:10 +00:00
|
|
|
#endif
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
#include "stdwx.h"
|
2004-08-11 23:52:22 +00:00
|
|
|
#include "BOINCGUIApp.h"
|
2006-10-20 15:00:14 +00:00
|
|
|
#include "BOINCBaseFrame.h"
|
2004-08-11 23:52:22 +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 "ViewMessages.h"
|
2004-07-13 05:56:03 +00:00
|
|
|
#include "Events.h"
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-12-02 07:43:47 +00:00
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
#include "res/mess.xpm"
|
2004-09-24 22:19:02 +00:00
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
#define COLUMN_PROJECT 0
|
|
|
|
#define COLUMN_TIME 1
|
|
|
|
#define COLUMN_MESSAGE 2
|
|
|
|
|
2006-03-27 03:44:13 +00:00
|
|
|
// buttons in the "tasks" area
|
|
|
|
#define BTN_COPYALL 0
|
|
|
|
#define BTN_COPYSELECTED 1
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
IMPLEMENT_DYNAMIC_CLASS(CViewMessages, CBOINCBaseView)
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
BEGIN_EVENT_TABLE (CViewMessages, CBOINCBaseView)
|
|
|
|
EVT_BUTTON(ID_TASK_MESSAGES_COPYALL, CViewMessages::OnMessagesCopyAll)
|
|
|
|
EVT_BUTTON(ID_TASK_MESSAGES_COPYSELECTED, CViewMessages::OnMessagesCopySelected)
|
2005-04-21 23:14:10 +00:00
|
|
|
EVT_LIST_ITEM_SELECTED(ID_LIST_MESSAGESVIEW, CViewMessages::OnListSelected)
|
|
|
|
EVT_LIST_ITEM_DESELECTED(ID_LIST_MESSAGESVIEW, CViewMessages::OnListDeselected)
|
2005-04-21 06:04:26 +00:00
|
|
|
END_EVENT_TABLE ()
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-09-02 18:40:06 +00:00
|
|
|
CViewMessages::CViewMessages()
|
|
|
|
{}
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
CViewMessages::CViewMessages(wxNotebook* pNotebook) :
|
2005-09-06 06:18:36 +00:00
|
|
|
CBOINCBaseView(pNotebook, ID_TASK_MESSAGESVIEW, DEFAULT_TASK_FLAGS, ID_LIST_MESSAGESVIEW, DEFAULT_LIST_MULTI_SEL_FLAGS)
|
2005-04-21 06:04:26 +00:00
|
|
|
{
|
|
|
|
CTaskItemGroup* pGroup = NULL;
|
|
|
|
CTaskItem* pItem = NULL;
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
wxASSERT(m_pTaskPane);
|
|
|
|
wxASSERT(m_pListPane);
|
2004-09-21 01:30:29 +00:00
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
|
2005-02-02 22:20:25 +00:00
|
|
|
//
|
|
|
|
// Initialize variables used in later parts of the class
|
|
|
|
//
|
|
|
|
m_iPreviousDocCount = 0;
|
|
|
|
|
|
|
|
|
2004-12-23 01:06:41 +00:00
|
|
|
//
|
2005-04-21 06:04:26 +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-21 06:04:26 +00:00
|
|
|
m_TaskGroups.push_back( pGroup );
|
2004-12-23 01:06:41 +00:00
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
pItem = new CTaskItem(
|
|
|
|
_("Copy all messages"),
|
|
|
|
_("Copy all the messages to the clipboard."),
|
|
|
|
ID_TASK_MESSAGES_COPYALL
|
|
|
|
);
|
|
|
|
pGroup->m_Tasks.push_back( pItem );
|
2004-12-23 01:06:41 +00:00
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
pItem = new CTaskItem(
|
|
|
|
_("Copy selected messages"),
|
2006-11-19 12:18:17 +00:00
|
|
|
#ifdef __WXMAC__
|
2005-04-21 06:04:26 +00:00
|
|
|
_("Copy the selected messages to the clipboard. "
|
2004-12-23 01:06:41 +00:00
|
|
|
"You can select multiple messages by holding down the shift "
|
2006-11-17 10:55:17 +00:00
|
|
|
"or command key while clicking on messages."),
|
|
|
|
#else
|
2006-11-19 12:18:17 +00:00
|
|
|
_("Copy the selected messages to the clipboard. "
|
|
|
|
"You can select multiple messages by holding down the shift "
|
2005-04-21 06:04:26 +00:00
|
|
|
"or control key while clicking on messages."),
|
2006-11-17 10:55:17 +00:00
|
|
|
#endif
|
2005-04-21 06:04:26 +00:00
|
|
|
ID_TASK_MESSAGES_COPYSELECTED
|
|
|
|
);
|
|
|
|
pGroup->m_Tasks.push_back( pItem );
|
2004-09-24 22:19:02 +00:00
|
|
|
|
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
// Create Task Pane Items
|
2005-04-21 23:14:10 +00:00
|
|
|
m_pTaskPane->UpdateControls();
|
2004-09-24 22:19:02 +00:00
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
// Create List Pane Items
|
2004-10-19 19:41:29 +00:00
|
|
|
m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 115);
|
|
|
|
m_pListPane->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 145);
|
|
|
|
m_pListPane->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 550);
|
2004-09-24 22:19:02 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
m_pMessageInfoAttr = new wxListItemAttr(*wxBLACK, *wxWHITE, wxNullFont);
|
|
|
|
m_pMessageErrorAttr = new wxListItemAttr(*wxRED, *wxWHITE, wxNullFont);
|
2005-04-22 01:46:32 +00:00
|
|
|
|
|
|
|
UpdateSelection();
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
CViewMessages::~CViewMessages() {
|
|
|
|
if (m_pMessageInfoAttr) {
|
2004-09-29 22:21:45 +00:00
|
|
|
delete m_pMessageInfoAttr;
|
|
|
|
m_pMessageInfoAttr = NULL;
|
|
|
|
}
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
if (m_pMessageErrorAttr) {
|
2004-09-29 22:21:45 +00:00
|
|
|
delete m_pMessageErrorAttr;
|
|
|
|
m_pMessageErrorAttr = NULL;
|
|
|
|
}
|
2005-04-21 06:04:26 +00:00
|
|
|
EmptyTasks();
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-02 21:03:36 +00:00
|
|
|
wxString& CViewMessages::GetViewName() {
|
2005-09-02 20:56:08 +00:00
|
|
|
static wxString strViewName(_("Messages"));
|
|
|
|
return strViewName;
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
2004-04-11 05:09:18 +00:00
|
|
|
|
2004-04-13 00:33:40 +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& CViewMessages::GetViewDisplayName() {
|
|
|
|
static wxString strViewName(_("Messages"));
|
|
|
|
return strViewName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
const char** CViewMessages::GetViewIcon() {
|
2004-04-13 00:33:40 +00:00
|
|
|
return mess_xpm;
|
|
|
|
}
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2005-07-07 22:26:49 +00:00
|
|
|
void CViewMessages::OnMessagesCopyAll( wxCommandEvent& WXUNUSED(event) ) {
|
2005-04-21 06:04:26 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewMessages::OnMessagesCopyAll - Function Begin"));
|
|
|
|
|
2006-06-24 05:00:57 +00:00
|
|
|
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
|
2005-04-21 06:04:26 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pFrame);
|
2006-06-24 05:00:57 +00:00
|
|
|
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
|
2005-04-21 06:04:26 +00:00
|
|
|
|
2005-08-02 21:55:32 +00:00
|
|
|
#ifdef wxUSE_CLIPBOARD
|
2005-04-22 00:20:56 +00:00
|
|
|
|
|
|
|
wxInt32 iIndex = -1;
|
|
|
|
wxInt32 iRowCount = 0;
|
2005-04-21 06:04:26 +00:00
|
|
|
pFrame->UpdateStatusText(_("Copying all messages to the clipboard..."));
|
|
|
|
OpenClipboard();
|
|
|
|
|
|
|
|
iRowCount = m_pListPane->GetItemCount();
|
|
|
|
for (iIndex = 0; iIndex < iRowCount; iIndex++) {
|
|
|
|
CopyToClipboard(iIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
CloseClipboard();
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
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-21 06:04:26 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewMessages::OnMessagesCopyAll - Function End"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-07 22:26:49 +00:00
|
|
|
void CViewMessages::OnMessagesCopySelected( wxCommandEvent& WXUNUSED(event) ) {
|
2005-04-21 06:04:26 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewMessages::OnMessagesCopySelected - Function Begin"));
|
|
|
|
|
2006-06-24 05:00:57 +00:00
|
|
|
CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame);
|
2005-04-21 06:04:26 +00:00
|
|
|
|
2005-04-27 06:55:28 +00:00
|
|
|
wxASSERT(pFrame);
|
2006-06-24 05:00:57 +00:00
|
|
|
wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame));
|
2005-04-21 06:04:26 +00:00
|
|
|
|
2005-08-02 21:55:32 +00:00
|
|
|
#ifdef wxUSE_CLIPBOARD
|
2005-04-22 00:20:56 +00:00
|
|
|
|
2005-07-07 22:26:49 +00:00
|
|
|
wxInt32 iIndex = -1;
|
2005-04-22 00:20:56 +00:00
|
|
|
|
2005-04-21 06:04:26 +00:00
|
|
|
pFrame->UpdateStatusText(_("Aborting transfer..."));
|
|
|
|
OpenClipboard();
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
iIndex = m_pListPane->GetNextItem(
|
|
|
|
iIndex, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED
|
|
|
|
);
|
|
|
|
if (iIndex == -1) break;
|
|
|
|
|
|
|
|
CopyToClipboard(iIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
CloseClipboard();
|
|
|
|
pFrame->UpdateStatusText(wxT(""));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
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-21 06:04:26 +00:00
|
|
|
wxLogTrace(wxT("Function Start/End"), wxT("CViewMessages::OnMessagesCopySelected - Function End"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewMessages::GetDocCount() {
|
2006-04-17 20:26:59 +00:00
|
|
|
return wxGetApp().GetDocument()->GetMessageCount();
|
2004-10-26 08:41:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
void CViewMessages::OnListRender (wxTimerEvent& event) {
|
|
|
|
if (!m_bProcessingListRenderEvent) {
|
2005-02-02 22:20:25 +00:00
|
|
|
m_bProcessingListRenderEvent = true;
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
wxASSERT(m_pListPane);
|
2005-02-02 22:20:25 +00:00
|
|
|
|
|
|
|
wxInt32 iDocCount = GetDocCount();
|
2005-04-07 07:04:50 +00:00
|
|
|
if (0 >= iDocCount) {
|
2005-02-02 22:20:25 +00:00
|
|
|
m_pListPane->DeleteAllItems();
|
2005-04-07 07:04:50 +00:00
|
|
|
} else {
|
|
|
|
if (m_iPreviousDocCount != iDocCount)
|
|
|
|
m_pListPane->SetItemCount(iDocCount);
|
2005-02-02 22:20:25 +00:00
|
|
|
}
|
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
if ((iDocCount) && (_EnsureLastItemVisible()) && (m_iPreviousDocCount != iDocCount)) {
|
2005-04-07 07:04:50 +00:00
|
|
|
m_pListPane->EnsureVisible(iDocCount - 1);
|
2005-04-08 16:58:55 +00:00
|
|
|
}
|
2005-02-02 22:20:25 +00:00
|
|
|
|
2005-04-08 16:58:55 +00:00
|
|
|
if (m_iPreviousDocCount != iDocCount) {
|
2005-02-03 22:33:27 +00:00
|
|
|
m_iPreviousDocCount = iDocCount;
|
2005-04-08 16:58:55 +00:00
|
|
|
}
|
2005-02-03 22:33:27 +00:00
|
|
|
|
2005-02-02 22:20:25 +00:00
|
|
|
m_bProcessingListRenderEvent = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
event.Skip();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxString CViewMessages::OnListGetItemText(long item, long column) const {
|
2004-12-02 07:43:47 +00:00
|
|
|
wxString strBuffer = wxEmptyString;
|
2004-10-05 02:55:26 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
switch(column) {
|
2005-04-08 16:58:55 +00:00
|
|
|
case COLUMN_PROJECT:
|
|
|
|
FormatProjectName(item, strBuffer);
|
|
|
|
break;
|
|
|
|
case COLUMN_TIME:
|
|
|
|
FormatTime(item, strBuffer);
|
|
|
|
break;
|
|
|
|
case COLUMN_MESSAGE:
|
|
|
|
FormatMessage(item, strBuffer);
|
|
|
|
break;
|
2004-12-02 07:43:47 +00:00
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
2004-12-02 07:43:47 +00:00
|
|
|
return strBuffer;
|
|
|
|
}
|
2004-10-05 02:55:26 +00:00
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxListItemAttr* CViewMessages::OnListGetItemAttr(long item) const {
|
2004-12-02 07:43:47 +00:00
|
|
|
wxListItemAttr* pAttribute = NULL;
|
|
|
|
wxString strBuffer = wxEmptyString;
|
2004-10-05 03:40:28 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
FormatPriority(item, strBuffer);
|
2004-09-25 21:33:24 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
if (wxT("E") == strBuffer) {
|
2004-12-02 07:43:47 +00:00
|
|
|
pAttribute = m_pMessageErrorAttr;
|
2005-04-07 07:04:50 +00:00
|
|
|
} else {
|
2004-12-02 07:43:47 +00:00
|
|
|
pAttribute = m_pMessageInfoAttr;
|
2004-09-21 01:30:29 +00:00
|
|
|
}
|
2004-10-19 21:23:15 +00:00
|
|
|
|
2004-12-02 07:43:47 +00:00
|
|
|
return pAttribute;
|
2004-05-21 06:27:15 +00:00
|
|
|
}
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
bool CViewMessages::EnsureLastItemVisible() {
|
2004-12-02 07:43:47 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
void CViewMessages::UpdateSelection() {
|
2006-03-27 03:44:13 +00:00
|
|
|
CTaskItemGroup* pGroup = NULL;
|
|
|
|
|
2006-01-09 14:03:13 +00:00
|
|
|
CBOINCBaseView::PreUpdateSelection();
|
2006-03-27 03:44:13 +00:00
|
|
|
|
|
|
|
pGroup = m_TaskGroups[0];
|
|
|
|
if (m_pListPane->GetSelectedItemCount()) {
|
|
|
|
m_pTaskPane->EnableTask(pGroup->m_Tasks[BTN_COPYSELECTED]);
|
|
|
|
} else {
|
|
|
|
m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_COPYSELECTED]);
|
|
|
|
}
|
|
|
|
|
2006-01-09 14:03:13 +00:00
|
|
|
CBOINCBaseView::PostUpdateSelection();
|
2004-09-24 22:19:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewMessages::FormatProjectName(wxInt32 item, wxString& strBuffer) const {
|
2005-06-13 08:47:51 +00:00
|
|
|
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
2004-10-11 04:38:00 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (message) {
|
- 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(message->project.c_str(), wxConvUTF8));
|
2005-06-13 08:47:51 +00:00
|
|
|
}
|
2004-10-11 04:38:00 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewMessages::FormatPriority(wxInt32 item, wxString& strBuffer) const {
|
2005-06-13 08:47:51 +00:00
|
|
|
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
|
|
|
|
|
|
|
if (message) {
|
|
|
|
switch(message->priority) {
|
2006-09-01 21:38:18 +00:00
|
|
|
case MSG_INFO:
|
2005-06-13 08:47:51 +00:00
|
|
|
strBuffer = wxT("I");
|
|
|
|
break;
|
2007-01-25 23:39:06 +00:00
|
|
|
case MSG_USER_ERROR:
|
|
|
|
strBuffer = wxT("W");
|
|
|
|
break;
|
|
|
|
case MSG_INTERNAL_ERROR:
|
2005-06-13 08:47:51 +00:00
|
|
|
default:
|
|
|
|
strBuffer = wxT("E");
|
|
|
|
break;
|
|
|
|
}
|
2004-12-02 07:43:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewMessages::FormatTime(wxInt32 item, wxString& strBuffer) const {
|
2005-06-13 08:47:51 +00:00
|
|
|
wxDateTime dtBuffer;
|
|
|
|
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
2004-10-11 04:38:00 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (message) {
|
|
|
|
dtBuffer.Set((time_t)message->timestamp);
|
|
|
|
strBuffer = dtBuffer.Format();
|
|
|
|
}
|
2004-10-11 04:38:00 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewMessages::FormatMessage(wxInt32 item, wxString& strBuffer) const {
|
2005-06-13 08:47:51 +00:00
|
|
|
MESSAGE* message = wxGetApp().GetDocument()->message(item);
|
2004-10-11 04:38:00 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
if (message) {
|
2006-03-23 01:17:07 +00:00
|
|
|
strBuffer = wxString(message->body.c_str(), wxConvUTF8);
|
2005-06-13 08:47:51 +00:00
|
|
|
}
|
2004-10-11 04:38:00 +00:00
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
strBuffer.Replace(wxT("\n"), wxT(""), true);
|
2004-10-19 19:41:29 +00:00
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-10-27 21:10:22 +00:00
|
|
|
|
2005-08-02 21:55:32 +00:00
|
|
|
#ifdef wxUSE_CLIPBOARD
|
2005-04-07 07:04:50 +00:00
|
|
|
bool CViewMessages::OpenClipboard() {
|
2004-10-27 21:10:22 +00:00
|
|
|
bool bRetVal = false;
|
|
|
|
|
|
|
|
bRetVal = wxTheClipboard->Open();
|
2005-04-07 07:04:50 +00:00
|
|
|
if (bRetVal) {
|
2004-10-27 21:10:22 +00:00
|
|
|
m_bClipboardOpen = true;
|
|
|
|
m_strClipboardData = wxEmptyString;
|
|
|
|
wxTheClipboard->Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRetVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
wxInt32 CViewMessages::CopyToClipboard(wxInt32 item) {
|
2004-10-27 21:10:22 +00:00
|
|
|
wxInt32 iRetVal = -1;
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
if (m_bClipboardOpen) {
|
2004-10-27 21:10:22 +00:00
|
|
|
wxString strBuffer = wxEmptyString;
|
|
|
|
wxString strTimeStamp = wxEmptyString;
|
|
|
|
wxString strProject = wxEmptyString;
|
|
|
|
wxString strMessage = wxEmptyString;
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
FormatTime(item, strTimeStamp);
|
|
|
|
FormatProjectName(item, strProject);
|
|
|
|
FormatMessage(item, strMessage);
|
2004-10-27 21:10:22 +00:00
|
|
|
|
|
|
|
#ifdef __WXMSW__
|
2005-04-07 07:04:50 +00:00
|
|
|
strBuffer.Printf(wxT("%s|%s|%s\r\n"), strTimeStamp.c_str(), strProject.c_str(), strMessage.c_str());
|
2004-10-27 21:10:22 +00:00
|
|
|
#else
|
2005-04-07 07:04:50 +00:00
|
|
|
strBuffer.Printf(wxT("%s|%s|%s\n"), strTimeStamp.c_str(), strProject.c_str(), strMessage.c_str());
|
2004-10-27 21:10:22 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
m_strClipboardData += strBuffer;
|
|
|
|
|
|
|
|
iRetVal = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return iRetVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
bool CViewMessages::CloseClipboard() {
|
2004-10-27 21:10:22 +00:00
|
|
|
bool bRetVal = false;
|
|
|
|
|
2005-04-07 07:04:50 +00:00
|
|
|
if (m_bClipboardOpen) {
|
|
|
|
wxTheClipboard->SetData(new wxTextDataObject(m_strClipboardData));
|
2004-10-27 21:10:22 +00:00
|
|
|
wxTheClipboard->Close();
|
|
|
|
|
|
|
|
m_bClipboardOpen = false;
|
|
|
|
m_strClipboardData = wxEmptyString;
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRetVal;
|
|
|
|
}
|
|
|
|
|
2004-11-05 19:38:11 +00:00
|
|
|
#endif
|
2004-12-08 00:40:19 +00:00
|
|
|
|
2005-04-21 23:14:10 +00:00
|
|
|
|
2005-01-02 18:29:53 +00:00
|
|
|
const char *BOINC_RCSID_0be7149475 = "$Id$";
|