From c7e950e9e3969ddaa1d883663314045237dacb48 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 4 Nov 2008 21:42:58 +0000 Subject: [PATCH] - MGR: Give the option to shutdown the CC even if the manager didn't launch it. This only applies to when the manager and client are on the same machine. clientgui/ BOINCGUIApp.cpp svn path=/trunk/boinc/; revision=16420 --- checkin_notes | 8 ++++++++ clientgui/BOINCGUIApp.cpp | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index ecfc6f1bd7..ddb24fb3f3 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9170,3 +9170,11 @@ David 4 Nov 2008 Makefile.am sched/ handle_request.cpp + +Rom 4 Nov 2008 + - MGR: Give the option to shutdown the CC even if the manager + didn't launch it. This only applies to when the manager + and client are on the same machine. + + clientgui/ + BOINCGUIApp.cpp diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 64ae5cfaad..aee0624912 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -826,6 +826,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { int CBOINCGUIApp::ConfirmExit() { CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); CMainDocument* pDoc = wxGetApp().GetDocument(); + wxString strConnectedCompter = wxEmptyString; bool bWasVisible; int retval = 0; @@ -834,11 +835,20 @@ int CBOINCGUIApp::ConfirmExit() { wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); - if (!(pDoc->m_pClientManager->WasBOINCStartedByManager())) - return 1; // Don't display dialog if exiting manager won't shut down client or its tasks - - if (m_iShutdownCoreClient && !m_iDisplayExitDialog) + // If we are connected to the local core client and the manager is exiting + // give the user the option to shutdown the core client, even if the + // manager didn't launch the core client anyway. + if (!pDoc->m_pClientManager->WasBOINCStartedByManager()) { + pDoc->GetConnectedComputerName(strConnectedCompter); + if (!pDoc->IsComputerNameLocal(strConnectedCompter)) { + // Don't shutdown remote clients + return 1; + } + } + + if (m_iShutdownCoreClient && !m_iDisplayExitDialog) { return 1; // User doesn't want to display the dialog and wants to shutdown the client. + } #ifdef __WXMAC__ // Don't run confirmation dialog if logging out or shutting down