Gcode file save dlg options

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
freman
Posts: 1590
Joined: Tue Nov 27, 2018 10:30 pm

Gcode file save dlg options

Post by freman »

Hi,
Feature request:

Every time I post process and save my gcode file I have to mess with the file save dlg options.

Firstly "auto resize" is ON every time even if I deselected it last time.
Second, which columns are shown is configurable but not retained from one use of the dlg to the next.

In particular I really don't need the PC to tell me what a *.nc file is, especially when it show some erroneous BS which is wrong anyway.

This is just clutter which means that the autosize truncates the filename I DO NEED to see.

So every single time I save a file I have to reconfigure the dlg options.

That this is configurable is really cool. It would be great if retained setting from one instance to another.

TIA.
Attachments
file-save-dlg.png
file-save-dlg.png (32.86 KiB) Viewed 819 times
spanner888
Posts: 143
Joined: Tue May 28, 2019 10:51 am

Re: Gcode file save dlg options

Post by spanner888 »

I am extremely uncertain what you are asking/describing.

For example "auto resize"....of what ...where...I can only make uncertain guesses of what you are discussing.

Then "...what a *.nc file is..." surely that is (almost) totally dependant on your operating system and it's file associations. The NC file association & description MAY have been set by FreeCAD, depending on how you installed FreeCAD, or it may have been set or even overwritten by a subsequent install of some other software such as a different CAD package or CAM simulator.
User avatar
sliptonic
Posts: 2445
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Gcode file save dlg options

Post by sliptonic »

This is not a Path thing. This is dependent on your window manager.
User avatar
freman
Posts: 1590
Joined: Tue Nov 27, 2018 10:30 pm

Re: Gcode file save dlg options

Post by freman »

Thanks for the reply.

surely this part of qt5 and these options are programmable.

AFIAK, window managers take care of window title bar, frame and decoration , they do not provide functional content.
GeneFC
Posts: 2817
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Gcode file save dlg options

Post by GeneFC »

(Piling on mode.) :lol:

I have never seen anything like what you are describing. Probably not FreeCAD caused.

Gene
User avatar
freman
Posts: 1590
Joined: Tue Nov 27, 2018 10:30 pm

Re: Gcode file save dlg options

Post by freman »

This does seem platform dependent. For example, on iOS it seems the Type column is called "Kind".
I have never seen anything like what you are describing.
Probably some have never looked. ;) If I right click on the column headers I get a context menu which shows the column names and allows selection of which columns are shown and the "auto-resize" I referred to. That maybe platform specific.
Probably not FreeCAD caused.
qt5 uses the native standard dialogs by default. The question is whether qt5 also gives a mechanism to control these options.

For example it does give access to which column is used to sort the files displayed and the sort order.
https://doc.qt.io/qt-5/qabstractproxymodel.html#sort

I have not yet found how to select which columns are visible and how to read and set this detail.

I admit its a lot less obvious than I had imagined it would be :(

If I can find a platform specific way to nobble these damned "Type" columns in file dlgs I would be even more content. They are a worthless PITA inherited from a platform which hides file extensions and then has to clutter the display which garbage because it hid important information because it thought you did not need to know file types.
User avatar
sliptonic
Posts: 2445
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Gcode file save dlg options

Post by sliptonic »

I don't think the qabstractproxymodel is applicable here.
QT lets you do anything if you're building a dialog from scratch. The standard qfiledialog is, well, standard. Here's the line of code that opens it and the relevant pyside documentation. Feel free to experiment.

https://github.com/FreeCAD/FreeCAD/blob ... st.py#L160

https://srinikom.github.io/pyside-docs/ ... ialog.html
User avatar
freman
Posts: 1590
Joined: Tue Nov 27, 2018 10:30 pm

Re: Gcode file save dlg options

Post by freman »

It seems some config data is stored in :
~/.config/FreeCAD/FreeCAD.conf
eg.

Code: Select all

[Qt5.6]
MainWindowState="@ByteArray.........
)"
Maximized=false
Position=@Point(-1 -14)
Size=@Size(1670 1038)
StatusBar=true
From sniffing around it seems that you need to create an instance of QFileDialog instead of using the static functions getSaveFileName() as is currently done.

Code: Select all

saveDlg = new QFileDialog( );
....
saveDlg->show();
AFAICT this reads and writes default config location on creation and destruction.

That seems to be the minimum effort solution to provide consistency within one instance of FreeCAD without having to manually repeat configuration EVERY time you save a GCODE file.
GeneFC
Posts: 2817
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Gcode file save dlg options

Post by GeneFC »

freman wrote: Sat Aug 28, 2021 12:02 am Probably some have never looked.
Actually I have looked. My output dialog window looks the same for every program I use. Lots of room for the filename, and nothing auto resizes or moves around from one use to the next.

The only thing I have in the Windows registry related to QT is the main window positions for FreeCAD. It looks a lot like the example you posted from your FreeCAD.conf file. Nothing for input dialog windows or output dialog windows.

Gene
User avatar
freman
Posts: 1590
Joined: Tue Nov 27, 2018 10:30 pm

Re: Gcode file save dlg options

Post by freman »

Thanks for the input.

Since the default is DontUseNativeDialogs = false , the dlg you see is a windows dlg not a qt one. Any registry settings affecting this will not be qt settings.

Are you able to configure which columns are seen and how wide they are? Is that persistent from one use to the next ?
Post Reply