Merge pull request #5146 from BOINC/dpa_prefs4

Manager: enhance computing prefs dialog
This commit is contained in:
CharlieFenton 2023-03-14 04:21:20 -07:00 committed by GitHub
commit 66bae9a2fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

View File

@ -267,7 +267,7 @@ void CDlgAdvPreferences::DisplayValue(double value, wxTextCtrl* textCtrl, wxChec
if (checkBox) { if (checkBox) {
if (! checkBox->IsChecked()) { if (! checkBox->IsChecked()) {
textCtrl->Clear(); //textCtrl->Clear();
textCtrl->Disable(); textCtrl->Disable();
return; return;
} }
@ -510,7 +510,7 @@ bool CDlgAdvPreferences::SavePreferencesSettings() {
} }
mask.suspend_if_no_recent_input = true; mask.suspend_if_no_recent_input = true;
if (m_txtMaxLoad->IsEnabled()) { if (m_txtMaxLoad->IsEnabled() || !prefs.run_if_user_active) {
m_txtMaxLoad->GetValue().ToDouble(&td); m_txtMaxLoad->GetValue().ToDouble(&td);
prefs.suspend_cpu_usage=RoundToHundredths(td); prefs.suspend_cpu_usage=RoundToHundredths(td);
} else { } else {
@ -1117,13 +1117,19 @@ void CDlgAdvPreferences::OnHandleCommandEvent(wxCommandEvent& ev) {
switch (ev.GetId()) { switch (ev.GetId()) {
// processor usage page // processor usage page
case ID_CHKMAXLOAD: case ID_CHKMAXLOAD:
if (!m_txtMaxLoad->GetValue()) {
DisplayValue(defaultPrefs.suspend_cpu_usage, m_txtMaxLoad, m_chkMaxLoad); DisplayValue(defaultPrefs.suspend_cpu_usage, m_txtMaxLoad, m_chkMaxLoad);
}
break; break;
case ID_CHKMAXLOADNOTINUSE: case ID_CHKMAXLOADNOTINUSE:
if (!m_txtMaxLoadNotInUse->GetValue()) {
DisplayValue(defaultPrefs.niu_suspend_cpu_usage, m_txtMaxLoadNotInUse, m_chkMaxLoadNotInUse); DisplayValue(defaultPrefs.niu_suspend_cpu_usage, m_txtMaxLoadNotInUse, m_chkMaxLoadNotInUse);
}
break; break;
case ID_CHKNORECENTINPUT: case ID_CHKNORECENTINPUT:
if (!m_txtNoRecentInput->GetValue()) {
DisplayValue(defaultPrefs.suspend_if_no_recent_input, m_txtNoRecentInput, m_chkNoRecentInput); DisplayValue(defaultPrefs.suspend_if_no_recent_input, m_txtNoRecentInput, m_chkNoRecentInput);
}
break; break;
// network usage page // network usage page
case ID_CHKNETDOWNLOADRATE: case ID_CHKNETDOWNLOADRATE: