- Manager: add GPU preference to advanced prefs dialog

svn path=/trunk/boinc/; revision=17259
This commit is contained in:
David Anderson 2009-02-13 17:53:10 +00:00
parent 9db7b1f242
commit adbff769c8
4 changed files with 40 additions and 11 deletions

View File

@ -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

View File

@ -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());

View File

@ -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 );

View File

@ -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;