diff --git a/checkin_notes b/checkin_notes index d99005d0e3..51fd791536 100755 --- a/checkin_notes +++ b/checkin_notes @@ -876,3 +876,20 @@ David 19 Jan 2007 lib/ mfile.C + +Rom 19 Jan 2007 + - MGR: If the manager detects that the CC has crashed, and it was the one + who started the CC to begin with, restart the CC after 30 seconds. + - MGR: Cleanup some of the taskbar interactions where both the tooltip and + balloon were being displayed on Windows. Only one should be shown. + - MGR: Allow arguments to be passed to the CC from the manager's parameter + list. /b "..." or /boincargs "..." should work. + + clientgui/ + AdvancedFrame.cpp + BOINCBaseFrame.cpp + BOINCGUIApp.cpp, .h + BOINCTaskBar.cpp + MainDocument.cpp + ViewResources.cpp + \ No newline at end of file diff --git a/clientgui/AdvancedFrame.cpp b/clientgui/AdvancedFrame.cpp index f596dd0232..aa78ae55ac 100644 --- a/clientgui/AdvancedFrame.cpp +++ b/clientgui/AdvancedFrame.cpp @@ -1694,15 +1694,14 @@ void CAdvancedFrame::OnFrameRender(wxTimerEvent &event) { wxString strTitle = m_strBaseTitle; wxString strLocale = wxString(setlocale(LC_NUMERIC, NULL), wxConvUTF8); - if (pDoc->IsReconnecting()) + if (pDoc->IsReconnecting()) { pDoc->GetConnectingComputerName(strComputerName); - else + } else { pDoc->GetConnectedComputerName(strComputerName); + } if (pDoc->IsComputerNameLocal(strComputerName)) { - strTitle += wxT(" - (localhost)"); - } else { - strStatusText += strComputerName; + strComputerName = wxT("localhost"); } if (pDoc->IsReconnecting()) { diff --git a/clientgui/BOINCBaseFrame.cpp b/clientgui/BOINCBaseFrame.cpp index dd26c77c92..f0edca7887 100644 --- a/clientgui/BOINCBaseFrame.cpp +++ b/clientgui/BOINCBaseFrame.cpp @@ -383,6 +383,11 @@ void CBOINCBaseFrame::ShowConnectionFailedAlert() { wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::ShowConnectionFailedAlert - Function Begin")); + + // Did BOINC crash? If so restart it. + wxGetApp().AutoRestartBOINC(); + + // %s is the application name // i.e. 'BOINC Manager', 'GridRepublic Manager' strDialogTitle.Printf( @@ -425,6 +430,11 @@ void CBOINCBaseFrame::ShowNotCurrentlyConnectedAlert() { wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::ShowNotCurrentlyConnectedAlert - Function Begin")); + + // Did BOINC crash? If so restart it. + wxGetApp().AutoRestartBOINC(); + + // %s is the application name // i.e. 'BOINC Manager', 'GridRepublic Manager' strDialogTitle.Printf( diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 8c0ed67a92..9dfa75f022 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -76,6 +76,7 @@ bool CBOINCGUIApp::OnInit() { // Setup variables with default values m_bBOINCStartedByManager = false; + m_strBOINCArguments = wxEmptyString; m_pLocale = NULL; m_pSkinManager = NULL; m_pFrame = NULL; @@ -367,7 +368,8 @@ void CBOINCGUIApp::OnInitCmdLine(wxCmdLineParser &parser) { wxApp::OnInitCmdLine(parser); static const wxCmdLineEntryDesc cmdLineDesc[] = { { wxCMD_LINE_SWITCH, wxT("s"), wxT("systray"), _("Startup BOINC so only the system tray icon is visible")}, - { wxCMD_LINE_SWITCH, wxT("insecure"), wxT("insecure"), _("disable BOINC security users and permissions")}, + { wxCMD_LINE_SWITCH, wxT("b"), wxT("boincargs"), _("Startup BOINC with these optional arguments")}, + { wxCMD_LINE_SWITCH, wxT("i"), wxT("insecure"), _("disable BOINC security users and permissions")}, { wxCMD_LINE_NONE} //DON'T forget this line!! }; parser.SetDesc(cmdLineDesc); @@ -377,6 +379,7 @@ void CBOINCGUIApp::OnInitCmdLine(wxCmdLineParser &parser) { bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser) { // Give default processing (-?, --help and --verbose) the chance to do something. wxApp::OnCmdLineParsed(parser); + parser.Found(wxT("boincargs"), &m_strBOINCArguments); if (parser.Found(wxT("systray"))) { m_bGUIVisible = false; } @@ -443,6 +446,14 @@ void CBOINCGUIApp::InitSupportedLanguages() { } +bool CBOINCGUIApp::AutoRestartBOINC() { + if (!IsBOINCCoreRunning() && m_bBOINCStartedByManager) { + StartupBOINCCore(); + } + return true; +} + + bool CBOINCGUIApp::IsBOINCCoreRunning() { wxLogTrace(wxT("Function Start/End"), wxT("CBOINCGUIApp::IsBOINCCoreRunning - Function Begin")); @@ -576,7 +587,11 @@ void CBOINCGUIApp::StartupBOINCCore() { #ifdef __WXMSW__ // Append boinc.exe to the end of the strExecute string and get ready to rock - strExecute = wxT("\"") + strDirectory + wxT("\\boinc.exe\" -redirectio -launched_by_manager"); + strExecute.Printf( + wxT("\"%s\\boinc.exe\" -redirectio -launched_by_manager %s"), + strDirectory.c_str(), + m_strBOINCArguments.c_str() + ); PROCESS_INFORMATION pi; STARTUPINFO si; diff --git a/clientgui/BOINCGUIApp.h b/clientgui/BOINCGUIApp.h index 0453264db0..37249a5f86 100644 --- a/clientgui/BOINCGUIApp.h +++ b/clientgui/BOINCGUIApp.h @@ -76,6 +76,8 @@ protected: #endif bool m_bBOINCStartedByManager; + wxString m_strBOINCArguments; + int m_iDisplayExitWarning; bool m_bGUIVisible; @@ -100,6 +102,8 @@ public: bool OnInit(); + bool AutoRestartBOINC(); + int IsNetworkAlive(long* lpdwFlags); int IsNetworkAlwaysOnline(); int UpdateSystemIdleDetection(); diff --git a/clientgui/BOINCTaskBar.cpp b/clientgui/BOINCTaskBar.cpp index 44d3528414..80eb51ec07 100644 --- a/clientgui/BOINCTaskBar.cpp +++ b/clientgui/BOINCTaskBar.cpp @@ -93,10 +93,6 @@ CTaskBarIcon::CTaskBarIcon(wxString title, wxIcon* icon, wxIcon* iconDisconnecte m_pRefreshTimer = new wxTimer(this, ID_TB_TIMER); m_pRefreshTimer->Start(1000); // Send event every second - -#ifndef __WXMAC__ - SetIcon(m_iconTaskBarNormal, m_strDefaultTitle); -#endif } @@ -147,12 +143,24 @@ void CTaskBarIcon::OnRefresh(wxTimerEvent& WXUNUSED(event)) { // Which icon should be displayed? if (!pDoc->IsConnected()) { - SetIcon(m_iconTaskBarDisconnected, m_strDefaultTitle); + if (IsBalloonsSupported()) { + SetIcon(m_iconTaskBarDisconnected, wxEmptyString); + } else { + SetIcon(m_iconTaskBarDisconnected, m_strDefaultTitle); + } } else { if (RUN_MODE_NEVER == status.task_mode) { - SetIcon(m_iconTaskBarSnooze, m_strDefaultTitle); + if (IsBalloonsSupported()) { + SetIcon(m_iconTaskBarSnooze, wxEmptyString); + } else { + SetIcon(m_iconTaskBarSnooze, m_strDefaultTitle); + } } else { - SetIcon(m_iconTaskBarNormal, m_strDefaultTitle); + if (IsBalloonsSupported()) { + SetIcon(m_iconTaskBarNormal, wxEmptyString); + } else { + SetIcon(m_iconTaskBarNormal, m_strDefaultTitle); + } } } @@ -327,6 +335,9 @@ void CTaskBarIcon::OnMouseMove(wxTaskBarIconEvent& WXUNUSED(event)) { if (pDoc->IsConnected()) { pDoc->GetConnectedComputerName(strMachineName); + if (pDoc->IsComputerNameLocal(strMachineName)) { + strMachineName = wxT("localhost"); + } strTitle = strTitle + wxT(" - (") + strMachineName + wxT(")"); pDoc->GetCoreClientStatus(status); diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 16a0e8a5ab..0248f7d2dc 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -138,9 +138,9 @@ void CNetworkConnection::Poll() { // if we are connecting to the localhost we need to retry the connection // for awhile so that the users can respond to firewall prompts. if (IsComputerNameLocal(strComputer)) { - retval = m_pDocument->rpc.init_asynch(NULL, 60., true); + retval = m_pDocument->rpc.init_asynch(NULL, 30., true); } else { - retval = m_pDocument->rpc.init_asynch(strComputer.mb_str(), 60., false); + retval = m_pDocument->rpc.init_asynch(strComputer.mb_str(), 30., false); } if (!retval) { @@ -237,6 +237,8 @@ void CNetworkConnection::SetStateReconnecting() { m_bReconnectOnError = false; m_bForceReconnect = false; m_bReconnecting = true; + m_strNewComputerName = m_strConnectedComputerName; + m_strNewComputerPassword = m_strConnectedComputerPassword; } } diff --git a/clientgui/ViewResources.cpp b/clientgui/ViewResources.cpp index e9d768d189..d7c343d28c 100644 --- a/clientgui/ViewResources.cpp +++ b/clientgui/ViewResources.cpp @@ -157,7 +157,7 @@ wxInt32 CViewResources::FormatProjectName(PROJECT* project, wxString& strBuffer) } -bool CViewResources::OnSaveState(wxConfigBase* pConfig) { +bool CViewResources::OnSaveState(wxConfigBase* /*pConfig*/) { return true;/*bool bReturnValue = true; wxASSERT(pConfig); @@ -170,7 +170,7 @@ bool CViewResources::OnSaveState(wxConfigBase* pConfig) { return bReturnValue;*/ } -bool CViewResources::OnRestoreState(wxConfigBase* pConfig) { +bool CViewResources::OnRestoreState(wxConfigBase* /*pConfig*/) { return true;/*wxASSERT(pConfig); wxASSERT(m_pTaskPane); diff --git a/clientgui/msw/taskbarex.cpp b/clientgui/msw/taskbarex.cpp index 8fca84b3af..8256d9b0e3 100644 --- a/clientgui/msw/taskbarex.cpp +++ b/clientgui/msw/taskbarex.cpp @@ -164,9 +164,10 @@ bool wxTaskBarIconEx::SetBalloon(const wxIcon& icon, const wxString title, const if (IsBalloonsSupported()) { - notifyData.uFlags |= NIF_INFO; + notifyData.uFlags |= NIF_INFO | NIF_TIP; lstrcpyn(notifyData.szInfo, WXSTRINGCAST message, sizeof(notifyData.szInfo)); lstrcpyn(notifyData.szInfoTitle, WXSTRINGCAST title, sizeof(notifyData.szInfoTitle)); + lstrcpyn(notifyData.szTip, WXSTRINGCAST wxEmptyString, sizeof(notifyData.szTip)); } else {