Native file dialogs

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
detlet
Posts: 82
Joined: Sun Sep 25, 2011 5:54 pm
Location: Lauenstein, Germany

Native file dialogs

Postby detlet » Fri Mar 29, 2019 7:18 pm

Hi,
I use xfce on debian, where the file dialogs normally come from Gtk+. So it bothered me, that FC do not use the native file dialogs from the system, but the ones from Qt. The only exception I found till now, is the import dialog from a2plus, which uses the system dialogs.

I don't want to offend anyone, so just say, I don't like the Qt dialogs. So I searched for a fix. The preferences don't offer a switch. The settings from the Qt configuration tool seem to be ignored. In the sources of Gui/FileDialog.cpp I found, that the use of the native dialogs has at least a configuration key. Adding this key in my ~/.FreeCAD/user.cfg helped and now FC uses the system dialogs.

From my point of view, the use of the native system dialogs should be the default. Because the user could simply set it system wide with the Qt settings tool. This gives FC a consistent look to the other programs, and it does not look like an alien like ie. Java programs.
Cheers, detlef
openBrain
Posts: 4874
Joined: Fri Nov 09, 2018 5:38 pm

Re: Native file dialogs

Postby openBrain » Fri Mar 29, 2019 9:55 pm

Hi,
Unfortunately there have been some troubles saving/opening files with system dialogs, especially the one from Gnome...
That's probably why the default is set to the Qt dialog. ;)
User avatar
Joel_graff
Posts: 1851
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Native file dialogs

Postby Joel_graff » Fri Mar 29, 2019 10:17 pm

The GTK one was saving files as all lower-case (a problem since our extension is .FCStd). But I was under the impression QT Dialogs weren't the default.

In any case, I think you can switch that off with a command-line parameter or maybe an option in the preferences? Not sure.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Native file dialogs

Postby NormandC » Sat Mar 30, 2019 12:39 am

I would much prefer the native dialogue myself, unfortunately it is utterly broken in GNOME, the file extension isn't added automatically when saving a new file; already saved files can't be opened again if they don't have the file extension.

I'm not sure why that is, if it's a Qt bug but it has existed for a long time.
User avatar
detlet
Posts: 82
Joined: Sun Sep 25, 2011 5:54 pm
Location: Lauenstein, Germany

Re: Native file dialogs

Postby detlet » Sat Mar 30, 2019 7:52 am

NormandC wrote:
Sat Mar 30, 2019 12:39 am
I would much prefer the native dialogue myself, unfortunately it is utterly broken in GNOME, the file extension isn't added automatically when saving a new file; already saved files can't be opened again if they don't have the file extension.
You are right, that the file extension is not added automatically is bad. I have no clue about C++ :D , but nevertheless I will try to fix it.
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Native file dialogs

Postby triplus » Tue Apr 02, 2019 12:03 am

For enabling or disabling such support:

https://forum.freecadweb.org/viewtopic. ... 80#p273068

As others have already pointed out, currently a lot of issues can be expected. And there is no easy fix to improve things.
User avatar
detlet
Posts: 82
Joined: Sun Sep 25, 2011 5:54 pm
Location: Lauenstein, Germany

Re: Native file dialogs

Postby detlet » Tue Apr 02, 2019 7:13 pm

triplus wrote:
Tue Apr 02, 2019 12:03 am
For enabling or disabling such support:

https://forum.freecadweb.org/viewtopic. ... 80#p273068
Thank you for the link.

As others have already pointed out, currently a lot of issues can be expected. And there is no easy fix to improve things.
In the last days I dug much in FCs Code, specially all the different uses of the file dialogs. Yes, it is complicated and every module does it a little bit different.

The big thing that bugs me with the gtk file dialog is, that it does not append the suffix to the file name, like the qt dialog does. And with the qt dialog it is annoying, that it does not reminds it's size if I have pulled it larger. I know that this are small issues, but from my point of view, software should be as handy as possible. Every little disturbance distracts me from the real work.

For now I'm happy, that I have managed to build my first little qt program, where I can play a little bit around with C++, qt and file dialogs. May be, some day I get to a good solution ;)