Re: [RFC][PATCH] native file dialogs

2018-03-21 Thread Jean-Marc Lasgouttes

Le 19/03/2018 à 17:29, Richard Kimberly Heck a écrit :

Yes, I'd guess 2.3.2. It's a reasonably big change. Presumably packagers
will have to
decide how to handle it, too.


Good, it is in 2.3.2-staging now.

JMarc


Re: [RFC][PATCH] native file dialogs

2018-03-19 Thread Richard Kimberly Heck
On 03/19/2018 11:57 AM, Jean-Marc Lasgouttes wrote:
> Le 19/03/2018 à 15:51, Jürgen Spitzmüller a écrit :
>> Am Montag, den 19.03.2018, 15:03 +0100 schrieb Jean-Marc Lasgouttes:
 I would not be opposed to a backport.
>>>
>>> As it is with native dialogs for everyone by default?
>>
>> Yes.
>
> Riki, what do you think about it? Is it 2.3.2 stuff? I guess it will
> have to be documented.

Yes, I'd guess 2.3.2. It's a reasonably big change. Presumably packagers
will have to
decide how to handle it, too.

Riki



Re: [RFC][PATCH] native file dialogs

2018-03-19 Thread Jean-Marc Lasgouttes

Le 19/03/2018 à 15:51, Jürgen Spitzmüller a écrit :

Am Montag, den 19.03.2018, 15:03 +0100 schrieb Jean-Marc Lasgouttes:

I would not be opposed to a backport.


As it is with native dialogs for everyone by default?


Yes.


Riki, what do you think about it? Is it 2.3.2 stuff? I guess it will 
have to be documented.


JMarc


Re: [RFC][PATCH] native file dialogs

2018-03-19 Thread Jürgen Spitzmüller
Am Montag, den 19.03.2018, 15:03 +0100 schrieb Jean-Marc Lasgouttes:
> > I would not be opposed to a backport.
> 
> As it is with native dialogs for everyone by default?

Yes.

Jürgen

> 
> JMarc

signature.asc
Description: This is a digitally signed message part


Re: [RFC][PATCH] native file dialogs

2018-03-19 Thread Jean-Marc Lasgouttes

Le 19/03/2018 à 14:40, Jürgen Spitzmüller a écrit :

Am Montag, den 19.03.2018, 11:52 +0100 schrieb Jean-Marc Lasgouttes:

It is in now.


Works here.


I am not sure what we want wrt 2.3.x.


I would not be opposed to a backport.


As it is with native dialogs for everyone by default?

JMarc


Re: [RFC][PATCH] native file dialogs

2018-03-19 Thread Jürgen Spitzmüller
Am Montag, den 19.03.2018, 11:52 +0100 schrieb Jean-Marc Lasgouttes:
> It is in now. 

Works here.

> I am not sure what we want wrt 2.3.x.

I would not be opposed to a backport.

Jürgen

> 
> JMarc

signature.asc
Description: This is a digitally signed message part


Re: [RFC][PATCH] native file dialogs

2018-03-19 Thread Jean-Marc Lasgouttes

Le 14/03/2018 à 12:06, Kornel Benko a écrit :

Only if it affects previous lyx-versions IMHO.
Since lyx ignores (with warning) unknown settings, it should not be needed.


It is in now. I am not sure what we want wrt 2.3.x.

JMarc


Re: [RFC][PATCH] native file dialogs

2018-03-14 Thread Kornel Benko
Am Mittwoch, 14. März 2018 11:36:24 CET schrieb Jean-Marc Lasgouttes 
:
> Le 10/03/2018 à 11:17, Kornel Benko a écrit :
> > I'd say, now is the right time to commit the proposed patch. Having
> > different defaults for linux and Mac/Windows can be done in configure.
> 
> Let's apply for master first.

+1

> A question: if I do not intend to add pref
> update code, do I have to update the LyXRC version number?
> 
> JMarc

Only if it affects previous lyx-versions IMHO.
Since lyx ignores (with warning) unknown settings, it should not be needed.

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: [RFC][PATCH] native file dialogs

2018-03-14 Thread Jean-Marc Lasgouttes

Le 10/03/2018 à 11:17, Kornel Benko a écrit :

I'd say, now is the right time to commit the proposed patch. Having different
defaults for linux and Mac/Windows can be done in configure.


Let's apply for master first. A question: if I do not intend to add pref 
update code, do I have to update the LyXRC version number?


JMarc


Re: [RFC][PATCH] native file dialogs

2018-03-10 Thread Kornel Benko
Am Donnerstag, 1. Februar 2018 08:22:30 CET schrieb Guenter Milde 
:
> On 2018-01-31, Jürgen Spitzmüller wrote:
> > Am Mittwoch, den 31.01.2018, 11:00 +0100 schrieb Jean-Marc Lasgouttes:
> >> Le 31/01/2018 à 08:20, Jürgen Spitzmüller a écrit :
> ...
> 
> >> > The nice thing about the buttons is that they only occur when it
> >> > makes
> >> > sense. And remember we do not only have "Examples". We also show
> >> > "Templates" (my favorite), "Documents", "Cliparts" (and maybe
> >> > others).
> >> > And if done correctly, it could be extended to other places
> >> > depending
> >> > on the context (e.g., "BibTeX databases" ($TEXMF/bib) in the BibTeX
> >> > dialog).
> >> 
> >> Yes, I thought about that since writing this message. Note that "New
> >> from template" already starts from the template directory.
> > 
> > Yes, I know.
> 
> OTOH, we do not have a "File>Save as template" (and I don't think we
> should add it) while "File>Save as" offers the [templates] button for
> easy creation of templates.
> 
> > The off thing is that it only includes the system
> > directory, not the user directory (not that the buttons would solve
> > that).
> 
> The examples and templates directories can be configured in
> Tools>Preferences>Paths. However if changed to the user directory, the
> system dir is "hidden". I worked around this with a symlink from my user
> templates directory to the system one.
> 
> I expect the average user to gain from creation and use of custom
> templates. Therefore I'd like to make this "dead easy".
> 
> * Set the default value for the templates to the user directory
> 
> * Either
>   - add a symlink USERDIR/templates/standard/ -> LYXDIR/templates/
> when installing LyX
>   or
>   - merge the files in userdir and lyxdir in the "new from template"
> dialogue.
> 
> I don't expect the average user to create custom examples in
> USERDIR/examples. OTOH, examples can be used as templates. Maybe we could
> also add a symlink USERDIR/templates/examples/ -> LYXDIR/examples/
> (Possibly in additon to a Help>Examples sub-menu.)
> 
> See also the discussion around
> https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg200102.html
> 
> Günter

I'd say, now is the right time to commit the proposed patch. Having different 
defaults for linux and Mac/Windows can be done in configure.

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: [RFC][PATCH] native file dialogs

2018-02-01 Thread Guenter Milde
On 2018-01-31, Jürgen Spitzmüller wrote:
> Am Mittwoch, den 31.01.2018, 11:00 +0100 schrieb Jean-Marc Lasgouttes:
>> Le 31/01/2018 à 08:20, Jürgen Spitzmüller a écrit :

...

>> > The nice thing about the buttons is that they only occur when it
>> > makes
>> > sense. And remember we do not only have "Examples". We also show
>> > "Templates" (my favorite), "Documents", "Cliparts" (and maybe
>> > others).
>> > And if done correctly, it could be extended to other places
>> > depending
>> > on the context (e.g., "BibTeX databases" ($TEXMF/bib) in the BibTeX
>> > dialog).

>> Yes, I thought about that since writing this message. Note that "New 
>> from template" already starts from the template directory.

> Yes, I know.

OTOH, we do not have a "File>Save as template" (and I don't think we
should add it) while "File>Save as" offers the [templates] button for
easy creation of templates.

> The off thing is that it only includes the system
> directory, not the user directory (not that the buttons would solve
> that).

The examples and templates directories can be configured in
Tools>Preferences>Paths. However if changed to the user directory, the
system dir is "hidden". I worked around this with a symlink from my user
templates directory to the system one.

I expect the average user to gain from creation and use of custom
templates. Therefore I'd like to make this "dead easy".

* Set the default value for the templates to the user directory

* Either 
  - add a symlink USERDIR/templates/standard/ -> LYXDIR/templates/
when installing LyX
  or
  - merge the files in userdir and lyxdir in the "new from template"
dialogue.

I don't expect the average user to create custom examples in 
USERDIR/examples. OTOH, examples can be used as templates. Maybe we could
also add a symlink USERDIR/templates/examples/ -> LYXDIR/examples/
(Possibly in additon to a Help>Examples sub-menu.)

See also the discussion around
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg200102.html

Günter



Re: [RFC][PATCH] native file dialogs

2018-02-01 Thread Guenter Milde
On 2018-01-30, José Abílio Matos wrote:
> On Tuesday, 30 January 2018 14.53.45 WET Pavel Sanda wrote:

>> I use them sometimes, but can't say whether it's because of real usage or
>> devel activities... P

> Me too. :-)

So do I...

...

> One option that I thought about it sometimes is the removal of the
> native file dialogs and the placement in the Help menu of an entry that
> would allow to open the file picker for Examples. Because, at least to
> me, Examples conceptually belong to Help and not to File.

Agreed. See also https://www.lyx.org/trac/ticket/8715 and the discussion at
lyx-devel 10 months ago
https://www.mail-archive.com/search?l=mid&q=20170406034441.dxnerqeqj2civx3s%40steph

Günter



Re: [RFC][PATCH] native file dialogs

2018-01-31 Thread Jürgen Spitzmüller
Am Mittwoch, den 31.01.2018, 11:00 +0100 schrieb Jean-Marc Lasgouttes:
> Le 31/01/2018 à 08:20, Jürgen Spitzmüller a écrit :
> > > Or set the default to use native everywhere and let experienced
> > > people override that.
> > 
> > Yes. But then, I think, you can also drop it altogether.
> 
> Just because I propose to change the unix default? We need to have a 
> cross platform strategy. There is no real justification for the 
> different handling of the platforms.

I mean if it is only for some "experienced users", I doubt it is worth
all the maintenance hassle.

> > The nice thing about the buttons is that they only occur when it
> > makes
> > sense. And remember we do not only have "Examples". We also show
> > "Templates" (my favorite), "Documents", "Cliparts" (and maybe
> > others).
> > And if done correctly, it could be extended to other places
> > depending
> > on the context (e.g., "BibTeX databases" ($TEXMF/bib) in the BibTeX
> > dialog).
> 
> Yes, I thought about that since writing this message. Note that "New 
> from template" already starts from the template directory.

Yes, I know. The off thing is that it only includes the system
directory, not the user directory (not that the buttons would solve
that).

> Concerning clipart, I do not think that it is of much use. Most OS
> will 
> have a generic place for images.

Indeed.

> There is also the case of ui or bind files, but I think using a
> popup 
> menu there would be much more useful.

How would that look like?

> 
> > > > This would be the best solution IMHO. But do you know how to
> > > > make
> > > > setSidebarUrl work with proper entries? (I don't).
> > > 
> > > Well, first, remember that it means no native dialog.
> > 
> > Why? Doesn't the method work with native dialogs?
> 
> No: 
> https://code.woboq.org/qt5/qtbase/src/widgets/dialogs/qfiledialog.cpp
> .html#_ZN11QFileDialog14setSidebarUrlsERK5QListI4QUrlE

Too bad. Then setSidebarUrls does not guy us anything above the
buttons.

Jürgen

> 
> JMarc

signature.asc
Description: This is a digitally signed message part


Re: [RFC][PATCH] native file dialogs

2018-01-31 Thread Jean-Marc Lasgouttes

Le 31/01/2018 à 08:20, Jürgen Spitzmüller a écrit :

Or set the default to use native everywhere and let experienced
people override that.


Yes. But then, I think, you can also drop it altogether.


Just because I propose to change the unix default? We need to have a 
cross platform strategy. There is no real justification for the 
different handling of the platforms.



The nice thing about the buttons is that they only occur when it makes
sense. And remember we do not only have "Examples". We also show
"Templates" (my favorite), "Documents", "Cliparts" (and maybe others).
And if done correctly, it could be extended to other places depending
on the context (e.g., "BibTeX databases" ($TEXMF/bib) in the BibTeX
dialog).


Yes, I thought about that since writing this message. Note that "New 
from template" already starts from the template directory.


Concerning clipart, I do not think that it is of much use. Most OS will 
have a generic place for images.


There is also the case of ui or bind files, but I think using a popup 
menu there would be much more useful.



This would be the best solution IMHO. But do you know how to make
setSidebarUrl work with proper entries? (I don't).


Well, first, remember that it means no native dialog.


Why? Doesn't the method work with native dialogs?


No: 
https://code.woboq.org/qt5/qtbase/src/widgets/dialogs/qfiledialog.cpp.html#_ZN11QFileDialog14setSidebarUrlsERK5QListI4QUrlE


JMarc


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread Jürgen Spitzmüller
Am Dienstag, den 30.01.2018, 23:24 +0100 schrieb Jean-Marc Lasgouttes:
> Nice, so to speak. To be frank, I have no interest in reworking 20+ 
> dialogs to give them nice buttons. But this is of course desirable
> in 
> the long term.

I agree.

> > > 1/ apply this patch, maybe with a default of "false" and value
> > > "true"
> > > set in mac and windows lyxrc.dist files. This would give us the
> > > same
> > > behavior as before, but configurable
> > 
> > Would be good as a start.
> 
> Or set the default to use native everywhere and let experimented
> people 
> override that.

Yes. But then, I think, you can also drop it altogether.

> > > 3/ remove support for our custom file dialog and always use the
> > > native
> > > one (this would lose the Document/Example buttons)
> > 
> > Which would be a pity.
> 
> Why? Because of the buttons? José proposed to add an entry "Open 
> example..." in Help menu (could be in File menu too). Would that be
> enough ?

The nice thing about the buttons is that they only occur when it makes
sense. And remember we do not only have "Examples". We also show
"Templates" (my favorite), "Documents", "Cliparts" (and maybe others).
And if done correctly, it could be extended to other places depending
on the context (e.g., "BibTeX databases" ($TEXMF/bib) in the BibTeX
dialog).

> 
> Note that each OS offers a way to add your own favorite places in a
> kind 
> of sidebar.

I know, but these are static (at least on an app-level).

> > > 4/  remove support for our custom file dialog and always use the
> > > Qt
> > > custom file dialog, and try to make setSidebarUrl work, so that
> > > we
> > > have
> > > our Documents/Examples links in the side bar; this cannot work
> > > with
> > > a
> > > native file dialog.
> > 
> > This would be the best solution IMHO. But do you know how to make
> > setSidebarUrl work with proper entries? (I don't).
> 
> Well, first, remember that it means no native dialog.

Why? Doesn't the method work with native dialogs?

> Then the way to do it could be to create links to the proper
> directories 
> which have the proper names. But this is bound to fail in one way or 
> another. It is a pity that QUrl does not allow to add a text part.

Indeed.

Jürgen


signature.asc
Description: This is a digitally signed message part


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread Andrew Parsloe

On 31/01/2018 4:41 a.m., Jean-Marc Lasgouttes wrote:

Le 30/01/2018 à 16:33, José Abílio Matos a écrit :
One option that I thought about it sometimes is the removal of the 
native file dialogs and the placement in the Help menu of an entry 
that would allow to open the file picker for Examples. Because, at 
least to me, Examples conceptually belong to Help and not to File.


You mean _custom_ file dialogs, right?

JMarc
As a windows user, I like this idea. At present the examples are well 
hidden. To get to them needs a lot of clicking so that over a decade of 
LyX use I've hardly looked at them.


Andrew

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread Jean-Marc Lasgouttes

Le 30/01/2018 à 19:32, Jürgen Spitzmüller a écrit :

The following patch allows to select the type of file dialog at
runtime
(see ticket http://www.lyx.org/trac/ticket/11003 for why I am doing
that).


Nice.


Nice, so to speak. To be frank, I have no interest in reworking 20+ 
dialogs to give them nice buttons. But this is of course desirable in 
the long term.



1/ apply this patch, maybe with a default of "false" and value
"true"
set in mac and windows lyxrc.dist files. This would give us the same
behavior as before, but configurable


Would be good as a start.


Or set the default to use native everywhere and let experimented people 
override that.



3/ remove support for our custom file dialog and always use the
native
one (this would lose the Document/Example buttons)


Which would be a pity.


Why? Because of the buttons? José proposed to add an entry "Open 
example..." in Help menu (could be in File menu too). Would that be enough ?


Note that each OS offers a way to add your own favorite places in a kind 
of sidebar.



4/  remove support for our custom file dialog and always use the Qt
custom file dialog, and try to make setSidebarUrl work, so that we
have
our Documents/Examples links in the side bar; this cannot work with
a
native file dialog.


This would be the best solution IMHO. But do you know how to make
setSidebarUrl work with proper entries? (I don't).


Well, first, remember that it means no native dialog.

Then the way to do it could be to create links to the proper directories 
which have the proper names. But this is bound to fail in one way or 
another. It is a pity that QUrl does not allow to add a text part.




Does somebody use the custom Documents/Examples buttons? Are they
really
needed?


I don't use them anymore personally (I use the native dialog), but I
think they are quite useful. But of course they should work on all
platforms.


Indeed.

JMarc


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread Jürgen Spitzmüller
Am Dienstag, den 30.01.2018, 15:01 +0100 schrieb Jean-Marc Lasgouttes:
> Currently native file dialogs are used on windows and Mac. It is 
> possible to select them on unix with cmake, but not autoconf.
> 
> The following patch allows to select the type of file dialog at
> runtime 
> (see ticket http://www.lyx.org/trac/ticket/11003 for why I am doing
> that).

Nice.

> Currently all platforms default to true (native). Where can we go
> from 
> there? Ideas:
> 
> 1/ apply this patch, maybe with a default of "false" and value
> "true" 
> set in mac and windows lyxrc.dist files. This would give us the same 
> behavior as before, but configurable

Would be good as a start.

> 
> 2/ the same, but also add a 100th checkbox to our crowded preference 
> dialog so that people can toggle it at ease

Nah.

> 3/ remove support for our custom file dialog and always use the
> native 
> one (this would lose the Document/Example buttons)

Which would be a pity.

> 4/  remove support for our custom file dialog and always use the Qt 
> custom file dialog, and try to make setSidebarUrl work, so that we
> have 
> our Documents/Examples links in the side bar; this cannot work with
> a 
> native file dialog.

This would be the best solution IMHO. But do you know how to make
setSidebarUrl work with proper entries? (I don't).

> Does somebody use the custom Documents/Examples buttons? Are they
> really 
> needed?

I don't use them anymore personally (I use the native dialog), but I
think they are quite useful. But of course they should work on all
platforms.

Jürgen

> 
> JMarc
> 
> 

signature.asc
Description: This is a digitally signed message part


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread Scott Kostyshak
On Tue, Jan 30, 2018 at 02:01:54PM +, Jean-Marc Lasgouttes wrote:

> Does somebody use the custom Documents/Examples buttons? Are they really
> needed?

I use them, but the cost of forgetting that they are not available on
all platforms always comes back to bite me when I give a presentation on
LyX.

Scott


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread José Abílio Matos
On Tuesday, 30 January 2018 15.41.28 WET Jean-Marc 
Lasgouttes wrote:
> You mean _custom_ file dialogs, right?
> 
> JMarc

Sure. My mistake. :-)
-- 
José Abílio


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread Jean-Marc Lasgouttes

Le 30/01/2018 à 16:33, José Abílio Matos a écrit :
One option that I thought about it sometimes is the removal of the 
native file dialogs and the placement in the Help menu of an entry that 
would allow to open the file picker for Examples. Because, at least to 
me, Examples conceptually belong to Help and not to File.


You mean _custom_ file dialogs, right?

JMarc


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread José Abílio Matos
On Tuesday, 30 January 2018 14.53.45 WET Pavel Sanda wrote:
> I use them sometimes, but can't say whether it's because of real usage or
> devel activities... P

Me too. :-)

I think that the question regarding the usefulness of the those dialogs could 
get a 
better feedback on the users list. If not for other reason for the fact that 
most of us on 
this list are tainted.

One option that I thought about it sometimes is the removal of the native file 
dialogs 
and the placement in the Help menu of an entry that would allow to open the 
file 
picker for Examples. Because, at least to me, Examples conceptually belong to 
Help 
and not to File.

Regards,
-- 
José Abílio


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread Pavel Sanda
Jean-Marc Lasgouttes wrote:
> Does somebody use the custom Documents/Examples buttons? Are they really 
> needed?

I use them sometimes, but can't say whether it's because of real usage or
devel activities... P


Re: [RFC][PATCH] native file dialogs

2018-01-30 Thread Jean-Pierre Chrétien

Le 30/01/2018 à 15:01, Jean-Marc Lasgouttes a écrit :


Does somebody use the custom Documents/Examples buttons? Are they really needed?


I use these two quite often (more frequently examples), but my use of LyX is 
mostly for translations.


--
Jean-Pierre



[RFC][PATCH] native file dialogs

2018-01-30 Thread Jean-Marc Lasgouttes
Currently native file dialogs are used on windows and Mac. It is 
possible to select them on unix with cmake, but not autoconf.


The following patch allows to select the type of file dialog at runtime 
(see ticket http://www.lyx.org/trac/ticket/11003 for why I am doing that).


Currently all platforms default to true (native). Where can we go from 
there? Ideas:


1/ apply this patch, maybe with a default of "false" and value "true" 
set in mac and windows lyxrc.dist files. This would give us the same 
behavior as before, but configurable


2/ the same, but also add a 100th checkbox to our crowded preference 
dialog so that people can toggle it at ease


3/ remove support for our custom file dialog and always use the native 
one (this would lose the Document/Example buttons)


4/  remove support for our custom file dialog and always use the Qt 
custom file dialog, and try to make setSidebarUrl work, so that we have 
our Documents/Examples links in the side bar; this cannot work with a 
native file dialog.


Does somebody use the custom Documents/Examples buttons? Are they really 
needed?


JMarc


From 2bf8eecb41c8af81a5988ba032f567936ad99662 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes 
Date: Tue, 30 Jan 2018 14:32:53 +0100
Subject: [PATCH] Make it possible to select (not)native file dialogs at run
 time

Add a new LyXRC variable use_native_filedialog (true by default) that
allows to select the kind of FileDialog we want at runtime.
---
 src/LyXRC.cpp|  16 
 src/LyXRC.h  |   3 +
 src/frontends/qt4/FileDialog.cpp | 177 +++
 3 files changed, 106 insertions(+), 90 deletions(-)

diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 9e42857..6a58f34 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -195,6 +195,7 @@ LexerKeyword lyxrcTags[] = {
 	{ "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
 	{ "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
 	{ "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
+	{ "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
 	{ "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
 	// compatibility with versions older than 1.4.0 only
 	{ "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
@@ -272,6 +273,7 @@ void LyXRC::setDefaults()
 	num_lastfiles = 20;
 	check_lastfiles = true;
 	use_lastfilepos = true;
+	use_native_filedialog = true;
 	load_session = false;
 	make_backup = true;
 	save_compressed = false;
@@ -871,6 +873,9 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
 		case RC_ACCEPT_COMPOUND:
 			lexrc >> spellchecker_accept_compound;
 			break;
+		case RC_USE_NATIVE_FILEDIALOG:
+			lexrc >> use_native_filedialog;
+			break;
 		case RC_USE_SYSTEM_COLORS:
 			lexrc >> use_system_colors;
 			break;
@@ -2405,6 +2410,16 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
 		if (tag != RC_LAST)
 			break;
 		// fall through
+	case RC_USE_NATIVE_FILEDIALOG:
+		if (ignore_system_lyxrc ||
+		use_native_filedialog != system_lyxrc.use_native_filedialog) {
+			os << "\\use_native_filedialog "
+			   << convert(use_native_filedialog)
+			   << '\n';
+		}
+		if (tag != RC_LAST)
+			break;
+		// fall through
 	case RC_USE_SYSTEM_COLORS:
 		if (ignore_system_lyxrc ||
 		use_system_colors != system_lyxrc.use_system_colors) {
@@ -3015,6 +3030,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
 	case LyXRC::RC_USE_CONVERTER_CACHE:
 	case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
 	case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
+	case LyXRC::RC_USE_NATIVE_FILEDIALOG:
 	case LyXRC::RC_USE_SYSTEM_COLORS:
 	case LyXRC::RC_USE_TOOLTIP:
 	case LyXRC::RC_USE_PIXMAP_CACHE:
diff --git a/src/LyXRC.h b/src/LyXRC.h
index 3da93ac..5376673 100644
--- a/src/LyXRC.h
+++ b/src/LyXRC.h
@@ -172,6 +172,7 @@ public:
 		RC_USE_CONVERTER_CACHE,
 		RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN,
 		RC_USE_CONVERTER_NEEDAUTH,
+		RC_USE_NATIVE_FILEDIALOG,
 		RC_USE_SYSTEM_COLORS,
 		RC_USE_TOOLTIP,
 		RC_USE_PIXMAP_CACHE,
@@ -332,6 +333,8 @@ public:
 	bool use_tooltip;
 	/// Use the colors from current system theme?
 	bool use_system_colors;
+	/// use native file dialog or our own ?
+	bool use_native_filedialog;
 	/// Use pixmap cache?
 	bool use_pixmap_cache;
 	/// Spellchecker engine: aspell, hunspell, etc
diff --git a/src/frontends/qt4/FileDialog.cpp b/src/frontends/qt4/FileDialog.cpp
index f115634..ee5f350 100644
--- a/src/frontends/qt4/FileDialog.cpp
+++ b/src/frontends/qt4/FileDialog.cpp
@@ -16,6 +16,8 @@
 #include "LyXFileDialog.h"
 #include "qt_helpers.h"
 
+#include "LyXRC.h"
+
 #include "support/debug.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
@@ -24,7 +26,9 @@
 
 #include 
 
-/** when this is defined, the code will use
+#include 
+
+/** when LyXRC::use_native_filedialog is true, we use
  * QFileDialog::getOpenFileName and friends to create filedialogs.
  * Effects:
  *