Add settings entry to enable/disable warning display in the 3D view.

master
Torsten Paul 2015-01-10 00:54:52 +01:00
parent 1ae9ed5ada
commit ddd1228a51
6 changed files with 30 additions and 2 deletions

View File

@ -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)

View File

@ -46,6 +46,7 @@ public slots:
void on_launcherBox_toggled(bool);
void on_editorType_editTextChanged(const QString &);
void on_checkBoxShowWarningsIn3dView_toggled(bool);
//
// editor settings
//

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>621</width>
<height>413</height>
<width>675</width>
<height>476</height>
</rect>
</property>
<property name="sizePolicy">
@ -31,6 +31,9 @@
</property>
<widget class="QWidget" name="page3DView">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,3">
<item>
@ -75,6 +78,16 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxShowWarningsIn3dView">
<property name="text">
<string>Show Warnings and Errors in 3D View</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="pageEditor">

View File

@ -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()) {

View File

@ -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"));

View File

@ -35,6 +35,7 @@ protected:
class Settings
{
public:
static SettingsEntry showWarningsIn3dView;
static SettingsEntry indentationWidth;
static SettingsEntry tabWidth;
static SettingsEntry lineWrap;