diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index d2eb50a24d..5755309539 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -744,6 +744,7 @@ bool CDlgAdvPreferences::ValidateInput() { wxString invMsgLimit10 = _("Number must be between 0 and 10"); wxString invMsgLimit100 = _("Number must be between 0 and 100"); wxString invMsgLimit1_100 = _("Number must be between 1 and 100"); + wxString invMsgIdle = _("Suspend when no mouse or keyboard input needs to be greater than 'in use' mouse or keyboard input."); wxString buffer; double startTime, endTime; @@ -783,6 +784,22 @@ bool CDlgAdvPreferences::ValidateInput() { } } + // Checks for a condition where no computing could occur if suspended until idle and + // suspend after being idle overlap. + // + if (m_txtProcIdleFor->IsEnabled() && m_chkNoRecentInput->IsChecked()) { + wxString bufferNRI = m_txtNoRecentInput->GetValue(); + wxString bufferPIF = m_txtProcIdleFor->GetValue(); + double valueNRI; + bufferNRI.ToDouble(&valueNRI); + double valuePIF; + bufferPIF.ToDouble(&valuePIF); + if((valuePIF - valueNRI + 0.005) >=0) { // 0.005 is included to factor in rounding to nearest hundredth + ShowErrorMessage(invMsgIdle, m_txtNoRecentInput); + return false; + } + } + if (m_txtMaxLoad->IsEnabled()) { buffer = m_txtMaxLoad->GetValue(); if(!IsValidFloatValueBetween(buffer, 1.0, 100.0)) {