MGR: async GUI RPCs: Code cleanup

svn path=/workspaces/charlief/; revision=15848
This commit is contained in:
Charlie Fenton 2008-08-15 02:27:30 +00:00
parent 4fd82e6052
commit 99de98c8be
8 changed files with 35 additions and 114 deletions

View File

@ -6219,3 +6219,12 @@ Charlie 14 Aug 2008
clientgui/ clientgui/
AsyncRPC.cpp AsyncRPC.cpp
MainDocument.cpp MainDocument.cpp
Charlie 14 Aug 2008
- MGR: async GUI RPCs: Code cleanup.
clientgui/
AdvancedFrame.cpp, .h
AsyncRPC.cpp, .h
Events.h
MainDocument.cpp, .h

View File

@ -187,8 +187,6 @@ BEGIN_EVENT_TABLE (CAdvancedFrame, CBOINCBaseFrame)
EVT_FRAME_UPDATESTATUS(CAdvancedFrame::OnUpdateStatus) EVT_FRAME_UPDATESTATUS(CAdvancedFrame::OnUpdateStatus)
EVT_TIMER(ID_REFRESHSTATETIMER, CAdvancedFrame::OnRefreshState) EVT_TIMER(ID_REFRESHSTATETIMER, CAdvancedFrame::OnRefreshState)
EVT_TIMER(ID_FRAMERENDERTIMER, CAdvancedFrame::OnFrameRender) EVT_TIMER(ID_FRAMERENDERTIMER, CAdvancedFrame::OnFrameRender)
// TODO: Remove ID_FRAMELISTRENDERTIMER and all related code
// EVT_TIMER(ID_FRAMELISTRENDERTIMER, CAdvancedFrame::OnListPanelRender)
EVT_NOTEBOOK_PAGE_CHANGED(ID_FRAMENOTEBOOK, CAdvancedFrame::OnNotebookSelectionChanged) EVT_NOTEBOOK_PAGE_CHANGED(ID_FRAMENOTEBOOK, CAdvancedFrame::OnNotebookSelectionChanged)
END_EVENT_TABLE () END_EVENT_TABLE ()
@ -237,12 +235,8 @@ CAdvancedFrame::CAdvancedFrame(wxString title, wxIcon* icon, wxIcon* icon32) :
m_pFrameRenderTimer = new wxTimer(this, ID_FRAMERENDERTIMER); m_pFrameRenderTimer = new wxTimer(this, ID_FRAMERENDERTIMER);
wxASSERT(m_pFrameRenderTimer); wxASSERT(m_pFrameRenderTimer);
// m_pFrameListPanelRenderTimer = new wxTimer(this, ID_FRAMELISTRENDERTIMER); // CAF
// wxASSERT(m_pFrameListPanelRenderTimer);
m_pRefreshStateTimer->Start(300000); // Send event every 5 minutes m_pRefreshStateTimer->Start(300000); // Send event every 5 minutes
m_pFrameRenderTimer->Start(1000); // Send event every 1 second m_pFrameRenderTimer->Start(1000); // Send event every 1 second
// m_pFrameListPanelRenderTimer->Start(1000); // Send event every 1 second
// Limit the number of times the UI can update itself to two times a second // Limit the number of times the UI can update itself to two times a second
// NOTE: Linux and Mac were updating several times a second and eating // NOTE: Linux and Mac were updating several times a second and eating
@ -258,7 +252,6 @@ CAdvancedFrame::~CAdvancedFrame() {
wxASSERT(m_pRefreshStateTimer); wxASSERT(m_pRefreshStateTimer);
wxASSERT(m_pFrameRenderTimer); wxASSERT(m_pFrameRenderTimer);
// wxASSERT(m_pFrameListPanelRenderTimer);
wxASSERT(m_pMenubar); wxASSERT(m_pMenubar);
wxASSERT(m_pNotebook); wxASSERT(m_pNotebook);
wxASSERT(m_pStatusbar); wxASSERT(m_pStatusbar);
@ -278,12 +271,6 @@ CAdvancedFrame::~CAdvancedFrame() {
m_pFrameRenderTimer = NULL; m_pFrameRenderTimer = NULL;
} }
// if (m_pFrameListPanelRenderTimer) {
// m_pFrameListPanelRenderTimer->Stop();
// delete m_pFrameListPanelRenderTimer;
// m_pFrameListPanelRenderTimer = NULL;
// }
if (m_pStatusbar) if (m_pStatusbar)
wxCHECK_RET(DeleteStatusbar(), _T("Failed to delete status bar.")); wxCHECK_RET(DeleteStatusbar(), _T("Failed to delete status bar."));
@ -1492,8 +1479,6 @@ void CAdvancedFrame::OnOptionsOptions(wxCommandEvent& WXUNUSED(event)) {
wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(wxDynamicCast(pDoc, CMainDocument));
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
pDoc->TestAsyncRPC(); return; // TEMPORARY FOR TESTING ASYNC RPCs -- CAF
// General Tab // General Tab
dlg.m_LanguageSelectionCtrl->Append(wxGetApp().GetSupportedLanguages()); dlg.m_LanguageSelectionCtrl->Append(wxGetApp().GetSupportedLanguages());
@ -1956,11 +1941,6 @@ void CAdvancedFrame::OnFrameRender(wxTimerEvent &event) {
} }
void CAdvancedFrame::OnListPanelRender(wxTimerEvent& WXUNUSED(event)) {
FireRefreshView();
}
void CAdvancedFrame::OnNotebookSelectionChanged(wxNotebookEvent& event) { void CAdvancedFrame::OnNotebookSelectionChanged(wxNotebookEvent& event) {
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::OnNotebookSelectionChanged - Function Begin")); wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::OnNotebookSelectionChanged - Function Begin"));
@ -2062,12 +2042,10 @@ void CAdvancedFrame::UpdateRefreshTimerInterval( wxInt32 iCurrentNotebookPage )
pView = wxDynamicCast(pwndNotebookPage, CBOINCBaseView); pView = wxDynamicCast(pwndNotebookPage, CBOINCBaseView);
wxASSERT(pView); wxASSERT(pView);
// TODO: Confirm we don't need to do something like the following for m_pPeriodicRPCTimer.
#if 0
CMainDocument* pDoc = wxGetApp().GetDocument(); CMainDocument* pDoc = wxGetApp().GetDocument();
if (m_pFrameListPanelRenderTimer && m_pFrameListPanelRenderTimer->IsRunning()) { if (m_pPeriodicRPCTimer && m_pPeriodicRPCTimer->IsRunning()) {
m_pFrameListPanelRenderTimer->Stop(); m_pPeriodicRPCTimer->Stop();
// View specific refresh rates only apply when a connection to the core // View specific refresh rates only apply when a connection to the core
// client has been established, otherwise the refresh rate should be 1 // client has been established, otherwise the refresh rate should be 1
@ -2076,14 +2054,13 @@ void CAdvancedFrame::UpdateRefreshTimerInterval( wxInt32 iCurrentNotebookPage )
wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(wxDynamicCast(pDoc, CMainDocument));
if (pDoc->IsConnected()) { if (pDoc->IsConnected()) {
// Set new view specific refresh rate // Set new view specific refresh rate
m_pFrameListPanelRenderTimer->Start(pView->GetViewRefreshRate() * 1000); m_pPeriodicRPCTimer->Start(pView->GetViewRefreshRate() * 1000);
} else { } else {
// Set view refresh rate to 1 second // Set view refresh rate to 1 second
m_pFrameListPanelRenderTimer->Start(1000); m_pPeriodicRPCTimer->Start(1000);
} }
} }
} }
#endif
} }
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::UpdateRefreshTimerInterval - Function End")); wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::UpdateRefreshTimerInterval - Function End"));
@ -2093,22 +2070,18 @@ void CAdvancedFrame::UpdateRefreshTimerInterval( wxInt32 iCurrentNotebookPage )
void CAdvancedFrame::StartTimers() { void CAdvancedFrame::StartTimers() {
wxASSERT(m_pRefreshStateTimer); wxASSERT(m_pRefreshStateTimer);
wxASSERT(m_pFrameRenderTimer); wxASSERT(m_pFrameRenderTimer);
// wxASSERT(m_pFrameListPanelRenderTimer);
CBOINCBaseFrame::StartTimers(); CBOINCBaseFrame::StartTimers();
m_pRefreshStateTimer->Start(); m_pRefreshStateTimer->Start();
m_pFrameRenderTimer->Start(); m_pFrameRenderTimer->Start();
// m_pFrameListPanelRenderTimer->Start();
} }
void CAdvancedFrame::StopTimers() { void CAdvancedFrame::StopTimers() {
wxASSERT(m_pRefreshStateTimer); wxASSERT(m_pRefreshStateTimer);
wxASSERT(m_pFrameRenderTimer); wxASSERT(m_pFrameRenderTimer);
// wxASSERT(m_pFrameListPanelRenderTimer);
CBOINCBaseFrame::StopTimers(); CBOINCBaseFrame::StopTimers();
m_pRefreshStateTimer->Stop(); m_pRefreshStateTimer->Stop();
m_pFrameRenderTimer->Stop(); m_pFrameRenderTimer->Stop();
// m_pFrameListPanelRenderTimer->Stop();
} }

View File

@ -83,7 +83,6 @@ public:
void OnRefreshState( wxTimerEvent& event ); void OnRefreshState( wxTimerEvent& event );
void OnFrameRender( wxTimerEvent& event ); void OnFrameRender( wxTimerEvent& event );
void OnListPanelRender( wxTimerEvent& event );
void OnNotebookSelectionChanged( wxNotebookEvent& event ); void OnNotebookSelectionChanged( wxNotebookEvent& event );
int GetViewTabIndex() { return m_pNotebook->GetSelection(); } int GetViewTabIndex() { return m_pNotebook->GetSelection(); }
@ -96,7 +95,6 @@ public:
wxTimer* m_pRefreshStateTimer; wxTimer* m_pRefreshStateTimer;
wxTimer* m_pFrameRenderTimer; wxTimer* m_pFrameRenderTimer;
// wxTimer* m_pFrameListPanelRenderTimer;
private: private:

View File

@ -24,7 +24,6 @@
#include <vector> #include <vector>
#include "stdwx.h" #include "stdwx.h"
//#include "wx/artprov.h"
#include "BOINCGUIApp.h" #include "BOINCGUIApp.h"
#include "MainDocument.h" #include "MainDocument.h"
#include "AsyncRPC.h" #include "AsyncRPC.h"
@ -33,8 +32,6 @@
// Delay in milliseconds before showing AsyncRPCDlg // Delay in milliseconds before showing AsyncRPCDlg
#define RPC_WAIT_DLG_DELAY 1500 #define RPC_WAIT_DLG_DELAY 1500
bool LogRPCs = false; // TEMPORARY FOR TESTING ASYNC RPCs -- CAF
ASYNC_RPC_REQUEST::ASYNC_RPC_REQUEST() { ASYNC_RPC_REQUEST::ASYNC_RPC_REQUEST() {
clear(); clear();
} }
@ -100,8 +97,6 @@ int AsyncRPC::RPC_Wait(RPC_SELECTOR which_rpc, void *arg1, void *arg2,
request.arg4 = arg4; request.arg4 = arg4;
retval = m_Doc->RequestRPC(request, hasPriority); retval = m_Doc->RequestRPC(request, hasPriority);
// wxLogMessage(wxT("RequestRPC %d returned %d"), which_rpc, retval);
return retval; return retval;
} }
@ -145,7 +140,6 @@ void *RPCThread::Entry() {
if (! m_Doc->IsConnected()) { if (! m_Doc->IsConnected()) {
Yield(); Yield();
// continue;
} }
retval = ProcessRPCRequest(); retval = ProcessRPCRequest();
@ -169,8 +163,6 @@ int RPCThread::ProcessRPCRequest() {
ASYNC_RPC_REQUEST *current_request; ASYNC_RPC_REQUEST *current_request;
current_request = m_Doc->GetCurrentRPCRequest(); current_request = m_Doc->GetCurrentRPCRequest();
//Sleep(5000); // TEMPORARY FOR TESTING ASYNC RPCs -- CAF
switch (current_request->which_rpc) { switch (current_request->which_rpc) {
// RPC_SELECTORS with no arguments // RPC_SELECTORS with no arguments
case RPC_RUN_BENCHMARKS: case RPC_RUN_BENCHMARKS:
@ -218,7 +210,6 @@ int RPCThread::ProcessRPCRequest() {
int n = ((CC_STATE*)(current_request->exchangeBuf))->projects.size(); int n = ((CC_STATE*)(current_request->exchangeBuf))->projects.size();
for (int i=0; i<n; i++) { for (int i=0; i<n; i++) {
PROJECT* p = new PROJECT(); PROJECT* p = new PROJECT();
// p->copy(*((CC_STATE*)(current_request->exchangeBuf))->projects[i]);
// get_project_status RPC needs master_url and will fill in everything else // get_project_status RPC needs master_url and will fill in everything else
p->master_url = ((CC_STATE*)(current_request->exchangeBuf))->projects[i]->master_url; p->master_url = ((CC_STATE*)(current_request->exchangeBuf))->projects[i]->master_url;
((CC_STATE*)(current_request->arg1))->projects.push_back(p); ((CC_STATE*)(current_request->arg1))->projects.push_back(p);
@ -398,7 +389,7 @@ int RPCThread::ProcessRPCRequest() {
} }
// We don't need critical sections because: // We don't need critical sections (except when exiting Manager) because:
// 1. CMainDocument never modifies mDoc->current_rpc_request while the // 1. CMainDocument never modifies mDoc->current_rpc_request while the
// async RPC thread is using it. // async RPC thread is using it.
// 2. The async RPC thread never modifies either mDoc->current_rpc_request // 2. The async RPC thread never modifies either mDoc->current_rpc_request
@ -427,8 +418,9 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
} }
if (hasPriority) { if (hasPriority) {
// hasPriority should be set if this is a user-initiated event. // We may want to set hasPriority for some user-initiated events.
// Since the user is waiting, insert this at head of request queue // Since the user is waiting, insert this at head of request queue.
// As of 8/14/08, hasPriority is never set true, so hasn't been tested.
iter = RPC_requests.insert(RPC_requests.begin(), request); iter = RPC_requests.insert(RPC_requests.begin(), request);
} else { } else {
RPC_requests.push_back(request); RPC_requests.push_back(request);
@ -443,7 +435,6 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
} }
#ifndef __WXMSW__ // Deadlocks on Windows #ifndef __WXMSW__ // Deadlocks on Windows
if (current_rpc_request.isActive && m_RPCThread->IsPaused()) { if (current_rpc_request.isActive && m_RPCThread->IsPaused()) {
// wxLogMessage(wxT("RequestRPC Resume"));
m_RPCThread->Resume(); m_RPCThread->Resume();
} }
#endif // !!__WXMSW__ // Deadlocks on Windows #endif // !!__WXMSW__ // Deadlocks on Windows
@ -451,7 +442,7 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
// If no completion event specified, this is a user-initiated event so // If no completion event specified, this is a user-initiated event so
// wait for completion but show a dialog allowing the user to cancel. // wait for completion but show a dialog allowing the user to cancel.
if (request.event == 0) { if (request.event == 0) {
// TODO: proper handling if a second user request is received while first is pending // TODO: proper handling if a second user request is received while first is pending ??
if (m_bWaitingForRPC) { if (m_bWaitingForRPC) {
wxLogMessage(wxT("Second user RPC request while another was pending")); wxLogMessage(wxT("Second user RPC request while another was pending"));
wxASSERT(false); wxASSERT(false);
@ -460,10 +451,6 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
m_bWaitingForRPC = true; m_bWaitingForRPC = true;
// Don't show dialog if RPC completes before RPC_WAIT_DLG_DELAY // Don't show dialog if RPC completes before RPC_WAIT_DLG_DELAY
wxStopWatch Dlgdelay = wxStopWatch(); wxStopWatch Dlgdelay = wxStopWatch();
// CBOINCBaseFrame* pFrame = wxGetApp().GetFrame();
// wxASSERT(wxDynamicCast(pFrame, CBOINCBaseFrame));
m_RPCWaitDlg = new AsyncRPCDlg(); m_RPCWaitDlg = new AsyncRPCDlg();
do { do {
// Simulate handling of CRPCFinishedEvent but don't allow any other events (so no user activity) // Simulate handling of CRPCFinishedEvent but don't allow any other events (so no user activity)
@ -481,7 +468,6 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
} else { } else {
// for safety // for safety
if (m_RPCThread->IsPaused()) { if (m_RPCThread->IsPaused()) {
// wxLogMessage(wxT("RequestRPC 2 Resume"));
m_RPCThread->Resume(); m_RPCThread->Resume();
} }
#endif // !!__WXMSW__ // Deadlocks on Windows #endif // !!__WXMSW__ // Deadlocks on Windows
@ -498,7 +484,7 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
if (m_RPCWaitDlg->ShowModal() != wxID_OK) { if (m_RPCWaitDlg->ShowModal() != wxID_OK) {
// TODO: If user presses Cancel in Please Wait dialog but request // TODO: If user presses Cancel in Please Wait dialog but request
// has not yet been started, should we just remove it from queue? // has not yet been started, should we just remove it from queue?
// If wemake that change, should we also add a separate menu item // If we make that change, should we also add a separate menu item
// to reset the RPC connection (or does one already exist)? // to reset the RPC connection (or does one already exist)?
retval = -1; retval = -1;
@ -510,7 +496,6 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
// start a new RPC thread. // start a new RPC thread.
if (current_rpc_request.isActive) { if (current_rpc_request.isActive) {
current_rpc_request.isActive = false; current_rpc_request.isActive = false;
// wxLogMessage(wxT("RequestRPC Cancel Pause"));
m_RPCThread->Pause(); // Needed on Windows m_RPCThread->Pause(); // Needed on Windows
rpcClient.close(); rpcClient.close();
m_RPCThread->Kill(); m_RPCThread->Kill();
@ -522,9 +507,6 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
current_rpc_request.clear(); current_rpc_request.clear();
// We will be reconnected to the same client (if possible) by // We will be reconnected to the same client (if possible) by
// CBOINCDialUpManager::OnPoll() and CNetworkConnection::Poll(). // CBOINCDialUpManager::OnPoll() and CNetworkConnection::Poll().
// wxString strComputer = wxEmptyString;
// GetConnectedComputerName(strComputer);
// retval2 = rpcClient.init(strComputer.mb_str(), m_pNetworkConnection->GetGUI_RPC_Port());
m_pNetworkConnection->SetStateDisconnected(); m_pNetworkConnection->SetStateDisconnected();
m_RPCThread = new RPCThread(this); m_RPCThread = new RPCThread(this);
wxASSERT(m_RPCThread); wxASSERT(m_RPCThread);
@ -532,9 +514,9 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
wxASSERT(!retval2); wxASSERT(!retval2);
retval2 = m_RPCThread->Run(); retval2 = m_RPCThread->Run();
wxASSERT(!retval2); wxASSERT(!retval2);
// wxLogMessage(wxT("RequestRPC Cancel 2 Pause"));
// m_RPCThread->Pause(); // m_RPCThread->Pause();
} }
}
if (m_RPCWaitDlg) { if (m_RPCWaitDlg) {
m_RPCWaitDlg->Destroy(); m_RPCWaitDlg->Destroy();
} }
@ -542,7 +524,6 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) {
m_bWaitingForRPC = false; m_bWaitingForRPC = false;
} }
} }
}
return retval; return retval;
} }
@ -732,11 +713,9 @@ void CMainDocument::HandleCompletedRPC() {
current_rpc_request.isActive = true; current_rpc_request.isActive = true;
#ifndef __WXMSW__ // Deadlocks on Windows #ifndef __WXMSW__ // Deadlocks on Windows
if (m_RPCThread->IsPaused()) { if (m_RPCThread->IsPaused()) {
// wxLogMessage(wxT("HandleCompletedRPC Resume"));
m_RPCThread->Resume(); m_RPCThread->Resume();
} }
} else { } else {
// wxLogMessage(wxT("HandleCompletedRPC Pause"));
m_RPCThread->Pause(); m_RPCThread->Pause();
while (!m_RPCThread->IsPaused()) { while (!m_RPCThread->IsPaused()) {
#ifdef __WXMSW__ #ifdef __WXMSW__
@ -773,10 +752,6 @@ AsyncRPCDlg::AsyncRPCDlg() : wxDialog( NULL, wxID_ANY, wxT(""), wxDefaultPositio
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL );
// wxBitmap bitmap = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_MESSAGE_BOX);
// wxStaticBitmap *icon = new wxStaticBitmap(this, wxID_ANY, bitmap);
// icon_text->Add( icon, 0, wxCENTER );
icon_text->Add( CreateTextSizer( message ), 0, wxALIGN_CENTER | wxLEFT, 10 ); icon_text->Add( CreateTextSizer( message ), 0, wxALIGN_CENTER | wxLEFT, 10 );
topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
@ -798,37 +773,13 @@ AsyncRPCDlg::AsyncRPCDlg() : wxDialog( NULL, wxID_ANY, wxT(""), wxDefaultPositio
} }
Centre( wxBOTH | wxCENTER_FRAME); Centre( wxBOTH | wxCENTER_FRAME);
#if USE_RPC_DLG_TIMER
m_pDlgDelayTimer = new wxTimer(this, wxID_ANY);
wxASSERT(m_pDlgDelayTimer);
m_pDlgDelayTimer->Start(100, false);
#endif // USE_RPC_DLG_TIMER
} }
#if USE_RPC_DLG_TIMER #if 0
BEGIN_EVENT_TABLE(AsyncRPCDlg, wxMessageDialog)
EVT_TIMER(wxID_ANY, AsyncRPCDlg::OnRPCDlgTimer)
END_EVENT_TABLE()
AsyncRPCDlg::~AsyncRPCDlg() {
if (m_pDlgDelayTimer) {
m_pDlgDelayTimer->Stop();
delete m_pDlgDelayTimer;
m_pDlgDelayTimer = NULL;
}
}
void AsyncRPCDlg::OnRPCDlgTimer(wxTimerEvent& WXUNUSED(event)) {
::wxWakeUpIdle();
}
#endif // USE_RPC_DLG_TIMER
/// For testing: triggered by Advanced / Options menu item. /// For testing: triggered by Advanced / Options menu item.
void CMainDocument::TestAsyncRPC() { // TEMPORARY FOR TESTING ASYNC RPCs -- CAF void CMainDocument::TestAsyncRPC() {
ALL_PROJECTS_LIST pl; ALL_PROJECTS_LIST pl;
ASYNC_RPC_REQUEST request; ASYNC_RPC_REQUEST request;
wxDateTime completionTime = wxDateTime((time_t)0); wxDateTime completionTime = wxDateTime((time_t)0);
@ -846,7 +797,7 @@ void CMainDocument::TestAsyncRPC() { // TEMPORARY FOR TESTING ASYNC RPCs
request.eventHandler = NULL; request.eventHandler = NULL;
request.completionTime = &completionTime; request.completionTime = &completionTime;
// request.result = NULL; // request.result = NULL;
request.resultPtr = &rpc_result; // TEMPORARY FOR TESTING ASYNC RPCs -- CAF request.resultPtr = &rpc_result; // For testing async RPCs
request.isActive = false; request.isActive = false;
//retval = rpcClient.get_all_projects_list(pl); //retval = rpcClient.get_all_projects_list(pl);
@ -860,3 +811,4 @@ void CMainDocument::TestAsyncRPC() { // TEMPORARY FOR TESTING ASYNC RPCs
wxLogMessage(wxT("rpcClient.get_all_projects_list returned %d\n"), rpc_result); wxLogMessage(wxT("rpcClient.get_all_projects_list returned %d\n"), rpc_result);
} }
#endif

View File

@ -31,8 +31,6 @@
//#include "common_defs.h" //#include "common_defs.h"
//#include "gui_rpc_client.h" //#include "gui_rpc_client.h"
#define USE_RPC_DLG_TIMER 0
class CBOINCGUIApp; // Forward declaration class CBOINCGUIApp; // Forward declaration
class CMainDocument; // Forward declaration class CMainDocument; // Forward declaration
@ -272,14 +270,6 @@ class AsyncRPCDlg : public wxDialog
public: public:
AsyncRPCDlg(); AsyncRPCDlg();
void OnRPCDlgTimer(wxTimerEvent &event); void OnRPCDlgTimer(wxTimerEvent &event);
#if USE_RPC_DLG_TIMER
~AsyncRPCDlg();
private:
wxTimer* m_pDlgDelayTimer;
DECLARE_EVENT_TABLE()
#endif // USE_RPC_DLG_TIMER
}; };

View File

@ -27,7 +27,6 @@
#define ID_REFRESHSTATETIMER 6003 #define ID_REFRESHSTATETIMER 6003
#define ID_FRAMERENDERTIMER 6004 #define ID_FRAMERENDERTIMER 6004
#define ID_FRAMETASKRENDERTIMER 6005 #define ID_FRAMETASKRENDERTIMER 6005
#define ID_FRAMELISTRENDERTIMER 6006
#define ID_DOCUMENTPOLLTIMER 6007 #define ID_DOCUMENTPOLLTIMER 6007
#define ID_ALERTPOLLTIMER 6009 #define ID_ALERTPOLLTIMER 6009
#define ID_FILEACTIVITYRUNALWAYS 6010 #define ID_FILEACTIVITYRUNALWAYS 6010

View File

@ -932,7 +932,7 @@ void CMainDocument::RunPeriodicRPCs() {
} }
// TODO: CAF: Is it enough to just reset m_dtCachedStateTimestamp // TODO: Is it enough to just reset m_dtCachedStateTimestamp
// and let RunPeriodicRPCs() update the state? This would avoid // and let RunPeriodicRPCs() update the state? This would avoid
// displaying the "Please wait" dialog on multi-processor computers. // displaying the "Please wait" dialog on multi-processor computers.
// Possible exceptions might be when ForceCacheUpdate() is called // Possible exceptions might be when ForceCacheUpdate() is called

View File

@ -179,7 +179,7 @@ public:
void OnRPCComplete(CRPCFinishedEvent& event); void OnRPCComplete(CRPCFinishedEvent& event);
void HandleCompletedRPC(); void HandleCompletedRPC();
ASYNC_RPC_REQUEST* GetCurrentRPCRequest() { return &current_rpc_request; }; ASYNC_RPC_REQUEST* GetCurrentRPCRequest() { return &current_rpc_request; };
void TestAsyncRPC(); // TEMPORARY -- CAF // void TestAsyncRPC(); // For testing Async RPCs
RPCThread* m_RPCThread; RPCThread* m_RPCThread;
wxCriticalSection m_critsect; wxCriticalSection m_critsect;