From 10185d2de8d6bdfa29f7db74c94833fe41ab9859 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 27 Nov 2011 23:02:38 +0100 Subject: More correct preference and warning settings for OpenCSG capability diff --git a/src/GLView.h b/src/GLView.h index 8b281dd..c31e7af 100644 --- a/src/GLView.h +++ b/src/GLView.h @@ -82,7 +82,7 @@ private: bool is_opencsg_capable; bool has_shaders; private slots: - void display_opengl20_warning(); + void display_opencsg_warning(); #endif signals: diff --git a/src/Preferences.cc b/src/Preferences.cc index eb6af61..d240a9f 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -98,8 +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))); + connect(this->openCSGWarningBox, SIGNAL(clicked(bool)), + this, SLOT(openCSGWarningChanged(bool))); updateGUI(); } @@ -151,7 +151,7 @@ void Preferences::fontSizeChanged(const QString &size) } void -Preferences::OpenGL20WarningChanged(bool state) +Preferences::openCSGWarningChanged(bool state) { QSettings settings; settings.setValue("editor/opengl20_warning_show",state); @@ -215,8 +215,7 @@ void Preferences::updateGUI() this->fontSize->setEditText(fontsize); } - bool opengl20_warning_show = getValue("editor/opengl20_warning_show").toBool(); - this->OpenGL20WarningCheckbox->setChecked(opengl20_warning_show); + this->openCSGWarningBox->setChecked(getValue("editor/opengl20_warning_show").toBool()); } void Preferences::apply() const diff --git a/src/Preferences.h b/src/Preferences.h index 79fa7ab..bdc707d 100644 --- a/src/Preferences.h +++ b/src/Preferences.h @@ -34,7 +34,7 @@ public slots: void colorSchemeChanged(); void fontFamilyChanged(const QString &); void fontSizeChanged(const QString &); - void OpenGL20WarningChanged(bool); + void openCSGWarningChanged(bool); signals: void requestRedraw() const; diff --git a/src/Preferences.ui b/src/Preferences.ui index 2ab7646..556172c 100644 --- a/src/Preferences.ui +++ b/src/Preferences.ui @@ -6,7 +6,7 @@ 0 0 - 384 + 418 243 @@ -21,7 +21,7 @@ - 1 + 2 @@ -181,9 +181,9 @@ - + - Show OpenGL 2.0 warning && rendering info + Show OpenCSG capability warning @@ -239,7 +239,7 @@ true - + :/icons/prefs3DView.png:/icons/prefs3DView.png @@ -251,7 +251,7 @@ true - + :/icons/prefsAdvanced.png:/icons/prefsAdvanced.png @@ -263,7 +263,7 @@ true - + :/icons/prefsEditor.png:/icons/prefsEditor.png diff --git a/src/glview.cc b/src/glview.cc index a27d913..4360396 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -152,7 +152,7 @@ void GLView::initializeGL() QSettings settings; // FIXME: This should be an OpenCSG capability warning, not an OpenGL 2 warning if (settings.value("editor/opengl20_warning_show",true).toBool()) { - QTimer::singleShot(0, this, SLOT(display_opengl20_warning())); + QTimer::singleShot(0, this, SLOT(display_opencsg_warning())); } } if (opencsg_support && this->has_shaders) { @@ -244,10 +244,10 @@ void GLView::initializeGL() } #ifdef ENABLE_OPENCSG -void GLView::display_opengl20_warning() +void GLView::display_opencsg_warning() { // data - QString title = QString("GLEW: GL_VERSION_2_0 is not supported!"); + QString title = QString("OpenGL context is not OpenCSG capable"); QString rendererinfo; rendererinfo.sprintf("GLEW version %s\n" @@ -257,10 +257,10 @@ void GLView::display_opengl20_warning() glGetString(GL_RENDERER), glGetString(GL_VENDOR), glGetString(GL_VERSION)); - QString message = QString("Warning: No support for OpenGL 2.0 found! OpenCSG View has been disabled.\n\n" - "It is highly recommended to use OpenSCAD on a system with OpenGL 2.0 " - "support. Please check if OpenGL 2.0 drivers are available for your " - "graphics hardware. Your renderer information is as follows:\n\n%1").arg(rendererinfo); + QString message = QString("Warning: Missing OpenGL capabilities for OpenCSG - OpenCSG has been disabled.\n\n" + "It is highly recommended to use OpenSCAD on a system with OpenGL 2.0, " + "or support for the framebuffer_object or pbuffer extensions. " + "Your renderer information is as follows:\n\n%1").arg(rendererinfo); QString note = QString("Uncheck to hide this message in the future"); @@ -290,9 +290,9 @@ void GLView::display_opengl20_warning() // action connect(buttonbox, SIGNAL(accepted()), dialog, SLOT(accept())); connect(checkbox, SIGNAL(clicked(bool)), - Preferences::inst()->OpenGL20WarningCheckbox, SLOT(setChecked(bool))); + Preferences::inst()->openCSGWarningBox, SLOT(setChecked(bool))); connect(checkbox, SIGNAL(clicked(bool)), - Preferences::inst(), SLOT(OpenGL20WarningChanged(bool))); + Preferences::inst(), SLOT(openCSGWarningChanged(bool))); dialog->exec(); } #endif -- cgit v0.10.1