diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-12-07 11:24:35 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-12-07 11:24:35 +0100 |
| commit | 663b93a8070db905e1e7741f9e6b1cea915f61c7 (patch) | |
| tree | ecdeef82bf40afaa88268e06d4ef3900ea41a733 /src/Fl_Native_File_Chooser_Kdialog.H | |
| parent | 939d536b66c633b42eeddfe3dfa775e7fab0055a (diff) | |
Fix for issue #278: Can we use the qt/kde file picker instead of gtk?
Under the X11 platform, class Fl_Native_File_Chooser will behave as follows :
- if the KDE desktop is used and if command "kdialog" is available in the path,
the Qt/KDE file chooser is used;
- otherwise, if the GTK library is available at run-time,
the GTK file chooser is used;
- otherwise, the FLTK file chooser is used.
In addition, when Fl::OPTION_FNFC_USES_GTK is off, the FLTK file chooser
is always used.
Diffstat (limited to 'src/Fl_Native_File_Chooser_Kdialog.H')
| -rw-r--r-- | src/Fl_Native_File_Chooser_Kdialog.H | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/Fl_Native_File_Chooser_Kdialog.H b/src/Fl_Native_File_Chooser_Kdialog.H new file mode 100644 index 000000000..730b25e29 --- /dev/null +++ b/src/Fl_Native_File_Chooser_Kdialog.H @@ -0,0 +1,49 @@ +// +// FLTK native file chooser widget : KDE version +// +// Copyright 2021 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: +// +// https://www.fltk.org/bugs.php +// + +#ifndef FL_KDIALOG_NATIVE_FILE_CHOOSER_H +#define FL_KDIALOG_NATIVE_FILE_CHOOSER_H 1 + +#include <FL/Fl_Native_File_Chooser.H> + +class FL_EXPORT Fl_Kdialog_Native_File_Chooser_Driver : public Fl_Native_File_Chooser_FLTK_Driver { + friend class Fl_Native_File_Chooser; + char **_pathnames; + int _tpathnames; + char *_directory; + char *_preset_file; + char *_title; + static bool did_find_kdialog; + static bool have_looked_for_kdialog; + Fl_Kdialog_Native_File_Chooser_Driver(int val); + ~Fl_Kdialog_Native_File_Chooser_Driver(); + int count() const; + const char *filename() const; + const char *filename(int i) const; + int show(); + char *parse_filter(const char *f); + const char *filter() const; + virtual void filter(const char *f); + int filters() const; + void preset_file(const char *val); + const char *preset_file() const; + void directory(const char *val); + const char *directory() const; + void title(const char *val); + const char *title() const; +}; + +#endif // FL_KDIALOG_NATIVE_FILE_CHOOSER_H |
