Bug in Start workspace

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
heewa
Posts: 5
Joined: Mon May 10, 2021 5:30 pm
Location: New York, USA

Bug in Start workspace

Post by heewa »

I've experienced a bug in the Start workspace, where if you have a "custom folder" (labeled "show additional folder" in the Start screen of preferences), the python code for the module throws an exception, doesn't load, and shows an empty white screen instead.

I actually already have a fix ready to go (simply check for existence of dir before using it), but I'm following the instructions to first make a forum post. Also, I should introduce myself: hi, I'm Heewa!

Quick questions:
  • Is my fix of just checking for the existence of a dir the correct approach? I tested it out (modified workspace module only, using pkg installed FreeCAD), and it seems to work just fine.
  • In the case that a dir doesn't exist, I used what I saw some other official workspaces doing (FreeCAD.Console.PrintWarning), which causes a warning to show in the report view. Is this the right way to handle letting the user know?
  • Do I wait for a go-ahead from someone here before putting up my Pull Request, or do I go ahead right after creating this post?
Thanks!
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug in Start workspace

Post by chrisb »

Hi Heewa, welcome in the forum and thanks for introducing yourself with an improvement of FreeCAD!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug in Start workspace

Post by openBrain »

heewa wrote: Mon May 10, 2021 5:59 pm [*] Is my fix of just checking for the existence of a dir the correct approach? I tested it out (modified workspace module only, using pkg installed FreeCAD), and it seems to work just fine

The simplest fix is generally the best.

[*] In the case that a dir doesn't exist, I used what I saw some other official workspaces doing (FreeCAD.Console.PrintWarning), which causes a warning to show in the report view. Is this the right way to handle letting the user know?

That's fine

[*] Do I wait for a go-ahead from someone here before putting up my Pull Request, or do I go ahead right after creating this post?
You can set a PR on Github directly. It will eventually be reviewed and merged.
Post Reply