From 4dc2e4fc09a9176b45bf2c58678fc8ad9a479293 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Thu, 4 May 2017 09:49:10 +0200 Subject: [PATCH] Disable use of the WindowsFileDialog class On Windows, use: - QtFileDialog if FG was built with Qt support; - PUIFileDialog otherwise. Behavior on other platforms is unchanged. This change is motivated by the fact that some Windows users have reported[1][2] weird, non-deterministic behavior of WindowsFileDialog and unfortunately, no one seems to be willing and able to fix the problem. The Qt implementation comes for free and should be quite robust. Of course, if someone wants to maintain the WindowsFileDialog class again, the change can be reverted. See discussion at [3]. [1] https://forum.flightgear.org/viewtopic.php?f=25&t=31945 [2] https://sourceforge.net/p/flightgear/mailman/message/35761650/ [3] https://sourceforge.net/p/flightgear/mailman/message/35759819/ --- src/GUI/FileDialog.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/GUI/FileDialog.cxx b/src/GUI/FileDialog.cxx index 20478981c..7b5909858 100644 --- a/src/GUI/FileDialog.cxx +++ b/src/GUI/FileDialog.cxx @@ -38,9 +38,6 @@ #include "CocoaFileDialog.hxx" #endif -#if defined(SG_WINDOWS) - #include "WindowsFileDialog.hxx" -#endif #if defined(HAVE_QT) #include "QtFileDialog.hxx" #endif @@ -146,17 +143,15 @@ typedef nasal::Ghost NasalFileDialog; static naRef f_createFileDialog(const nasal::CallContext& ctx) { FGFileDialog::Usage usage = (FGFileDialog::Usage) ctx.requireArg(0); - + #if defined(SG_MAC) FileDialogPtr fd(new CocoaFileDialog(usage)); -#elif defined(SG_WINDOWS) - FileDialogPtr fd(new WindowsFileDialog(usage)); #elif defined(HAVE_QT) FileDialogPtr fd(new QtFileDialog(usage)); #else FileDialogPtr fd(new PUIFileDialog(usage)); #endif - + return ctx.to_nasal(fd); }