Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 889014 - media-gfx/freecad-0.20.1 - Use native file dialog
Summary: media-gfx/freecad-0.20.1 - Use native file dialog
Status: IN_PROGRESS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Paul Zander
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-30 19:26 UTC by Chris Mayo
Modified: 2024-04-14 19:07 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Mayo 2022-12-30 19:26:05 UTC
On GNOME 43 the FreeCAD Qt file dialog (File/Open, File/Save etc.) is not easy to use. Only the Home shortcut is present and navigation in the filesystem is awkward.

This can be resolved by updating the ebuild to use the native file dialog:

@@ -204,7 +204,7 @@
 		-DFREECAD_USE_OCC_VARIANT:STRING="Official Version"
 		-DFREECAD_USE_PCL=$(usex pcl)
 		-DFREECAD_USE_PYBIND11=ON
-		-DFREECAD_USE_QT_FILEDIALOG=ON
+		-DFREECAD_USE_QT_FILEDIALOG=OFF
 		-DFREECAD_USE_QTWEBMODULE:STRING="Qt WebEngine"
 
 		# install python modules to site-packages' dir. True only for the main package,


Else perhaps it could be made optional behind a USE flag.
Comment 1 Chris Mayo 2022-12-31 09:59:33 UTC
This may need dev-qt/qtwidgets[gtk]. I do have that installed.
Comment 2 Bernd 2022-12-31 10:37:00 UTC
This might affect other GTK based WMs as well. I'm thinking about adding a gtk USE flag and setting the cmake option and the qtwidgets dependency according to this USE flag.

I can set this up, but haven't used Gnome since v3 came out, so I can't properly test the changes.
Comment 3 Andrew Ammerlaan gentoo-dev 2023-04-25 10:47:17 UTC
> I'm thinking about adding a gtk USE flag and setting the cmake option and 
> the qtwidgets dependency according to this USE flag.

The problem with this is that the gtk flag is enabled by default on the desktop profiles, even on the kde plasma desktop profiles. So putting this behind a gtk flag would mean that on a plasma desktop profile, where we would want -DFREECAD_USE_QT_FILEDIALOG=ON, it would instead be disabled by default.

Ideally this would be toggle-able at runtime. Is it possible to compile with support for the QT_FILEDIALOG, but to choose at runtime to not use it?
Comment 4 Bernd 2023-04-25 14:47:41 UTC
Could be this already is a toggleable runtime setting. After Andrew's message, I looked up how the cmake option is being used and found there's a DialogOptions method which reads this value from parameters which can be set by the user.

In the `Tools` menu, select the `Edit parameters...` entry. In the dialog which opens select BaseApp->Preferences->Dialog. There you can add a boolean entry named `DontUseNativeDialog` and set it to true and click Save to disk. AFAICS this should do the change.
You might eventually have to restart FC for it take effect. I'm using LXQt desktop, so it doesn't show any difference. If someone with a GTK based desktop could please test this? TIA
Comment 5 Chris Mayo 2023-04-25 18:54:55 UTC
The DontUseNativeDialog setting works on GNOME/GTK (did have to create it).

-DFREECAD_USE_QT_FILEDIALOG is only the changing the hard-coded runtime default which is used without the setting.

Not the highest priority then, a bit of a convenience, maybe USE="gnome". Accepting that users of Xfce etc. might have to think about it a bit.
Comment 6 Bernd 2023-04-26 16:12:22 UTC
(In reply to Chris Mayo from comment #5)
> The DontUseNativeDialog setting works on GNOME/GTK (did have to create it).
> 
> -DFREECAD_USE_QT_FILEDIALOG is only the changing the hard-coded runtime
> default which is used without the setting.
> 
> Not the highest priority then, a bit of a convenience, maybe USE="gnome".
> Accepting that users of Xfce etc. might have to think about it a bit.

Yes, there's no default entry given. As this file is in the users home directory, I know of no good way to deliver a configuration file for it during the installation of the package. We can ask upstream, if it's possible to add such a entry on startup if it's missing and set it to the value configured by cmake.

For the FREECAD_USE_QT_FILEDIALOG, the default upstream value for linux machines is to set it to ON. For Windows and Apple machines it's OFF.

As there's a method provided by upstream to configure this, I see this as a resolution. We could check if there's an info on the FC wiki regarding this topic and eventually add an entry if there's nothing provided. Regardind a USE="gnome" (or USE="native{,-dialog}") or some other use flag we would have to test how this builds and what's the user experience for such a flag. As of now, I would see this as nice to have.