Workbench specific toolbars custom positioning persistence

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!
triplus
Posts: 8868
Joined: Mon Dec 12, 2011 4:45 pm

Workbench specific toolbars custom positioning persistence

Postby triplus » Fri Feb 03, 2012 1:13 am

I noticed one thing. Workspace specific custom toolbars positions gets lost after restarting FreeCAD.

For example:

-Sketcher toolbar in Sketcher workbench
-Solids, Part tools and Booleans toolbars in Part workbench
-Drawing toolbar in Drawing workbench
-Draft creation tools and Draft modifications tools toolbars in Draft workbench

Could this be fixed in a way that custom positioning of toolbar would persist across restarts of FreeCAD?
wmayer
Site Admin
Posts: 15126
Joined: Thu Feb 19, 2009 10:32 am

Re: Workbench specific toolbars custom positioning persistence

Postby wmayer » Fri Feb 03, 2012 11:14 am

Could this be fixed in a way that custom positioning of toolbar would persist across restarts of FreeCAD?
Usually this works pretty well. However, there might be some cases where it doesn't work but in 99% it works OK.

Here some insights how it works:
Qt's QMainWindow class offers the method saveState() ans restoreState() which saves/loads the layout of the tool bars and dock windows in a byte array. This information then gets stored to the registry on Windows and a text file on Linux. We intentionally do not store this in our user.cfg file because this information is not platform-independent, mainly because of possibly different resolutions of the monitor.
triplus
Posts: 8868
Joined: Mon Dec 12, 2011 4:45 pm

Re: Workbench specific toolbars custom positioning persistence

Postby triplus » Fri Feb 03, 2012 7:22 pm

This information then gets stored to the registry on Windows and a text file on Linux.
Where would i find text file on Linux (Ubuntu). Location of text file.
wmayer
Site Admin
Posts: 15126
Joined: Thu Feb 19, 2009 10:32 am

Re: Workbench specific toolbars custom positioning persistence

Postby wmayer » Sat Feb 04, 2012 11:45 am

It stores the stuff in $HOME/.config/FreeCAD/FreeCAD.conf. For more information checkout Qt's QSettings class and its on-line help. Especially have a look to the chapter "Locations Where Application Settings Are Stored"
triplus
Posts: 8868
Joined: Mon Dec 12, 2011 4:45 pm

Re: Workbench specific toolbars custom positioning persistence

Postby triplus » Sat Feb 04, 2012 5:42 pm

wmayer wrote:It stores the stuff in $HOME/.config/FreeCAD/FreeCAD.conf. For more information checkout Qt's QSettings class and its on-line help. Especially have a look to the chapter "Locations Where Application Settings Are Stored"
Thanks i found it! I did some additional tests and here is the update. I assume the problem is with loading data from this file while switching workbenches or possibly data stored for workbench specific toolbar position does not exist because it exist only for default workbench. Workbench set in Preferences ... and loaded on FreeCAD start up. This workbench toolbar position always persist but all other are lost!