From 79864a951b05bb03b169c970588587a964bff431 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 18 Jul 2006 11:21:13 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=10671 --- checkin_notes | 11 +++++++++++ clientgui/BOINCGUIApp.cpp | 31 +++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/checkin_notes b/checkin_notes index 1c352ed058..55311fc556 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7646,3 +7646,14 @@ Charlie 17 July 2006 mac_saver_module.cpp lib/ gui_rpc_client.h + +Charlie 18 July 2006 + - Mac: If /Library/StartupItems/boinc/boinc is present to run Client + as a daemon, Manager waits up to 10 seconds for daemon to launch. + - Improve shell script for setting up Mac to run BOINC Client as + a daemon: add support for stop function. + + clientgui/ + BOINCGUIApp.cpp + mac_build/ + Make_BOINC_Service.sh diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index e544e71d83..dcef6b81c2 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -446,15 +446,6 @@ bool CBOINCGUIApp::OnInit() { m_pBranding->GetApplicationSnoozeIcon() ); wxASSERT(m_pTaskBarIcon); -#ifdef __WXMAC__ - m_pMacSystemMenu = new CMacSystemMenu( - m_pBranding->GetApplicationName(), - m_pBranding->GetApplicationIcon(), - m_pBranding->GetApplicationDisconnectedIcon(), - m_pBranding->GetApplicationSnoozeIcon() - ); - wxASSERT(m_pMacSystemMenu); -#endif // Detect the display info and store for later use. DetectDisplayInfo(); @@ -466,6 +457,14 @@ bool CBOINCGUIApp::OnInit() { StartupBOINCCore(); #ifdef __WXMAC__ + m_pMacSystemMenu = new CMacSystemMenu( + m_pBranding->GetApplicationName(), + m_pBranding->GetApplicationIcon(), + m_pBranding->GetApplicationDisconnectedIcon(), + m_pBranding->GetApplicationSnoozeIcon() + ); + wxASSERT(m_pMacSystemMenu); + ProcessSerialNumber psn; ProcessInfoRec pInfo; OSStatus err; @@ -618,7 +617,7 @@ bool CBOINCGUIApp::IsBOINCCoreRunning() { wxLogTrace(wxT("Function Start/End"), wxT("CBOINCGUIApp::IsBOINCCoreRunning - Function Begin")); int retval; - bool running; + bool running = false; RPC_CLIENT rpc; #ifdef __WXMSW__ @@ -631,6 +630,18 @@ bool CBOINCGUIApp::IsBOINCCoreRunning() { rpc.close(); } +#elif defined __WXMAC__ + // If set up to run as a daemon, allow time for daemon to start up + bool waitfordaemon = boinc_file_exists("/Library/StartupItems/boinc/boinc") && + (TickCount() < (120*60)); // If system has been up for less than 2 minutes + for (int i=0; i<10; i++) { + retval = rpc.init("localhost"); // synchronous is OK since local + running = (retval == 0); + rpc.close(); + if (running) break; + if (! waitfordaemon) break; + sleep(1); + } #else retval = rpc.init("localhost"); // synchronous is OK since local running = (retval == 0);