diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/Fl.cxx | 12 | ||||
| -rw-r--r-- | src/Fl_Native_File_Chooser_GTK.cxx | 18 |
3 files changed, 14 insertions, 20 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 74f401182..acb00ec3b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -237,11 +237,9 @@ if(FLTK_USE_X11 AND NOT FLTK_BACKEND_WAYLAND) Fl_get_key.cxx ) - if(FLTK_USE_KDIALOG) list(APPEND DRIVER_FILES Fl_Native_File_Chooser_Kdialog.cxx Fl_Native_File_Chooser_Zenity.cxx) - endif(FLTK_USE_KDIALOG) if(FLTK_USE_CAIRO) list(APPEND DRIVER_FILES @@ -312,11 +310,9 @@ elseif(FLTK_BACKEND_WAYLAND) Fl_Native_File_Chooser_GTK.cxx ) - if(FLTK_USE_KDIALOG) list(APPEND DRIVER_FILES Fl_Native_File_Chooser_Kdialog.cxx Fl_Native_File_Chooser_Zenity.cxx) - endif(FLTK_USE_KDIALOG) if(FLTK_USE_X11) list(APPEND DRIVER_FILES diff --git a/src/Fl.cxx b/src/Fl.cxx index 16672cfcc..43517ee20 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1961,9 +1961,6 @@ void Fl::clear_widget_pointer(Fl_Widget const *w) There should be a command line option interface. - There should be an application that manages options system wide, per user, and - per application. - Example: \code if ( Fl::option(Fl::OPTION_ARROW_FOCUS) ) @@ -1972,8 +1969,7 @@ void Fl::clear_widget_pointer(Fl_Widget const *w) { ..off.. } \endcode - \note As of FLTK 1.3.0, options can be managed within fluid, using the menu - <i>Edit/Global FLTK Settings</i>. + \note Options can be managed with the \c fltk-options program, new in FLTK 1.4.0. \param opt which option \return true or false @@ -2008,8 +2004,10 @@ bool Fl::option(Fl_Option opt) opt_prefs.get("ShowZoomFactor", tmp, 1); // default: on options_[OPTION_SHOW_SCALING] = tmp; - opt_prefs.get("UseZenity", tmp, 1); // default: on + opt_prefs.get("UseZenity", tmp, 0); // default: off options_[OPTION_FNFC_USES_ZENITY] = tmp; + opt_prefs.get("UseKdialog", tmp, 0); // default: off + options_[OPTION_FNFC_USES_KDIALOG] = tmp; opt_prefs.get("SimpleZoomShortcut", tmp, 0); // default: off options_[OPTION_SIMPLE_ZOOM_SHORTCUT] = tmp; } @@ -2038,6 +2036,8 @@ bool Fl::option(Fl_Option opt) if (tmp >= 0) options_[OPTION_SHOW_SCALING] = tmp; opt_prefs.get("UseZenity", tmp, -1); if (tmp >= 0) options_[OPTION_FNFC_USES_ZENITY] = tmp; + opt_prefs.get("UseKdialog", tmp, -1); + if (tmp >= 0) options_[OPTION_FNFC_USES_KDIALOG] = tmp; opt_prefs.get("SimpleZoomShortcut", tmp, -1); if (tmp >= 0) options_[OPTION_SIMPLE_ZOOM_SHORTCUT] = tmp; } diff --git a/src/Fl_Native_File_Chooser_GTK.cxx b/src/Fl_Native_File_Chooser_GTK.cxx index 28363aeda..263acfad7 100644 --- a/src/Fl_Native_File_Chooser_GTK.cxx +++ b/src/Fl_Native_File_Chooser_GTK.cxx @@ -17,10 +17,8 @@ #include <config.h> #include <FL/Fl_Native_File_Chooser.H> -#if USE_KDIALOG -# include "Fl_Native_File_Chooser_Zenity.H" -# include "Fl_Native_File_Chooser_Kdialog.H" -#endif +#include "Fl_Native_File_Chooser_Zenity.H" +#include "Fl_Native_File_Chooser_Kdialog.H" #if HAVE_DLSYM && HAVE_DLFCN_H #include <FL/platform.H> @@ -931,8 +929,6 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { // otherwise, use FLTK file chooser. platform_fnfc = NULL; fl_open_display(); - if (Fl::option(Fl::OPTION_FNFC_USES_GTK)) { -#if USE_KDIALOG if (Fl::option(Fl::OPTION_FNFC_USES_ZENITY)&& val != BROWSE_MULTI_DIRECTORY) { if (!Fl_Zenity_Native_File_Chooser_Driver::have_looked_for_zenity) { // First Time here, try to find zenity @@ -949,7 +945,8 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { if (Fl_Zenity_Native_File_Chooser_Driver::did_find_zenity) platform_fnfc = new Fl_Zenity_Native_File_Chooser_Driver(val); } const char *desktop = getenv("XDG_CURRENT_DESKTOP"); - if (!platform_fnfc && desktop && strcmp(desktop, "KDE") == 0 && val != BROWSE_MULTI_DIRECTORY) { + if (!platform_fnfc && Fl::option(Fl::OPTION_FNFC_USES_KDIALOG) && desktop && + strcmp(desktop, "KDE") == 0 && val != BROWSE_MULTI_DIRECTORY) { if (!Fl_Kdialog_Native_File_Chooser_Driver::have_looked_for_kdialog) { // First Time here, try to find kdialog FILE *pipe = popen("kdialog -v 2> /dev/null", "r"); @@ -964,9 +961,9 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { // if we found kdialog, we will use the Fl_Kdialog_Native_File_Chooser_Driver if (Fl_Kdialog_Native_File_Chooser_Driver::did_find_kdialog) platform_fnfc = new Fl_Kdialog_Native_File_Chooser_Driver(val); } -#endif // USE_KDIALOG #if HAVE_DLSYM && HAVE_DLFCN_H - if (!platform_fnfc) { + if (!platform_fnfc) { + if (Fl::option(Fl::OPTION_FNFC_USES_GTK)) { if ( Fl_GTK_Native_File_Chooser_Driver::have_looked_for_GTK_libs == 0) { // First Time here, try to find the GTK libs if they are installed Fl_GTK_Native_File_Chooser_Driver::probe_for_GTK_libs(); @@ -975,7 +972,8 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { // if we found all the GTK functions we need, we will use the GtkFileChooserDialog if (Fl_GTK_Native_File_Chooser_Driver::did_find_GTK_libs) platform_fnfc = new Fl_GTK_Native_File_Chooser_Driver(val); } -#endif // HAVE_DLSYM && HAVE_DLFCN_H } +#endif // HAVE_DLSYM && HAVE_DLFCN_H + if (!platform_fnfc) platform_fnfc = new Fl_Native_File_Chooser_FLTK_Driver(val); } |
