2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-01-20 23:22:22 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2004-05-17 22:15:10 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2004-04-10 09:11:03 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-01-20 23:22:22 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
2004-05-17 22:15:10 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#ifndef BOINC_MAINDOCUMENT_H
|
|
|
|
#define BOINC_MAINDOCUMENT_H
|
2004-04-11 04:37:10 +00:00
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "MainDocument.cpp"
|
|
|
|
#endif
|
|
|
|
|
2007-09-20 11:10:59 +00:00
|
|
|
#include <vector>
|
2006-09-01 21:06:30 +00:00
|
|
|
#include "common_defs.h"
|
2004-09-10 23:17:08 +00:00
|
|
|
#include "gui_rpc_client.h"
|
2008-07-22 13:26:52 +00:00
|
|
|
#include "AsyncRPC.h"
|
2004-09-10 23:17:08 +00:00
|
|
|
|
2007-09-20 11:10:59 +00:00
|
|
|
typedef struct {
|
|
|
|
int slot;
|
|
|
|
std::string project_url;
|
|
|
|
std::string name;
|
|
|
|
#ifdef _WIN32
|
|
|
|
HANDLE pid;
|
|
|
|
#else
|
|
|
|
int pid;
|
|
|
|
#endif
|
|
|
|
} RUNNING_GFX_APP;
|
|
|
|
|
|
|
|
|
2009-12-23 05:23:48 +00:00
|
|
|
///
|
|
|
|
/// Bitmask values for GetCurrentViewPage()
|
|
|
|
/// Used by CMainDocument::RunPeriodicRPCs() and Mac Accessibility
|
|
|
|
///
|
2010-01-04 18:09:29 +00:00
|
|
|
#define VW_PROJ 1
|
|
|
|
#define VW_TASK 2
|
|
|
|
#define VW_XFER 4
|
|
|
|
#define VW_STAT 8
|
|
|
|
#define VW_DISK 16
|
|
|
|
#define VW_NOTIF 128
|
|
|
|
#define VW_SGUI 256
|
|
|
|
#define VW_SMSG 2048
|
|
|
|
#define VW_SNOTIF 4096
|
2009-12-23 05:23:48 +00:00
|
|
|
|
|
|
|
|
2007-10-05 16:47:07 +00:00
|
|
|
extern bool g_use_sandbox;
|
|
|
|
|
2005-04-06 20:40:19 +00:00
|
|
|
class CMainDocument;
|
2008-01-30 06:09:34 +00:00
|
|
|
class CBOINCClientManager;
|
2005-04-06 20:40:19 +00:00
|
|
|
|
2005-04-17 02:10:52 +00:00
|
|
|
class CNetworkConnection : public wxObject {
|
2005-04-06 20:40:19 +00:00
|
|
|
public:
|
2005-04-17 02:10:52 +00:00
|
|
|
CNetworkConnection(CMainDocument* pDocument);
|
2005-04-10 02:24:08 +00:00
|
|
|
~CNetworkConnection();
|
2005-04-08 04:23:37 +00:00
|
|
|
|
2006-03-27 07:55:04 +00:00
|
|
|
void Poll();
|
2005-04-08 04:23:37 +00:00
|
|
|
void FireReconnectEvent() { m_bConnectEvent = true; };
|
2008-01-30 06:09:34 +00:00
|
|
|
void ForceDisconnect() { m_bForceReconnect = false; m_bReconnectOnError = false; m_bConnectEvent = false; SetStateDisconnected(); };
|
2006-04-25 00:59:49 +00:00
|
|
|
void ForceReconnect() { m_bForceReconnect = true; SetStateDisconnected(); };
|
2005-04-24 00:09:40 +00:00
|
|
|
int FrameShutdownDetected();
|
|
|
|
int GetConnectedComputerName(wxString& strMachine);
|
2007-05-03 16:17:54 +00:00
|
|
|
int GetConnectedComputerVersion(wxString& strVersion);
|
2005-04-24 00:09:40 +00:00
|
|
|
int GetConnectingComputerName(wxString& strMachine);
|
2005-12-06 03:18:02 +00:00
|
|
|
bool IsComputerNameLocal(const wxString& strMachine);
|
2008-01-11 17:56:21 +00:00
|
|
|
int GetLocalPassword(wxString& strPassword);
|
2008-02-06 00:10:31 +00:00
|
|
|
int SetComputer(
|
2016-04-12 21:19:04 +00:00
|
|
|
const wxString& szComputer, const int iPort, const wxString& szPassword, const bool bUseDefaultPassword
|
2008-02-06 00:10:31 +00:00
|
|
|
);
|
2005-04-08 04:23:37 +00:00
|
|
|
void SetStateError();
|
2005-04-08 21:18:30 +00:00
|
|
|
void SetStateErrorAuthentication();
|
2005-04-08 04:23:37 +00:00
|
|
|
void SetStateReconnecting();
|
2005-11-27 01:28:56 +00:00
|
|
|
void SetStateSuccess(wxString& strComputer, wxString& strComputerPassword);
|
2005-04-08 19:57:31 +00:00
|
|
|
void SetStateDisconnected();
|
2005-04-08 04:23:37 +00:00
|
|
|
bool IsConnectEventSignaled() { return m_bConnectEvent; };
|
|
|
|
bool IsConnected() { return m_bConnected; };
|
|
|
|
bool IsReconnecting() { return m_bReconnecting; };
|
2005-04-06 20:40:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
CMainDocument* m_pDocument;
|
2005-04-08 22:23:53 +00:00
|
|
|
bool m_bFrameShutdownDetected;
|
2005-04-08 04:23:37 +00:00
|
|
|
bool m_bConnectEvent;
|
|
|
|
bool m_bForceReconnect;
|
|
|
|
bool m_bReconnectOnError;
|
|
|
|
bool m_bConnected;
|
|
|
|
bool m_bReconnecting;
|
2005-11-29 00:29:43 +00:00
|
|
|
bool m_bUseDefaultPassword;
|
2007-01-30 15:50:16 +00:00
|
|
|
bool m_bUsedDefaultPassword;
|
2008-01-11 17:56:21 +00:00
|
|
|
int m_iReadGUIRPCAuthFailure;
|
2007-01-23 21:14:08 +00:00
|
|
|
bool m_bNewConnection;
|
2005-04-08 04:23:37 +00:00
|
|
|
wxString m_strNewComputerName;
|
|
|
|
wxString m_strNewComputerPassword;
|
|
|
|
wxString m_strConnectedComputerName;
|
|
|
|
wxString m_strConnectedComputerPassword;
|
2007-05-03 16:17:54 +00:00
|
|
|
wxString m_strConnectedComputerVersion;
|
2008-02-06 00:10:31 +00:00
|
|
|
int m_iPort;
|
2005-04-06 20:40:19 +00:00
|
|
|
};
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2005-04-17 02:10:52 +00:00
|
|
|
class CMainDocument : public wxObject {
|
2004-04-10 09:11:03 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(CMainDocument)
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
public:
|
|
|
|
CMainDocument();
|
|
|
|
~CMainDocument();
|
|
|
|
|
|
|
|
//
|
2004-09-29 22:21:45 +00:00
|
|
|
// Global
|
2004-09-25 21:33:24 +00:00
|
|
|
//
|
2004-07-12 08:46:26 +00:00
|
|
|
private:
|
2014-02-18 05:36:03 +00:00
|
|
|
char m_szLanguage[256];
|
2006-08-31 19:24:38 +00:00
|
|
|
wxDateTime m_dtCachedCCStatusTimestamp;
|
2008-01-30 06:09:34 +00:00
|
|
|
bool m_bClientStartCheckCompleted;
|
2004-10-24 07:38:38 +00:00
|
|
|
|
2004-10-09 03:05:01 +00:00
|
|
|
|
|
|
|
public:
|
2005-04-24 00:09:40 +00:00
|
|
|
int OnInit();
|
|
|
|
int OnExit();
|
|
|
|
int OnPoll();
|
2005-04-08 04:23:37 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int OnRefreshState();
|
2008-01-30 06:09:34 +00:00
|
|
|
int CachedStateUpdate();
|
2005-04-24 00:09:40 +00:00
|
|
|
int ResetState();
|
2004-10-24 05:40:12 +00:00
|
|
|
|
2005-11-29 00:29:43 +00:00
|
|
|
int Connect(
|
2016-04-12 21:19:04 +00:00
|
|
|
const wxString& szComputer,
|
2008-02-06 00:10:31 +00:00
|
|
|
const int iPort,
|
2016-04-12 21:19:04 +00:00
|
|
|
const wxString& szComputerPassword = wxEmptyString,
|
2005-11-29 00:29:43 +00:00
|
|
|
const bool bDisconnect = FALSE,
|
|
|
|
const bool bUseDefaultPassword = FALSE
|
|
|
|
);
|
2005-11-27 01:28:56 +00:00
|
|
|
int Reconnect();
|
2004-10-28 07:03:06 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int CachedStateLock();
|
|
|
|
int CachedStateUnlock();
|
2004-10-09 03:05:01 +00:00
|
|
|
|
2008-02-08 00:17:21 +00:00
|
|
|
void ForceDisconnect();
|
2005-04-24 00:09:40 +00:00
|
|
|
int FrameShutdownDetected();
|
|
|
|
int CoreClientQuit();
|
2005-04-08 04:23:37 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int GetConnectedComputerName(wxString& strMachine);
|
2007-05-03 16:17:54 +00:00
|
|
|
int GetConnectedComputerVersion(wxString& strVersion);
|
2005-04-24 00:09:40 +00:00
|
|
|
int GetConnectingComputerName(wxString& strMachine);
|
2016-04-12 21:19:04 +00:00
|
|
|
bool IsComputerNameLocal(const wxString& strMachine);
|
2005-04-08 04:23:37 +00:00
|
|
|
bool IsConnected();
|
|
|
|
bool IsReconnecting();
|
2005-02-22 23:40:38 +00:00
|
|
|
|
2006-12-21 17:05:58 +00:00
|
|
|
int GetCoreClientStatus(CC_STATUS&, bool bForce = false);
|
2006-11-15 12:01:46 +00:00
|
|
|
int SetActivityRunMode(int iMode, int iTimeout);
|
2009-12-11 00:08:28 +00:00
|
|
|
int SetGPURunMode(int iMode, int iTimeout);
|
2006-11-15 12:01:46 +00:00
|
|
|
int SetNetworkRunMode(int iMode, int iTimeout);
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2010-07-16 08:26:16 +00:00
|
|
|
void RefreshRPCs(bool fullReset = false);
|
2010-01-09 08:06:58 +00:00
|
|
|
void RunPeriodicRPCs(int frameRefreshRate);
|
2008-07-29 13:06:28 +00:00
|
|
|
int ForceCacheUpdate(bool immediate = true);
|
2005-04-24 00:09:40 +00:00
|
|
|
int RunBenchmarks();
|
2004-10-27 23:19:50 +00:00
|
|
|
|
2006-06-22 10:10:51 +00:00
|
|
|
bool IsUserAuthorized();
|
|
|
|
|
2017-01-25 14:26:58 +00:00
|
|
|
void CheckForVersionUpdate(bool showMessage = false);
|
2017-01-22 03:21:08 +00:00
|
|
|
|
2008-01-30 06:09:34 +00:00
|
|
|
CNetworkConnection* m_pNetworkConnection;
|
|
|
|
CBOINCClientManager* m_pClientManager;
|
2008-07-23 14:16:59 +00:00
|
|
|
AsyncRPC rpc;
|
|
|
|
RPC_CLIENT rpcClient;
|
2008-09-30 01:12:49 +00:00
|
|
|
PROJECTS async_projects_update_buf;
|
|
|
|
|
2005-04-06 20:40:19 +00:00
|
|
|
CC_STATE state;
|
2008-07-28 13:09:02 +00:00
|
|
|
CC_STATE async_state_buf;
|
|
|
|
int m_iGet_state_rpc_result;
|
|
|
|
|
2006-09-01 04:24:25 +00:00
|
|
|
CC_STATUS status;
|
2008-07-28 13:09:02 +00:00
|
|
|
CC_STATUS async_status_buf;
|
|
|
|
int m_iGet_status_rpc_result;
|
2005-04-06 20:40:19 +00:00
|
|
|
wxDateTime m_dtCachedStateTimestamp;
|
|
|
|
|
2008-07-18 14:38:27 +00:00
|
|
|
//
|
|
|
|
// Async RPC support
|
|
|
|
//
|
|
|
|
public:
|
2008-07-23 14:16:59 +00:00
|
|
|
int RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority = false);
|
2008-10-30 01:55:11 +00:00
|
|
|
void OnRPCComplete(CRPCFinishedEvent& event);
|
2008-09-19 06:50:25 +00:00
|
|
|
ASYNC_RPC_REQUEST* GetCurrentRPCRequest() { return ¤t_rpc_request; }
|
|
|
|
bool WaitingForRPC() { return m_bWaitingForRPC; }
|
2008-10-14 03:28:34 +00:00
|
|
|
wxDialog* GetRPCWaitDialog() { return m_RPCWaitDlg; }
|
2008-08-15 02:27:30 +00:00
|
|
|
// void TestAsyncRPC(); // For testing Async RPCs
|
2008-07-21 11:14:44 +00:00
|
|
|
RPCThread* m_RPCThread;
|
2009-08-27 01:46:20 +00:00
|
|
|
bool m_bRPCThreadIsReady;
|
2008-11-15 13:21:08 +00:00
|
|
|
bool m_bShutDownRPCThread;
|
2008-07-18 14:38:27 +00:00
|
|
|
|
|
|
|
private:
|
2008-11-05 06:03:13 +00:00
|
|
|
void HandleCompletedRPC();
|
|
|
|
void KillRPCThread();
|
2009-03-26 01:22:35 +00:00
|
|
|
int CopyProjectsToStateBuffer(PROJECTS& p, CC_STATE& state);
|
2008-07-18 14:38:27 +00:00
|
|
|
ASYNC_RPC_REQUEST current_rpc_request;
|
|
|
|
AsyncRPCDlg* m_RPCWaitDlg;
|
|
|
|
std::vector<ASYNC_RPC_REQUEST> RPC_requests;
|
2008-07-24 10:18:31 +00:00
|
|
|
bool m_bWaitingForRPC;
|
2008-11-05 06:03:13 +00:00
|
|
|
bool m_bNeedRefresh;
|
|
|
|
bool m_bNeedTaskBarRefresh;
|
2009-06-08 22:44:03 +00:00
|
|
|
BOINC_Mutex* m_pRPC_Thread_Mutex;
|
|
|
|
BOINC_Condition* m_pRPC_Thread_Condition;
|
|
|
|
BOINC_Mutex* m_pRPC_Request_Mutex;
|
|
|
|
BOINC_Condition* m_pRPC_Request_Condition;
|
2009-08-08 03:32:05 +00:00
|
|
|
wxDateTime m_dtLasAsyncRPCDlgTime;
|
2010-01-09 02:52:48 +00:00
|
|
|
wxDateTime m_dtLastFrameViewRefreshRPCTime;
|
2004-10-27 23:19:50 +00:00
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
//
|
2009-12-22 01:22:11 +00:00
|
|
|
// Projects Tab
|
2004-09-29 22:21:45 +00:00
|
|
|
//
|
|
|
|
private:
|
2008-07-28 13:09:02 +00:00
|
|
|
int m_iGet_project_status1_rpc_result;
|
2009-12-22 01:22:11 +00:00
|
|
|
wxDateTime m_dtProjectsStatusTimestamp;
|
2004-09-25 21:33:24 +00:00
|
|
|
|
|
|
|
public:
|
2008-07-30 12:49:10 +00:00
|
|
|
int CachedProjectStatusUpdate(bool bForce = false);
|
2005-06-24 10:49:42 +00:00
|
|
|
PROJECT* project(unsigned int);
|
2015-01-06 22:33:37 +00:00
|
|
|
PROJECT* project(char* url);
|
2015-09-07 08:03:54 +00:00
|
|
|
double m_fProjectTotalResourceShare;
|
2005-04-17 02:10:52 +00:00
|
|
|
|
2005-06-13 08:47:51 +00:00
|
|
|
int GetProjectCount();
|
2005-04-17 02:10:52 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int ProjectNoMoreWork(int iIndex);
|
|
|
|
int ProjectAllowMoreWork(int iIndex);
|
|
|
|
int ProjectAttach(const wxString& strURL, const wxString& strAccountKey);
|
|
|
|
int ProjectDetach(int iIndex);
|
|
|
|
int ProjectUpdate(int iIndex);
|
|
|
|
int ProjectReset(int iIndex);
|
|
|
|
int ProjectSuspend(int iIndex);
|
|
|
|
int ProjectResume(int iIndex);
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
//
|
|
|
|
// Work Tab
|
|
|
|
//
|
|
|
|
private:
|
2005-04-24 00:09:40 +00:00
|
|
|
int CachedResultsStatusUpdate();
|
2006-08-31 19:24:38 +00:00
|
|
|
wxDateTime m_dtResultsTimestamp;
|
2010-05-24 10:06:07 +00:00
|
|
|
double m_fResultsRPCExecutionTime;
|
2007-09-21 11:45:57 +00:00
|
|
|
wxDateTime m_dtKillInactiveGfxTimestamp;
|
2007-09-20 11:10:59 +00:00
|
|
|
std::vector<RUNNING_GFX_APP> m_running_gfx_apps;
|
|
|
|
RUNNING_GFX_APP* GetRunningGraphicsApp(RESULT* result, int slot);
|
2007-09-20 12:14:03 +00:00
|
|
|
void KillAllRunningGraphicsApps();
|
|
|
|
void KillInactiveGraphicsApps();
|
2008-02-21 10:50:59 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
void KillGraphicsApp(HANDLE pid);
|
|
|
|
#else
|
|
|
|
void KillGraphicsApp(int tpid);
|
|
|
|
#endif
|
2004-10-11 04:38:00 +00:00
|
|
|
|
|
|
|
public:
|
2005-06-13 08:47:51 +00:00
|
|
|
RESULTS results;
|
2008-07-18 14:38:27 +00:00
|
|
|
RESULTS async_results_buf;
|
2008-07-28 13:09:02 +00:00
|
|
|
int m_iGet_results_rpc_result;
|
2009-08-07 08:33:31 +00:00
|
|
|
bool m_ActiveTasksOnly;
|
2008-07-28 13:09:02 +00:00
|
|
|
|
2005-06-24 10:49:42 +00:00
|
|
|
RESULT* result(unsigned int);
|
2008-03-05 14:41:24 +00:00
|
|
|
RESULT* result(const wxString& name, const wxString& project_url);
|
2004-10-11 04:38:00 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int GetWorkCount();
|
2005-04-17 02:10:52 +00:00
|
|
|
|
2010-03-12 17:47:17 +00:00
|
|
|
int WorkSuspend(char* url, char* name);
|
|
|
|
int WorkResume(char* url, char* name);
|
2007-09-20 00:32:16 +00:00
|
|
|
int WorkShowGraphics(RESULT* result);
|
2012-01-12 22:05:25 +00:00
|
|
|
int WorkShowVMConsole(RESULT* result);
|
2010-03-12 17:47:17 +00:00
|
|
|
int WorkAbort(char* url, char* name);
|
2008-01-30 03:50:32 +00:00
|
|
|
CC_STATE* GetState() { return &state; };
|
2004-10-19 18:14:40 +00:00
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
|
2010-01-04 18:09:29 +00:00
|
|
|
//
|
|
|
|
// Notices Tab
|
|
|
|
//
|
|
|
|
private:
|
2010-03-30 00:06:43 +00:00
|
|
|
wxDateTime m_dtNoticesTimeStamp;
|
2010-01-04 18:09:29 +00:00
|
|
|
|
2010-04-01 11:09:33 +00:00
|
|
|
int m_iNoticeSequenceNumber;
|
|
|
|
int m_iLastReadNoticeSequenceNumber;
|
2010-07-22 20:55:39 +00:00
|
|
|
double m_dLastReadNoticeArrivalTime;
|
2012-12-20 11:55:33 +00:00
|
|
|
bool m_bWaitingForGetNoticesRPC;
|
2010-04-01 11:09:33 +00:00
|
|
|
|
2010-01-04 18:09:29 +00:00
|
|
|
public:
|
|
|
|
NOTICES notices;
|
|
|
|
int m_iGet_notices_rpc_result;
|
|
|
|
|
|
|
|
NOTICE* notice(unsigned int);
|
|
|
|
int CachedNoticeUpdate();
|
2010-07-22 20:55:39 +00:00
|
|
|
|
|
|
|
int GetNoticeCount();
|
|
|
|
int GetUnreadNoticeCount();
|
|
|
|
|
2010-06-18 13:23:22 +00:00
|
|
|
void SaveUnreadNoticeInfo();
|
|
|
|
void RestoreUnreadNoticeInfo();
|
2010-01-04 18:09:29 +00:00
|
|
|
|
2010-07-22 20:55:39 +00:00
|
|
|
void UpdateUnreadNoticeState();
|
2010-01-04 18:09:29 +00:00
|
|
|
int ResetNoticeState();
|
|
|
|
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
//
|
|
|
|
// Messages Tab
|
|
|
|
//
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2005-06-13 08:47:51 +00:00
|
|
|
MESSAGES messages;
|
2008-07-28 13:09:02 +00:00
|
|
|
int m_iGet_messages_rpc_result;
|
|
|
|
|
2005-06-24 10:49:42 +00:00
|
|
|
MESSAGE* message(unsigned int);
|
2005-06-11 00:30:11 +00:00
|
|
|
int CachedMessageUpdate();
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int GetMessageCount();
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int ResetMessageState();
|
2004-12-02 21:43:44 +00:00
|
|
|
|
2013-02-15 12:30:54 +00:00
|
|
|
int m_iFirstMessageSequenceNumber;
|
|
|
|
int m_iLastMessageSequenceNumber;
|
2005-04-06 20:40:19 +00:00
|
|
|
|
2013-02-15 12:30:54 +00:00
|
|
|
int GetFirstMsgSeqNum() { return m_iFirstMessageSequenceNumber; }
|
|
|
|
int GetLastMsgSeqNum() { return m_iLastMessageSequenceNumber; }
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2004-10-22 00:41:18 +00:00
|
|
|
//
|
|
|
|
// Transfers Tab
|
|
|
|
//
|
2004-09-25 21:33:24 +00:00
|
|
|
private:
|
2005-04-24 00:09:40 +00:00
|
|
|
int CachedFileTransfersUpdate();
|
2006-04-17 02:38:47 +00:00
|
|
|
wxDateTime m_dtFileTransfersTimestamp;
|
2004-10-22 00:41:18 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
public:
|
2005-06-13 08:47:51 +00:00
|
|
|
FILE_TRANSFERS ft;
|
2008-07-28 13:09:02 +00:00
|
|
|
FILE_TRANSFERS async_ft_buf;
|
|
|
|
int m_iGet_file_transfers_rpc_result;
|
|
|
|
|
2005-06-24 10:49:42 +00:00
|
|
|
FILE_TRANSFER* file_transfer(unsigned int);
|
2008-03-05 14:41:24 +00:00
|
|
|
FILE_TRANSFER* file_transfer(const wxString& fileName, const wxString& project_url);
|
2004-04-11 04:37:10 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int GetTransferCount();
|
2005-04-17 02:10:52 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int TransferRetryNow(int iIndex);
|
2008-03-05 14:41:24 +00:00
|
|
|
int TransferRetryNow(const wxString& fileName, const wxString& project_url);
|
2005-04-24 00:09:40 +00:00
|
|
|
int TransferAbort(int iIndex);
|
2008-03-05 14:41:24 +00:00
|
|
|
int TransferAbort(const wxString& fileName, const wxString& project_url);
|
2004-10-22 19:23:09 +00:00
|
|
|
|
2004-10-22 22:37:11 +00:00
|
|
|
|
|
|
|
//
|
2006-11-03 17:08:49 +00:00
|
|
|
// Disk Tab
|
2004-10-22 22:37:11 +00:00
|
|
|
//
|
|
|
|
private:
|
2006-11-03 17:08:49 +00:00
|
|
|
wxDateTime m_dtDiskUsageTimestamp;
|
2004-10-22 22:37:11 +00:00
|
|
|
|
|
|
|
public:
|
2006-11-03 17:08:49 +00:00
|
|
|
DISK_USAGE disk_usage;
|
2008-07-28 13:09:02 +00:00
|
|
|
DISK_USAGE async_disk_usage_buf;
|
|
|
|
int m_iGet_dsk_usage_rpc_result;
|
|
|
|
|
2006-11-03 17:08:49 +00:00
|
|
|
PROJECT* DiskUsageProject(unsigned int);
|
2006-11-03 18:00:15 +00:00
|
|
|
int CachedDiskUsageUpdate();
|
2004-10-25 16:14:51 +00:00
|
|
|
|
2005-04-04 06:02:36 +00:00
|
|
|
//
|
|
|
|
// Statistics Tab
|
|
|
|
//
|
|
|
|
private:
|
2005-04-24 00:09:40 +00:00
|
|
|
int CachedStatisticsStatusUpdate();
|
2006-04-17 02:38:47 +00:00
|
|
|
wxDateTime m_dtStatisticsStatusTimestamp;
|
2005-04-04 06:02:36 +00:00
|
|
|
|
|
|
|
public:
|
2008-07-28 13:09:02 +00:00
|
|
|
PROJECTS statistics_status;
|
|
|
|
PROJECTS async_statistics_status_buf;
|
2005-06-24 10:49:42 +00:00
|
|
|
PROJECT* statistic(unsigned int);
|
2008-07-28 13:09:02 +00:00
|
|
|
int m_iGet_statistics_rpc_result;
|
2005-04-04 06:02:36 +00:00
|
|
|
|
2005-04-24 00:09:40 +00:00
|
|
|
int GetStatisticsCount();
|
2005-04-04 06:02:36 +00:00
|
|
|
|
|
|
|
|
2004-10-25 16:14:51 +00:00
|
|
|
//
|
|
|
|
// Proxy Configuration
|
|
|
|
//
|
|
|
|
private:
|
|
|
|
|
|
|
|
public:
|
2005-08-02 01:28:29 +00:00
|
|
|
GR_PROXY_INFO proxy_info;
|
2005-04-24 00:09:40 +00:00
|
|
|
int GetProxyConfiguration();
|
|
|
|
int SetProxyConfiguration();
|
2005-04-06 20:40:19 +00:00
|
|
|
|
2006-06-28 08:53:02 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Simple GUI Updates
|
|
|
|
//
|
2008-07-29 13:06:28 +00:00
|
|
|
int m_iGet_simple_gui2_rpc_result;
|
2008-07-31 00:18:43 +00:00
|
|
|
int m_iAcct_mgr_info_rpc_result;
|
2009-12-18 22:44:10 +00:00
|
|
|
int CachedSimpleGUIUpdate(bool bForce = false);
|
2006-06-28 08:53:02 +00:00
|
|
|
private:
|
|
|
|
wxDateTime m_dtCachedSimpleGUITimestamp;
|
2008-07-31 00:18:43 +00:00
|
|
|
wxDateTime m_dtCachedAcctMgrInfoTimestamp;
|
2006-08-17 20:10:43 +00:00
|
|
|
|
|
|
|
public:
|
2008-07-31 00:18:43 +00:00
|
|
|
ACCT_MGR_INFO ami;
|
|
|
|
ACCT_MGR_INFO async_ami_buf;
|
2008-09-30 09:36:07 +00:00
|
|
|
int GetSimpleProjectCount();
|
2006-08-17 20:10:43 +00:00
|
|
|
int GetSimpleGUIWorkCount();
|
2006-06-28 08:53:02 +00:00
|
|
|
|
2004-07-12 08:46:26 +00:00
|
|
|
};
|
2004-04-11 04:37:10 +00:00
|
|
|
|
2010-05-07 16:14:54 +00:00
|
|
|
extern wxString suspend_reason_wxstring(int reason);
|
2010-11-10 05:43:54 +00:00
|
|
|
extern wxString result_description(RESULT*, bool show_resources=true);
|
2010-06-08 18:56:53 +00:00
|
|
|
extern wxString process_client_message(const char*);
|
2013-07-18 18:30:24 +00:00
|
|
|
extern void localize(wxString& strMessage);
|
|
|
|
extern void eol_to_br(wxString& strMessage);
|
|
|
|
extern void remove_eols(wxString& strMessage);
|
|
|
|
extern void https_to_http(wxString& strMessage);
|
2014-08-10 22:33:07 +00:00
|
|
|
extern void color_cycle(int i, int n, wxColour& color);
|
2015-08-27 06:30:50 +00:00
|
|
|
extern wxString FormatTime(double secs);
|
2010-05-07 16:14:54 +00:00
|
|
|
|
2014-08-18 12:49:31 +00:00
|
|
|
#ifdef __WXMSW__
|
2014-08-19 09:28:42 +00:00
|
|
|
#define ADJUSTFORXDPI(x) (int)(x * GetXDPIScaling())
|
|
|
|
#define ADJUSTFORYDPI(y) (int)(y * GetYDPIScaling())
|
2015-09-07 08:03:54 +00:00
|
|
|
extern double GetXDPIScaling();
|
|
|
|
extern double GetYDPIScaling();
|
2014-08-18 12:49:31 +00:00
|
|
|
#else
|
2014-08-19 09:28:42 +00:00
|
|
|
#define ADJUSTFORXDPI(x) x
|
|
|
|
#define ADJUSTFORYDPI(y) y
|
2014-08-18 12:49:31 +00:00
|
|
|
#endif
|
|
|
|
|
2014-08-26 12:34:22 +00:00
|
|
|
wxBitmap GetScaledBitmapFromXPMData(const char** XPMData);
|
2015-09-22 18:22:07 +00:00
|
|
|
wxString format_number(double x, int nprec);
|
2014-08-26 12:34:22 +00:00
|
|
|
|
2006-06-22 10:10:51 +00:00
|
|
|
#ifdef SANDBOX
|
|
|
|
#define BOINC_MASTER_GROUP_NAME "boinc_master"
|
|
|
|
#endif
|
2010-11-10 05:43:54 +00:00
|
|
|
|
|
|
|
#endif
|