add normal script warnings mode (Fixes #2642)

c++11
Marc Zinnschlag 10 years ago
parent 197b8ec731
commit b9f6baf317

@ -312,17 +312,18 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
"\nA name from the list of colors defined in the list of SVG color keyword names."
"\nX11 color names may also work.";
QString modeIgnore ("Ignore");
QString modeNormal ("Normal");
QStringList modes;
modes << modeIgnore << "Strict";
modes << "Ignore" << modeNormal << "Strict";
Setting *warnings = createSetting (Type_ComboBox, "warnings",
"Warning Mode");
warnings->setDeclaredValues (modes);
warnings->setDefaultValue (modeIgnore);
warnings->setDefaultValue (modeNormal);
warnings->setToolTip ("<ul>How to handle warning messages during compilation:<p>"
"<li>Ignore: Do not report warning</li>"
"<li>Normal: Report warning as a warning</li>"
"<li>Strict: Promote warning to an error</li>"
"</ul>");

@ -84,7 +84,8 @@ void CSMTools::ScriptCheckStage::perform (int stage, CSMDoc::Messages& messages)
switch (mWarningMode)
{
case Mode_Ignore: setWarningsMode (0); break;
case Mode_Strict: setWarningsMode (1); break;
case Mode_Normal: setWarningsMode (1); break;
case Mode_Strict: setWarningsMode (2); break;
}
try
@ -123,6 +124,8 @@ void CSMTools::ScriptCheckStage::updateUserSetting (const QString& name, const Q
{
if (value.at (0)=="Ignore")
mWarningMode = Mode_Ignore;
else if (value.at (0)=="Normal")
mWarningMode = Mode_Normal;
else if (value.at (0)=="Strict")
mWarningMode = Mode_Strict;
}

@ -21,6 +21,7 @@ namespace CSMTools
enum WarningMode
{
Mode_Ignore,
Mode_Normal,
Mode_Strict
};

Loading…
Cancel
Save