Page 1 of 2

QT5 file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 9:19 am
by freman
Hi,

I have just moved from a qt4 build to qt5. I am finding that the file open / save / saveAs / save-a-copy dialogues have near total amnesia.

If I open a file then go to File | SaveAs , I get neither the current filename nor the current path of that file displayed.

In this case I expect the filename to be filled with the current filename ( I'm most likely just going to add a suffix as a version or a backup rename ) and I'm most likely to want it in the same directory. If I want to save it elsewhere, I'm most likely to want to keep the filename intact and I do not want the possibility of a mis-type or have to go and find exactly what it is currently called and type it in by hand.

I never had this problem before where the names filled in and the drop down list of recently used directory paths was usually quite helpful.

The current default in the otherwise empty path list is the path of the /bin/FreeCAD executable , probably one of the last places I want to store my work !

File | Open seems to have a different memory . I'm not sure where this is useful since opening and saving would likely be in the same directory most of the time. It certainly exacerbates the lack of retention of recently used paths.

Every time I restart FreeCAD it seems to forget the little useful information I have managed to get into these path dropdown lists.

This is a real PITA since I'm for ever having to climb around the tree to get where I need to be for what should be such trivial operations.

My last qt4 was from Aug25 master. I never saw these issues on any qt4 build, so I'm suspecting it is qt5 related.

Also File | Recent files only seems to retain 4 entries, this is insufficient and means it is often not useful and I need to climbing around tree again just to find what I did 10min earlier. I don't see anywhere to configure the number entries and I think it previouslywent deeper.


OS: Fedora 31 (Thirty One) (LXDE/LXDE)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18754 (Git)
Build type: Release
Branch: master
Hash: a5019828cf263ccdec3b6885f845b1ab1c35ac11
Python version: 3.7.5
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)




PS If I open a file , then go to chose a font for a ShapeString, then come back to File | Open, it see /usr /usr/share/ /usr/share/fonts etc. and NOT the last place I opened a FC file !! It is unclear why there is a separate entry for each part of the path ( I have a template for the default font file, so I did not even walk that list of directories in getting there ).

I would suggest that font selection needs its own instance of the open file dlg that does not pollute the general file FC open/save mechanism. No one has work files there and usually this is a protected system path anyway.

These issue are probably pretty easy to fix and would make a world of difference to usability of the interface. There seems to be some regression here. Very frustrating.

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 10:35 am
by DeepSOIC
Try fiddling with DontUseNativeDialog preference:
https://forum.freecadweb.org/viewtopic. ... 84#p275295

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 10:37 am
by chrisb
freman wrote:
Tue Nov 19, 2019 9:19 am
I have just moved from a qt4 build to qt5. I am finding that the file open / save / saveAs / save-a-copy dialogues have near total amnesia.
You may try the native file selection dialog, see the first linux entry in the known issues topic.

Edit: crosspost with DeepSOIC, but my link looks nicer 8-)

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 10:43 am
by freman
thanks both. I saw deep's link first and it brings up my system dlg which at least goes to the last used path and fills in filenames.

I have not fully tested but it seems way better already. Is there somewhere I can paste those lines to make them load automatically rather than needing to paste every startup?

TIA. Great support with great ideas ;)

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 10:45 am
by chrisb
You can configure it in the parameters.

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 10:52 am
by freman
ah thanks Chris. I had looked in Edit | Prefs earlier and did not find anything relevant. I was forgetting Tools | Prefs.

certainly flexible you just need to know where to look in the metric tonnes of prefs that are on offer.

Nice permanent fix.

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 1:44 pm
by freman
Tools | Edit Prefs | BaseApp | Prefs | Dialogs did not seem to work. I set this after doing the python paste and assumed it would stick.

Next time I open the setting is still "true" but I do not see by system dialogs but the FC ones.

For now it seems I need to paste python each time, rather tiresome.

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 2:30 pm
by DeepSOIC
The console snippet modifies the preferences, same as doing it via edit->parameters. It should stick. There may be a weird interplay if you have multiple instances. So to be absolutely sure:
* close all FC instances but one
* run the snippet in the remaining instance
* close that last instance
now it should be written to the cfg file in the correct state.


freman wrote:
Tue Nov 19, 2019 1:44 pm
Next time I open the setting is still "true" but I do not see by system dialogs but the FC ones.
So it does stick, right? Maybe it's a bug somewhere...

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 2:58 pm
by freman
Just flipped it a couple of times and it seems good. I did have a crash earlier on closing FC, maybe that messed it up.
Also the double-negative "DontUseNativeDialog"=False is confusing. Why not "UseNativeDialog"=True :?

Anyway, both proposed methods seem to do the job. Thank to all.

Re: file open/save dialogue with Alzheimers

Posted: Tue Nov 19, 2019 8:46 pm
by Kunda1
OP please mark thread [Solved] if it is in fact Solved. Thanks