2004-05-17 22:15:10 +00:00
|
|
|
// $Id$
|
|
|
|
//
|
2004-04-10 09:11:03 +00:00
|
|
|
// The contents of this file are subject to the BOINC Public License
|
|
|
|
// Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
// compliance with the License. You may obtain a copy of the License at
|
|
|
|
// http://boinc.berkeley.edu/license_1.0.txt
|
|
|
|
//
|
|
|
|
// Software distributed under the License is distributed on an "AS IS"
|
|
|
|
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing rights and limitations
|
|
|
|
// under the License.
|
|
|
|
//
|
|
|
|
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
|
|
|
|
//
|
|
|
|
// The Initial Developer of the Original Code is the SETI@home project.
|
|
|
|
// Portions created by the SETI@home project are Copyright (C) 2002
|
|
|
|
// University of California at Berkeley. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Contributor(s):
|
|
|
|
//
|
2004-05-17 22:15:10 +00:00
|
|
|
// Revision History:
|
|
|
|
//
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-11 04:37:10 +00:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma implementation "MainDocument.h"
|
|
|
|
#endif
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
#include "stdwx.h"
|
2004-10-09 03:05:01 +00:00
|
|
|
#include "BOINCGUIApp.h"
|
2004-04-11 04:12:44 +00:00
|
|
|
#include "MainDocument.h"
|
2004-07-12 08:46:26 +00:00
|
|
|
#include "error_numbers.h"
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
|
2004-09-10 23:17:08 +00:00
|
|
|
IMPLEMENT_DYNAMIC_CLASS(CMainDocument, wxObject)
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
|
2004-07-12 08:46:26 +00:00
|
|
|
CMainDocument::CMainDocument()
|
|
|
|
{
|
2004-09-10 23:17:08 +00:00
|
|
|
#ifdef __WIN32__
|
|
|
|
wxInt32 retval;
|
|
|
|
WSADATA wsdata;
|
|
|
|
|
|
|
|
retval = WSAStartup( MAKEWORD( 1, 1 ), &wsdata);
|
|
|
|
if (retval)
|
|
|
|
{
|
|
|
|
wxLogTrace("CMainDocument::CMainDocument - Winsock Initialization Failure '%d'", retval);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
m_bIsConnected = false;
|
2004-09-25 21:33:24 +00:00
|
|
|
|
2004-10-01 00:06:32 +00:00
|
|
|
m_fProjectTotalResourceShare = 0.0;
|
|
|
|
|
|
|
|
m_iMessageSequenceNumber = 0;
|
|
|
|
|
|
|
|
m_bCachedStateLocked = false;
|
2004-07-13 05:56:03 +00:00
|
|
|
m_dtCachedStateLockTimestamp = wxDateTime::Now();
|
|
|
|
m_dtCachedStateTimestamp = 0;
|
2004-07-12 08:46:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CMainDocument::~CMainDocument()
|
|
|
|
{
|
2004-07-13 05:56:03 +00:00
|
|
|
m_dtCachedStateTimestamp = wxDateTime::Now();
|
|
|
|
m_dtCachedStateLockTimestamp = wxDateTime::Now();
|
|
|
|
m_bCachedStateLocked = false;
|
2004-09-10 23:17:08 +00:00
|
|
|
|
2004-10-01 00:06:32 +00:00
|
|
|
m_iMessageSequenceNumber = 0;
|
|
|
|
|
|
|
|
m_fProjectTotalResourceShare = 0.0;
|
|
|
|
|
|
|
|
m_bIsConnected = false;
|
|
|
|
|
2004-09-10 23:17:08 +00:00
|
|
|
#ifdef __WIN32__
|
|
|
|
WSACleanup();
|
|
|
|
#endif
|
2004-07-12 08:46:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-10-09 03:05:01 +00:00
|
|
|
wxInt32 CMainDocument::OnInit()
|
|
|
|
{
|
|
|
|
wxInt32 retval = 0;
|
|
|
|
|
|
|
|
if (!m_bIsConnected)
|
|
|
|
{
|
|
|
|
retval = rpc.init(NULL);
|
|
|
|
if (retval)
|
|
|
|
wxLogTrace("CMainDocument::CachedStateUpdate - RPC Initialization Failed '%d'", retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::OnExit()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::OnIdle()
|
|
|
|
{
|
|
|
|
if (m_bIsConnected)
|
|
|
|
{
|
|
|
|
CachedStateUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::CachedStateUpdate()
|
|
|
|
{
|
|
|
|
wxInt32 retval = 0;
|
|
|
|
CMainFrame* pFrame = wxGetApp().GetFrame();
|
|
|
|
wxString strEmpty = wxEmptyString;
|
|
|
|
|
|
|
|
wxASSERT(NULL != pFrame);
|
|
|
|
wxASSERT(wxDynamicCast(pFrame, CMainFrame));
|
|
|
|
|
|
|
|
wxTimeSpan ts(m_dtCachedStateLockTimestamp - m_dtCachedStateTimestamp);
|
|
|
|
if (!m_bCachedStateLocked && (ts > wxTimeSpan::Seconds(3600)))
|
|
|
|
{
|
|
|
|
pFrame->UpdateStatusbar( _("Retrieving the BOINC system state. Please wait...") );
|
|
|
|
m_dtCachedStateTimestamp = m_dtCachedStateLockTimestamp;
|
|
|
|
|
|
|
|
retval = rpc.get_state(state);
|
|
|
|
if (retval)
|
|
|
|
wxLogTrace("CMainDocument::CachedStateUpdate - Get State Failed '%d'", retval);
|
|
|
|
|
|
|
|
pFrame->UpdateStatusbar( strEmpty );
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::CachedStateLock()
|
|
|
|
{
|
|
|
|
m_bCachedStateLocked = true;
|
|
|
|
m_dtCachedStateLockTimestamp = wxDateTime::Now();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::CachedStateUnlock()
|
|
|
|
{
|
|
|
|
m_bCachedStateLocked = false;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::CachedProjectStatusUpdate()
|
|
|
|
{
|
|
|
|
wxInt32 retval = 0;
|
2004-09-29 22:21:45 +00:00
|
|
|
wxInt32 i = 0;
|
2004-09-25 21:33:24 +00:00
|
|
|
|
|
|
|
if (!m_bIsConnected)
|
|
|
|
{
|
|
|
|
retval = rpc.init(NULL);
|
|
|
|
if (retval)
|
|
|
|
{
|
2004-09-28 01:19:46 +00:00
|
|
|
wxLogTrace("CMainDocument::CachedProjectStatusUpdate - RPC Initialization Failed '%d'", retval);
|
2004-09-25 21:33:24 +00:00
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_bIsConnected = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
retval = rpc.get_project_status(project_status);
|
|
|
|
if (retval)
|
|
|
|
{
|
2004-09-29 22:21:45 +00:00
|
|
|
wxLogTrace("CMainDocument::CachedProjectStatusUpdate - Get Project Status Failed '%d'", retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_fProjectTotalResourceShare = 0.0;
|
|
|
|
for (i=0; i < (long)project_status.projects.size(); i++) {
|
2004-10-01 00:06:32 +00:00
|
|
|
m_fProjectTotalResourceShare += project_status.projects.at( i )->resource_share;
|
2004-09-25 21:33:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetProjectCount()
|
|
|
|
{
|
|
|
|
CachedProjectStatusUpdate();
|
|
|
|
wxInt32 iCount = project_status.projects.size();
|
|
|
|
|
2004-09-10 23:17:08 +00:00
|
|
|
return iCount;
|
2004-07-12 08:46:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectProjectName(wxInt32 iIndex, wxString& strBuffer)
|
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
if ( NULL != pProject )
|
|
|
|
strBuffer = pProject->project_name.c_str();
|
|
|
|
|
|
|
|
return 0;
|
2004-07-12 08:46:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectProjectURL(wxInt32 iIndex, wxString& strBuffer)
|
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
if ( NULL != pProject )
|
|
|
|
strBuffer = pProject->master_url.c_str();
|
|
|
|
|
|
|
|
return 0;
|
2004-07-12 08:46:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectAccountName(wxInt32 iIndex, wxString& strBuffer)
|
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
if ( NULL != pProject )
|
|
|
|
strBuffer = pProject->user_name.c_str();
|
|
|
|
|
|
|
|
return 0;
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectTeamName(wxInt32 iIndex, wxString& strBuffer)
|
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
if ( NULL != pProject )
|
|
|
|
strBuffer = pProject->team_name.c_str();
|
|
|
|
|
|
|
|
return 0;
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectTotalCredit(wxInt32 iIndex, float& fBuffer)
|
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
if ( NULL != pProject )
|
|
|
|
fBuffer = pProject->user_total_credit;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetProjectAvgCredit(wxInt32 iIndex, float& fBuffer)
|
2004-09-25 21:33:24 +00:00
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
if ( NULL != pProject )
|
2004-09-29 22:21:45 +00:00
|
|
|
fBuffer = pProject->user_expavg_credit;
|
2004-09-25 21:33:24 +00:00
|
|
|
|
|
|
|
return 0;
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectResourceShare(wxInt32 iIndex, float& fBuffer)
|
2004-09-25 21:33:24 +00:00
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
if ( NULL != pProject )
|
2004-09-29 22:21:45 +00:00
|
|
|
fBuffer = pProject->resource_share;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectTotalResourceShare(wxInt32 iIndex, float& fBuffer)
|
|
|
|
{
|
2004-10-05 02:55:26 +00:00
|
|
|
fBuffer = m_fProjectTotalResourceShare;
|
2004-09-25 21:33:24 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectMinRPCTime(wxInt32 iIndex, wxInt32& iBuffer)
|
2004-09-25 21:33:24 +00:00
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
if ( NULL != pProject )
|
2004-09-29 22:21:45 +00:00
|
|
|
iBuffer = pProject->min_rpc_time;
|
2004-09-25 21:33:24 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-10-09 03:05:01 +00:00
|
|
|
wxInt32 CMainDocument::GetProjectWebsiteCount(wxInt32 iIndex)
|
|
|
|
{
|
|
|
|
CachedStateUpdate();
|
|
|
|
|
|
|
|
wxInt32 iCount = 0;
|
|
|
|
PROJECT* pProject = state.projects.at( iIndex );
|
|
|
|
|
|
|
|
if ( NULL != pProject )
|
|
|
|
iCount = pProject->gui_urls.size();
|
|
|
|
|
|
|
|
return iCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetProjectWebsiteName(wxInt32 iProjectIndex, wxInt32 iWebsiteIndex, wxString& strBuffer)
|
|
|
|
{
|
|
|
|
wxString strProjectURL = wxEmptyString;
|
|
|
|
std::string str;
|
|
|
|
PROJECT* pProject = NULL;
|
|
|
|
GUI_URL Url;
|
|
|
|
|
|
|
|
CachedStateUpdate();
|
|
|
|
|
|
|
|
GetProjectProjectURL( iProjectIndex, strProjectURL );
|
|
|
|
str = strProjectURL.c_str();
|
|
|
|
pProject = state.lookup_project( str );
|
|
|
|
|
|
|
|
if ( NULL != pProject )
|
|
|
|
{
|
|
|
|
Url = pProject->gui_urls.at( iWebsiteIndex );
|
|
|
|
strBuffer = Url.name.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetProjectWebsiteDescription(wxInt32 iProjectIndex, wxInt32 iWebsiteIndex, wxString& strBuffer)
|
|
|
|
{
|
|
|
|
wxString strProjectURL = wxEmptyString;
|
|
|
|
std::string str;
|
|
|
|
PROJECT* pProject = NULL;
|
|
|
|
GUI_URL Url;
|
|
|
|
|
|
|
|
CachedStateUpdate();
|
|
|
|
|
|
|
|
GetProjectProjectURL( iProjectIndex, strProjectURL );
|
|
|
|
str = strProjectURL.c_str();
|
|
|
|
pProject = state.lookup_project( str );
|
|
|
|
|
|
|
|
if ( NULL != pProject )
|
|
|
|
{
|
|
|
|
Url = pProject->gui_urls.at( iWebsiteIndex );
|
|
|
|
strBuffer = Url.description.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetProjectWebsiteLink(wxInt32 iProjectIndex, wxInt32 iWebsiteIndex, wxString& strBuffer)
|
|
|
|
{
|
|
|
|
wxString strProjectURL = wxEmptyString;
|
|
|
|
std::string str;
|
|
|
|
PROJECT* pProject = NULL;
|
|
|
|
GUI_URL Url;
|
|
|
|
|
|
|
|
CachedStateUpdate();
|
|
|
|
|
|
|
|
GetProjectProjectURL( iProjectIndex, strProjectURL );
|
|
|
|
str = strProjectURL.c_str();
|
|
|
|
pProject = state.lookup_project( str );
|
|
|
|
|
|
|
|
if ( NULL != pProject )
|
|
|
|
{
|
|
|
|
Url = pProject->gui_urls.at( iWebsiteIndex );
|
|
|
|
strBuffer = Url.url.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
bool CMainDocument::IsProjectSuspended(wxInt32 iIndex)
|
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-09-29 22:21:45 +00:00
|
|
|
return pProject->suspended_via_gui;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainDocument::IsProjectRPCPending(wxInt32 iIndex)
|
|
|
|
{
|
2004-10-01 00:06:32 +00:00
|
|
|
PROJECT* pProject = project_status.projects.at( iIndex );
|
2004-09-29 22:21:45 +00:00
|
|
|
return pProject->sched_rpc_pending;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::ProjectAttach( wxString& strURL, wxString& strAccountKey )
|
|
|
|
{
|
|
|
|
return rpc.project_attach((char *)strURL.c_str(), (char *)strAccountKey.c_str());
|
|
|
|
}
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::ProjectDetach( wxString& strURL )
|
|
|
|
{
|
2004-09-28 01:19:46 +00:00
|
|
|
PROJECT p;
|
|
|
|
p.master_url = strURL;
|
|
|
|
return rpc.project_op(p, wxT("detach"));
|
2004-09-25 21:33:24 +00:00
|
|
|
}
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::ProjectUpdate( wxString& strURL )
|
|
|
|
{
|
2004-09-28 01:19:46 +00:00
|
|
|
PROJECT p;
|
|
|
|
p.master_url = strURL;
|
|
|
|
return rpc.project_op(p, wxT("update"));
|
2004-09-25 21:33:24 +00:00
|
|
|
}
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
wxInt32 CMainDocument::ProjectReset( wxString& strURL )
|
|
|
|
{
|
2004-09-28 01:19:46 +00:00
|
|
|
PROJECT p;
|
|
|
|
p.master_url = strURL;
|
|
|
|
return rpc.project_op(p, wxT("reset"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::ProjectSuspend( wxString& strURL )
|
|
|
|
{
|
|
|
|
PROJECT p;
|
|
|
|
p.master_url = strURL;
|
|
|
|
return rpc.project_op(p, wxT("suspend"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::ProjectResume( wxString& strURL )
|
|
|
|
{
|
|
|
|
PROJECT p;
|
|
|
|
p.master_url = strURL;
|
|
|
|
return rpc.project_op(p, wxT("resume"));
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
wxInt32 CMainDocument::CachedMessageUpdate()
|
|
|
|
{
|
|
|
|
wxInt32 retval = 0;
|
|
|
|
wxInt32 i = 0;
|
|
|
|
|
|
|
|
if (!m_bIsConnected)
|
|
|
|
{
|
|
|
|
retval = rpc.init(NULL);
|
|
|
|
if (retval)
|
|
|
|
{
|
|
|
|
wxLogTrace("CMainDocument::CachedMessageUpdate - RPC Initialization Failed '%d'", retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_bIsConnected = true;
|
|
|
|
}
|
|
|
|
|
2004-10-01 00:06:32 +00:00
|
|
|
retval = rpc.get_messages( m_iMessageSequenceNumber, messages );
|
2004-09-29 22:21:45 +00:00
|
|
|
if (retval)
|
|
|
|
{
|
|
|
|
wxLogTrace("CMainDocument::CachedMessageUpdate - Get Messages Failed '%d'", retval);
|
|
|
|
}
|
|
|
|
|
2004-10-01 00:06:32 +00:00
|
|
|
m_iMessageSequenceNumber = messages.messages.at( messages.messages.size()-1 )->seqno;
|
2004-09-29 22:21:45 +00:00
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetMessageCount()
|
|
|
|
{
|
|
|
|
CachedMessageUpdate();
|
|
|
|
wxInt32 iCount = messages.messages.size();
|
|
|
|
|
|
|
|
return iCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetMessageProjectName(wxInt32 iIndex, wxString& strBuffer)
|
|
|
|
{
|
|
|
|
MESSAGE* pMessage = messages.messages.at( iIndex );
|
|
|
|
if ( NULL != pMessage )
|
|
|
|
strBuffer = pMessage->project.c_str();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetMessageTime(wxInt32 iIndex, wxDateTime& dtBuffer)
|
|
|
|
{
|
|
|
|
MESSAGE* pMessage = messages.messages.at( iIndex );
|
|
|
|
if ( NULL != pMessage )
|
|
|
|
{
|
|
|
|
wxDateTime dtTemp((time_t)pMessage->timestamp);
|
|
|
|
dtBuffer = dtTemp;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetMessagePriority(wxInt32 iIndex, wxInt32& iBuffer)
|
|
|
|
{
|
|
|
|
MESSAGE* pMessage = messages.messages.at( iIndex );
|
|
|
|
if ( NULL != pMessage )
|
|
|
|
iBuffer = pMessage->priority;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CMainDocument::GetMessageMessage(wxInt32 iIndex, wxString& strBuffer)
|
|
|
|
{
|
|
|
|
MESSAGE* pMessage = messages.messages.at( iIndex );
|
|
|
|
if ( NULL != pMessage )
|
|
|
|
strBuffer = pMessage->body.c_str();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxInt32 CMainDocument::GetWorkCount() {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-09-10 23:17:08 +00:00
|
|
|
return state.results.size();
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetWorkProjectName(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-09-10 23:17:08 +00:00
|
|
|
return state.results[iIndex]->project->project_name.c_str();
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetWorkApplicationName(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-09-10 23:17:08 +00:00
|
|
|
return state.results[iIndex]->app->name.c_str();
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetWorkName(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-09-10 23:17:08 +00:00
|
|
|
return state.results[iIndex]->name.c_str();
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetWorkCPUTime(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-08-11 23:52:22 +00:00
|
|
|
return wxString::Format(_T(""));
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetWorkProgress(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-08-11 23:52:22 +00:00
|
|
|
return wxString::Format(_T(""));
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetWorkTimeToCompletion(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-08-11 23:52:22 +00:00
|
|
|
return wxString::Format(_T(""));
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetWorkReportDeadline(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-09-10 23:17:08 +00:00
|
|
|
wxDateTime dtReportDeadline;
|
|
|
|
dtReportDeadline.Set((time_t)state.results[iIndex]->report_deadline);
|
|
|
|
return dtReportDeadline.Format();
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetWorkStatus(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-08-11 23:52:22 +00:00
|
|
|
return wxString::Format(_T(""));
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxInt32 CMainDocument::GetTransferCount() {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-08-11 23:52:22 +00:00
|
|
|
return 0;
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetTransferFileName(wxInt32 iIndex) {
|
2004-07-13 05:56:03 +00:00
|
|
|
CachedStateUpdate();
|
2004-08-11 23:52:22 +00:00
|
|
|
return wxString::Format(_T(""));
|
2004-07-13 05:56:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetTransferProgress(wxInt32 iIndex) {
|
|
|
|
CachedStateUpdate();
|
|
|
|
return wxString::Format(_T(""));
|
2004-07-12 08:46:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetTransferProjectName(wxInt32 iIndex) {
|
|
|
|
CachedStateUpdate();
|
|
|
|
return wxString::Format(_T(""));
|
|
|
|
}
|
2004-07-12 08:46:26 +00:00
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetTransferSize(wxInt32 iIndex) {
|
|
|
|
CachedStateUpdate();
|
|
|
|
return wxString::Format(_T(""));
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
2004-07-12 08:46:26 +00:00
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetTransferSpeed(wxInt32 iIndex) {
|
|
|
|
CachedStateUpdate();
|
|
|
|
return wxString::Format(_T(""));
|
|
|
|
}
|
2004-07-12 08:46:26 +00:00
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetTransferStatus(wxInt32 iIndex) {
|
|
|
|
CachedStateUpdate();
|
|
|
|
return wxString::Format(_T(""));
|
2004-07-12 08:46:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
wxString CMainDocument::GetTransferTime(wxInt32 iIndex) {
|
|
|
|
CachedStateUpdate();
|
|
|
|
return wxString::Format(_T(""));
|
|
|
|
}
|
2004-07-12 08:46:26 +00:00
|
|
|
|