Enable Start Page Icon folder housekeeping and specify Temp base folder location

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Syres
Veteran
Posts: 2898
Joined: Thu Aug 09, 2018 11:14 am

Enable Start Page Icon folder housekeeping and specify Temp base folder location

Post by Syres »

Disclaimer: I'm sure this is going to be controversial and if it's rejected then that's fine, I'll have it just for personal use.


One thing that's been niggling me since the new Start Page was implemented was the constant number of icon files being written to my SSD drive when I use a HDD for pagefile and regularly changing files. It's not a space issue, more that I like to have a fairly static set of files and folders on the SSD. Also there is no housekeeping of these icon folders so the user ends up with a raft of folders in their Temp area and usually not aware that they are even there. At present I have no intention of making this too easy to access until the devs are happy to do so and maybe only a very select few care about it.

As this is a destructive change only to be used by Tech aware users and I've only got access to Windows boxes, I was wondering if a Linux and a Mac user would be willing to try it before I submit a PR.

Procedure to implement both changes requires the following steps:

1) Start FreeCAD
2) Tools > Edit Parameters
3) Navigate to BaseApp\Preferences\Mod\Start
4) Right click in the righthand pane and select New Boolean Item
5) Give it a name of UseCustomTempIconDir and click OK
6) set to false and click OK
7) Right click in the righthand pane and select New String Item
8) Give it a name of CustomTempIconDir and click OK
9) Enter the folder to be the base for the temporary icon storage e.g,. E:/Data/FreeCAD/TmpIcons
10) Close Parameter Editor
11) To be certain where you're current Temp folder is, enter the following in the Python Console:

Code: Select all

import tempfile
tempfile.tempdir
12) Create the new folder specified in step 9 (at first it's wise to only test the housekeeping method on the original temp folder hence leaving the Boolean set to false)
13) Obviously you need to have Edit > Preferences > General > Start Up > Autoload Module after start up set to Start and ensure icons are being displayed correctly before continuing.
14) Close FreeCAD
15) Backup src\Mod\Start\Startpage\Startpage.py and src\bin\Lib\tempfile.py existing files
16) Replace with the corresponding files attached
17) Navigate to the current temp folder in order to observe the quantity of subfolders starting with FreeCADStartThumbnails
18) Start FreeCAD, click on Create New.. (there should now only be one subfolder starting with FreeCADStartThumbnails)
Please only proceed if the housekeeping has been successful.
19) Tools > Edit Parameters
20) Navigate to BaseApp\Preferences\Mod\Start
21) Double-click the UseCustomTempIconDir boolean and change from false to true
22) Close Parameter Editor
23) Close FreeCAD
24) Start FreeCAD and click on Create New.. and Close FreeCAD twice to not only ensure the icons are being generated in the correct location but also the housekeeping has been activated in that location also.

Any issues please capture in the Report View and revert to the original files backed up in step 15.

Tested using:

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16267 (Git)
Build type: Release
Branch: master
Hash: ddb335cfe057336f1958d68126bb0471328d735c
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
Attachments
tempfile.py
(26.48 KiB) Downloaded 36 times
StartPage.py
(22.33 KiB) Downloaded 37 times
Post Reply