Skip to content

Commit

Permalink
Warn user if they cascade/tile windows on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrrees authored and wwmayer committed Mar 21, 2015
1 parent 2de5c0f commit bd28c52
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion src/Gui/MainWindow.cpp
Expand Up @@ -488,6 +488,29 @@ void MainWindow::tile()
{
#if !defined (NO_USE_QT_MDI_AREA)
d->mdiArea->tileSubWindows();

// Warn about limitation in Qt4.8 involving multiple OpenGL widgets with Cocoa.
#if defined(__APPLE__)
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("MainWindow");

if(hGrp->GetBool("ShowAppleMdiWarning", true)) {
QMessageBox mb(this);
mb.setIcon(QMessageBox::Warning);
mb.setTextFormat(Qt::RichText);
mb.setText(tr("There is a rendering issue on MacOS."));
mb.setInformativeText(tr("See <a href=\"http://www.freecadweb.org/wiki/index.php?title=OpenGL_on_MacOS\"> the wiki</a> for more information"));

QAbstractButton *suppressBtn;
suppressBtn = mb.addButton(tr("Don't show again"), QMessageBox::DestructiveRole);
mb.addButton(QMessageBox::Ok);

mb.exec();
if(mb.clickedButton() == suppressBtn) {
hGrp->SetBool("ShowAppleMdiWarning", false);
}
}
#endif // defined(__APPLE__)
#else
d->workspace->tile();
#endif
Expand All @@ -497,6 +520,29 @@ void MainWindow::cascade()
{
#if !defined (NO_USE_QT_MDI_AREA)
d->mdiArea->cascadeSubWindows();

// See above in MainWindow::tile()
#if defined(__APPLE__)
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("MainWindow");

if(hGrp->GetBool("ShowAppleMdiWarning", true)) {
QMessageBox mb(this);
mb.setIcon(QMessageBox::Warning);
mb.setTextFormat(Qt::RichText);
mb.setText(tr("There is a rendering issue on MacOS."));
mb.setInformativeText(tr("See <a href=\"http://www.freecadweb.org/wiki/index.php?title=OpenGL_on_MacOS\"> the wiki</a> for more information"));

QAbstractButton *suppressBtn;
suppressBtn = mb.addButton(tr("Don't show again"), QMessageBox::DestructiveRole);
mb.addButton(QMessageBox::Ok);

mb.exec();
if(mb.clickedButton() == suppressBtn) {
hGrp->SetBool("ShowAppleMdiWarning", false);
}
}
#endif // defined(__APPLE__)
#else
d->workspace->cascade();
#endif
Expand Down Expand Up @@ -1312,7 +1358,7 @@ void MainWindow::startSplasher(void)
(App::Application::Config()["RunMode"] == "Gui")) {
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General");
// first search for an external imahe file
// first search for an external image file
if (hGrp->GetBool("ShowSplasher", true)) {
d->splashscreen = new SplashScreen(this->splashImage());
d->splashscreen->show();
Expand Down

0 comments on commit bd28c52

Please sign in to comment.