diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2011-07-03 12:52:28 (GMT) |
---|---|---|
committer | Giles Bathgate <gilesbathgate@gmail.com> | 2011-07-03 12:52:28 (GMT) |
commit | 7d4ba81068f43d498251495227e4e83f6164873b (patch) | |
tree | af665d26729a57266313d7a7ffab9c665a38efe9 /src/Preferences.cc | |
parent | 8289982efc65e08b836c2045f652f49c2add82cf (diff) |
Allow the hiding of the opengl2.0 warning on startup.
There are two basic changes. The first is a checkbox within the
warning screen that allows you to hide it on subsequent program boots.
The second is a checkbox under Edit/Preferences/Advanced to show/hide
the message.
Diffstat (limited to 'src/Preferences.cc')
-rw-r--r-- | src/Preferences.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Preferences.cc b/src/Preferences.cc index 6419944..eb6af61 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -40,6 +40,7 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent) this->defaultmap["3dview/colorscheme"] = this->colorSchemeChooser->currentItem()->text(); this->defaultmap["editor/fontfamily"] = this->fontChooser->currentText(); this->defaultmap["editor/fontsize"] = this->fontSize->currentText().toUInt(); + this->defaultmap["editor/opengl20_warning_show"] = true; // Toolbar QActionGroup *group = new QActionGroup(this); @@ -97,7 +98,8 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent) this, SLOT(fontFamilyChanged(const QString &))); connect(this->fontSize, SIGNAL(editTextChanged(const QString &)), this, SLOT(fontSizeChanged(const QString &))); - + connect(this->OpenGL20WarningCheckbox, SIGNAL(clicked(bool)), + this, SLOT(OpenGL20WarningChanged(bool))); updateGUI(); } @@ -148,6 +150,13 @@ void Preferences::fontSizeChanged(const QString &size) emit fontChanged(getValue("editor/fontfamily").toString(), intsize); } +void +Preferences::OpenGL20WarningChanged(bool state) +{ + QSettings settings; + settings.setValue("editor/opengl20_warning_show",state); +} + void Preferences::keyPressEvent(QKeyEvent *e) { #ifdef Q_WS_MAC @@ -185,6 +194,7 @@ QVariant Preferences::getValue(const QString &key) const void Preferences::updateGUI() { + QSettings settings; QList<QListWidgetItem *> found = this->colorSchemeChooser->findItems(getValue("3dview/colorscheme").toString(), Qt::MatchExactly); @@ -204,6 +214,9 @@ void Preferences::updateGUI() else { this->fontSize->setEditText(fontsize); } + + bool opengl20_warning_show = getValue("editor/opengl20_warning_show").toBool(); + this->OpenGL20WarningCheckbox->setChecked(opengl20_warning_show); } void Preferences::apply() const @@ -211,4 +224,3 @@ void Preferences::apply() const emit fontChanged(getValue("editor/fontfamily").toString(), getValue("editor/fontsize").toUInt()); emit requestRedraw(); } - |