diff --git a/checkin_notes b/checkin_notes index baf1807c56..f744008002 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1567,3 +1567,10 @@ David 13 Feb 2009 lib/ prefs.cpp + +David 13 Feb 2009 + - Manager: add GPU preference to advanced prefs dialog + + clientgui/ + DlgAdvPreferences.cpp + DlgAdvPreferencesBase.cpp,h diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index 4e17438a8b..5e4ae8ae81 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -225,6 +225,7 @@ void CDlgAdvPreferences::ReadPreferenceSettings() { m_chkProcOnBatteries->SetValue(prefs.run_on_batteries); // in use m_chkProcInUse->SetValue(prefs.run_if_user_active); + m_chkGPUProcInUse->SetValue(prefs.run_gpu_if_user_active); // idle for X minutes buffer.Printf(wxT("%.2f"),prefs.idle_time_to_run); *m_txtProcIdleFor << buffer; @@ -321,6 +322,9 @@ bool CDlgAdvPreferences::SavePreferencesSettings() { // prefs.run_if_user_active=m_chkProcInUse->GetValue(); mask.run_if_user_active=true; + + prefs.run_gpu_if_user_active=m_chkGPUProcInUse->GetValue(); + mask.run_gpu_if_user_active=true; // if(m_txtProcIdleFor->IsEnabled()) { m_txtProcIdleFor->GetValue().ToDouble(&td); @@ -452,7 +456,7 @@ bool CDlgAdvPreferences::SavePreferencesSettings() { /* set state of control depending on other control's state */ void CDlgAdvPreferences::UpdateControlStates() { //proc usage page - m_txtProcIdleFor->Enable(!m_chkProcInUse->IsChecked()); + m_txtProcIdleFor->Enable(!m_chkProcInUse->IsChecked() || !m_chkGPUProcInUse->IsChecked()); m_txtProcMonday->Enable(m_chkProcMonday->IsChecked()); m_txtProcTuesday->Enable(m_chkProcTuesday->IsChecked()); m_txtProcWednesday->Enable(m_chkProcWednesday->IsChecked()); diff --git a/clientgui/DlgAdvPreferencesBase.cpp b/clientgui/DlgAdvPreferencesBase.cpp index e4172b2b27..a39a9d193e 100644 --- a/clientgui/DlgAdvPreferencesBase.cpp +++ b/clientgui/DlgAdvPreferencesBase.cpp @@ -72,20 +72,36 @@ CDlgAdvPreferencesBase::CDlgAdvPreferencesBase( wxWindow* parent, int id, wxStri bSizer7 = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizer4; - sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( m_panelProcessor, -1, _("Computing allowed") ), wxVERTICAL ); - - m_chkProcOnBatteries = new wxCheckBox( m_panelProcessor, ID_CHKPROCONBATTERIES, _(" While computer is on batteries"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_chkProcOnBatteries->SetToolTip( _("check this if you want this computer to do work while it runs on batteries") ); - + sbSizer4 = new wxStaticBoxSizer( + new wxStaticBox(m_panelProcessor, -1, _("Computing allowed") ), wxVERTICAL + ); + m_chkProcOnBatteries = new wxCheckBox( + m_panelProcessor, ID_CHKPROCONBATTERIES, + _(" While computer is on batteries"), wxDefaultPosition, wxDefaultSize, 0 + ); + m_chkProcOnBatteries->SetToolTip( + _("check this if you want this computer to do work while it runs on batteries") + ); sbSizer4->Add( m_chkProcOnBatteries, 0, wxALL, 5 ); - m_chkProcInUse = new wxCheckBox( m_panelProcessor, ID_CHKPROCINUSE, _(" While computer is in use"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_chkProcInUse->SetToolTip( _("check this if you want this computer to do work even when you're using it") ); - + m_chkProcInUse = new wxCheckBox( + m_panelProcessor, ID_CHKPROCINUSE, + _(" While computer is in use"), wxDefaultPosition, wxDefaultSize, 0 + ); + m_chkProcInUse->SetToolTip( + _("check this if you want this computer to do work even when you're using it") + ); sbSizer4->Add( m_chkProcInUse, 0, wxALL, 5 ); + m_chkGPUProcInUse = new wxCheckBox( + m_panelProcessor, ID_CHKGPUPROCINUSE, + _(" Use GPU while computer is in use"), wxDefaultPosition, wxDefaultSize, 0 + ); + m_chkGPUProcInUse->SetToolTip( + _("check this if you want your GPU to do work even when you're using the computer") + ); + sbSizer4->Add( m_chkGPUProcInUse, 0, wxALL, 5 ); + wxFlexGridSizer* fgSizer5; fgSizer5 = new wxFlexGridSizer( 2, 4, 0, 0 ); fgSizer5->AddGrowableCol( 3 ); diff --git a/clientgui/DlgAdvPreferencesBase.h b/clientgui/DlgAdvPreferencesBase.h index ad5a75f4ce..0113aceaa3 100644 --- a/clientgui/DlgAdvPreferencesBase.h +++ b/clientgui/DlgAdvPreferencesBase.h @@ -83,6 +83,7 @@ #define ID_TXTPROCTUESDAY 20053 #define ID_TXTPROCUSEPROCESSORS 20054 #define ID_TXTPROCWEDNESDAY 20055 +#define ID_CHKGPUPROCINUSE 20056 /** * Class CDlgAdvPreferencesBase @@ -100,6 +101,7 @@ class CDlgAdvPreferencesBase : public wxDialog wxPanel* m_panelProcessor; wxCheckBox* m_chkProcOnBatteries; wxCheckBox* m_chkProcInUse; + wxCheckBox* m_chkGPUProcInUse; wxStaticText* m_staticText26; wxTextCtrl* m_txtProcIdleFor; wxStaticText* m_staticText27;