Skip to content

Commit

Permalink
Merge pull request #5634 from AenBleidd/vko_fix_shutdown_client_behav…
Browse files Browse the repository at this point in the history
…ior_on_linux

[linux][Manager] Allow shutting down local client when run outside of BOINC Manager but not as a daemon
  • Loading branch information
AenBleidd committed May 24, 2024
1 parent f43cbff commit 64035af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clientgui/AdvancedFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ void CAdvancedFrame::OnMenuOpening( wxMenuEvent &event) {
wxMenuItem* shutClientItem = menu->FindChildItem(ID_SHUTDOWNCORECLIENT, NULL);
if (shutClientItem) {
#ifdef __WXGTK__
shutClientItem->Enable(isConnected && pDoc->m_pClientManager->WasBOINCStartedByManager());
shutClientItem->Enable(isConnected && (pDoc->m_pClientManager->WasBOINCStartedByManager() || !pDoc->m_pClientManager->IsBOINCConfiguredAsDaemon()));
#else
shutClientItem->Enable(isConnected);
#endif
Expand Down
9 changes: 7 additions & 2 deletions clientgui/BOINCClientManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,16 @@ void CBOINCClientManager::ShutdownBOINCCore(bool ShuttingDownManager) {
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));

#if defined (__WXMAC__) || defined (__WXGTK__)
// Mac and Linux Manager shuts down client only if Manager started client
#ifdef __WXMAC__
// Mac Manager shuts down client only if Manager started client
if (!m_bBOINCStartedByManager) return;
#endif

#ifdef __WXGTK__
// Linux Manager shuts down client only if Manager started client or client is not a daemon
if (!m_bBOINCStartedByManager && IsBOINCConfiguredAsDaemon()) return;
#endif

#ifdef __WXMSW__
if (IsBOINCConfiguredAsDaemon()) {
stop_daemon_via_daemonctrl();
Expand Down

0 comments on commit 64035af

Please sign in to comment.