diff --git a/lib/prefs.cpp b/lib/prefs.cpp index 6a781e18e19..1b61bb40acd 100644 --- a/lib/prefs.cpp +++ b/lib/prefs.cpp @@ -1,6 +1,6 @@ // This file is part of BOINC. // http://boinc.berkeley.edu -// Copyright (C) 2008 University of California +// Copyright (C) 2022 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License @@ -32,8 +32,9 @@ #include "error_numbers.h" #include "str_replace.h" #include "parse.h" +#include "str_util.h" #include "util.h" - +#include "..\client\client_msgs.h" #include "prefs.h" void GLOBAL_PREFS_MASK::set_all() { @@ -408,6 +409,14 @@ int GLOBAL_PREFS::parse_override( if (!mask.niu_suspend_cpu_usage) { niu_suspend_cpu_usage = suspend_cpu_usage; } + // Checks for a condition where no computing could occur if suspend until idle and + // suspend after being idle overlap. + // + if (mask.idle_time_to_run && mask.suspend_if_no_recent_input) { + if ((idle_time_to_run - suspend_if_no_recent_input + 0.005) >= 0) { + msg_printf(NULL, MSG_USER_ALERT, "%s", "Test message."); + } + } return 0; } if (in_venue) { @@ -765,7 +774,7 @@ void GLOBAL_PREFS::write_day_prefs(MIOFILE& f) { bool net_present = net_times.week.days[i].present; //write only when needed if (net_present || cpu_present) { - + f.printf(" \n"); f.printf(" %d\n", i); if (cpu_present) {