From 7fbdeda9a3c8277a8b82ea796eb3820a9ce9bffa Mon Sep 17 00:00:00 2001 From: RichardHaselgrove Date: Wed, 19 Aug 2020 18:12:06 +0100 Subject: [PATCH] Manager: Add option to restore 'shutdown client' confirmation. --- clientgui/DlgOptions.cpp | 13 +++++++++++++ clientgui/DlgOptions.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/clientgui/DlgOptions.cpp b/clientgui/DlgOptions.cpp index 6318f329d6..3a5ad893f1 100644 --- a/clientgui/DlgOptions.cpp +++ b/clientgui/DlgOptions.cpp @@ -101,6 +101,7 @@ bool CDlgOptions::Create(wxWindow* parent, wxWindowID id, const wxString& captio m_EnableBOINCManagerAutoStartCtrl = NULL; m_EnableRunDaemonCtrl = NULL; m_EnableBOINCManagerExitMessageCtrl = NULL; + m_EnableBOINCClientShutdownMessageCtrl = NULL; m_DialupStaticBoxCtrl = NULL; #if defined(__WXMSW__) m_DialupConnectionsCtrl = NULL; @@ -229,6 +230,16 @@ void CDlgOptions::CreateControls() { m_EnableBOINCManagerExitMessageCtrl->SetToolTip(_("Display the exit dialog when shutting down the Manager.")); itemFlexGridSizer6->Add(m_EnableBOINCManagerExitMessageCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText13 = new wxStaticText; + itemStaticText13->Create( itemPanel4, wxID_STATIC, _("Enable Client shutdown dialog?"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer6->Add(itemStaticText13, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + + m_EnableBOINCClientShutdownMessageCtrl = new wxCheckBox; + m_EnableBOINCClientShutdownMessageCtrl->Create( itemPanel4, ID_ENABLESHUTDOWNMESSAGE, wxT(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE); + if (ShowToolTips()) + m_EnableBOINCClientShutdownMessageCtrl->SetToolTip(_("Display confirmation dialog when shutting down the connected client.")); + itemFlexGridSizer6->Add(m_EnableBOINCClientShutdownMessageCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemNotebook3->AddPage(itemPanel4, _("General")); #if defined(__WXMSW__) @@ -628,6 +639,7 @@ bool CDlgOptions::ReadSettings() { //m_ReminderFrequencyCtrl->SetValue(m_iReminderFrequency); m_EnableBOINCManagerExitMessageCtrl->SetValue(wxGetApp().GetBOINCMGRDisplayExitMessage() != 0); + m_EnableBOINCClientShutdownMessageCtrl->SetValue(wxGetApp().GetBOINCMGRDisplayShutdownConnectedClientMessage() != 0); #ifdef __WXMSW__ m_EnableBOINCManagerAutoStartCtrl->SetValue(!wxGetApp().GetBOINCMGRDisableAutoStart()); @@ -743,6 +755,7 @@ bool CDlgOptions::SaveSettings() { } wxGetApp().SetBOINCMGRDisplayExitMessage(m_EnableBOINCManagerExitMessageCtrl->GetValue()); + wxGetApp().SetBOINCMGRDisplayShutdownConnectedClientMessage(m_EnableBOINCClientShutdownMessageCtrl->GetValue()); #ifdef __WXMSW__ wxGetApp().SetBOINCMGRDisableAutoStart(!m_EnableBOINCManagerAutoStartCtrl->GetValue()); diff --git a/clientgui/DlgOptions.h b/clientgui/DlgOptions.h index a51e63be4c..6f781fde6e 100644 --- a/clientgui/DlgOptions.h +++ b/clientgui/DlgOptions.h @@ -56,6 +56,7 @@ #define ID_ENABLEAUTOSTART 10031 #define ID_ENABLEEXITMESSAGE 10032 #define ID_ENABLERUNDAEMON 10033 +#define ID_ENABLESHUTDOWNMESSAGE 10034 #define ID_CONNECTONS 10019 #define ID_NETWORKAUTODETECT 10020 #define ID_NETWORKLAN 10021 @@ -167,6 +168,7 @@ private: wxComboBox* m_ReminderFrequencyCtrl; wxCheckBox* m_EnableBOINCManagerAutoStartCtrl; wxCheckBox* m_EnableBOINCManagerExitMessageCtrl; + wxCheckBox* m_EnableBOINCClientShutdownMessageCtrl; wxCheckBox* m_EnableRunDaemonCtrl; wxStaticBoxSizer* m_DialupStaticBoxCtrl; wxListBox* m_DialupConnectionsCtrl;