diff --git a/src/Preferences.cc b/src/Preferences.cc
index 33f045ac..93900a0e 100644
--- a/src/Preferences.cc
+++ b/src/Preferences.cc
@@ -485,6 +485,12 @@ void Preferences::on_launcherBox_toggled(bool state)
settings.setValue("launcher/showOnStartup", state);
}
+void Preferences::on_checkBoxShowWarningsIn3dView_toggled(bool val)
+{
+ Settings::Settings::inst()->set(Settings::Settings::showWarningsIn3dView, Value(val));
+ writeSettings();
+}
+
void Preferences::on_spinBoxIndentationWidth_valueChanged(int val)
{
Settings::Settings::inst()->set(Settings::Settings::indentationWidth, Value(val));
@@ -683,6 +689,7 @@ void Preferences::updateGUI()
this->checkBoxAutoIndent->setChecked(s->get(Settings::Settings::autoIndent).toBool());
this->checkBoxHighlightCurrentLine->setChecked(s->get(Settings::Settings::highlightCurrentLine).toBool());
this->checkBoxEnableBraceMatching->setChecked(s->get(Settings::Settings::enableBraceMatching).toBool());
+ this->checkBoxShowWarningsIn3dView->setChecked(s->get(Settings::Settings::showWarningsIn3dView).toBool());
}
void Preferences::initComboBox(QComboBox *comboBox, const Settings::SettingsEntry& entry)
diff --git a/src/Preferences.h b/src/Preferences.h
index 82cced50..a29c5328 100644
--- a/src/Preferences.h
+++ b/src/Preferences.h
@@ -46,6 +46,7 @@ public slots:
void on_launcherBox_toggled(bool);
void on_editorType_editTextChanged(const QString &);
+ void on_checkBoxShowWarningsIn3dView_toggled(bool);
//
// editor settings
//
diff --git a/src/Preferences.ui b/src/Preferences.ui
index 7c411229..2e20dc70 100644
--- a/src/Preferences.ui
+++ b/src/Preferences.ui
@@ -6,8 +6,8 @@
0
0
- 621
- 413
+ 675
+ 476
@@ -31,6 +31,9 @@
+
+ 0
+
-
-
@@ -75,6 +78,16 @@
+ -
+
+
+ Show Warnings and Errors in 3D View
+
+
+ false
+
+
+
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 9646b367..f46be97b 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -952,6 +952,11 @@ void MainWindow::updateCompileResult()
return;
}
+ Settings::Settings *s = Settings::Settings::inst();
+ if (!s->get(Settings::Settings::showWarningsIn3dView).toBool()) {
+ return;
+ }
+
QString msg;
if (compileErrors > 0) {
if (fileName.isEmpty()) {
diff --git a/src/settings.cc b/src/settings.cc
index 8af5fea3..99a4ec05 100644
--- a/src/settings.cc
+++ b/src/settings.cc
@@ -121,6 +121,7 @@ Visitor::~Visitor()
* external settings file. The second value is the display value that
* can be translated.
*/
+SettingsEntry Settings::showWarningsIn3dView("3dview", "showWarningsIn3dView", Value(true), Value(true));
SettingsEntry Settings::indentationWidth("editor", "indentationWidth", Value(Value::RangeType(1, 16)), Value(4));
SettingsEntry Settings::tabWidth("editor", "tabWidth", Value(Value::RangeType(1, 16)), Value(8));
SettingsEntry Settings::lineWrap("editor", "lineWrap", values("None", _("None"), "Char", _("Wrap at character boundaries"), "Word", _("Wrap at word boundaries")), Value("Word"));
diff --git a/src/settings.h b/src/settings.h
index a3099fe8..2864bb2c 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -35,6 +35,7 @@ protected:
class Settings
{
public:
+ static SettingsEntry showWarningsIn3dView;
static SettingsEntry indentationWidth;
static SettingsEntry tabWidth;
static SettingsEntry lineWrap;