diff options
Diffstat (limited to 'addon/doxywizard/inputint.cpp')
-rw-r--r-- | addon/doxywizard/inputint.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/addon/doxywizard/inputint.cpp b/addon/doxywizard/inputint.cpp index de01862..ce3fa02 100644 --- a/addon/doxywizard/inputint.cpp +++ b/addon/doxywizard/inputint.cpp @@ -12,6 +12,7 @@ #include "inputint.h" #include "helplabel.h" +#include "config_msg.h" #include <QSpinBox> #include <QGridLayout> @@ -59,12 +60,19 @@ void InputInt::help() void InputInt::setValue(int val) { - val = qMax(m_minVal,val); - val = qMin(m_maxVal,val); - if (val!=m_val) + int newVal = val; + newVal = qMax(m_minVal,newVal); + newVal = qMin(m_maxVal,newVal); + if (val != newVal) { - m_val = val; - m_sp->setValue(val); + config_warn("argument '%d' for option %s is not a valid number in the range [%d..%d]!" + " Using the default: %d!\n",val,qPrintable(m_id),m_minVal,m_maxVal,m_default); + newVal = m_default; + } + if (newVal!=m_val) + { + m_val = newVal; + m_sp->setValue(newVal); m_value = m_val; updateDefault(); } @@ -101,7 +109,12 @@ void InputInt::update() { bool ok; int newVal = m_value.toInt(&ok); - if (!ok) newVal = m_default; + if (!ok) + { + config_warn("argument '%s' for option %s is not a valid number in the range [%d..%d]!" + " Using the default: %d!\n",qPrintable(m_value.toString()),qPrintable(m_id),m_minVal,m_maxVal,m_default); + newVal = m_default; + } setValue(newVal); } |