Installable - Add-on Workbench

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
keithsloan52
Posts: 1447
Joined: Mon Feb 27, 2012 5:31 pm

Installable - Add-on Workbench

Postby keithsloan52 » Thu May 28, 2020 8:53 pm

With a new style installable Workbench on Linux the repro gets installed into .FreeCAD/Mod/<Workbench Name>

How is a user supposed to find Sample files etc via the normal FreeCAD facilities?
Syres
Posts: 803
Joined: Thu Aug 09, 2018 11:14 am

Re: Installable - Add-on Workbench

Postby Syres » Fri May 29, 2020 11:08 am

Would it be unrealistic to expect the Wb author to create a command that creates a File>Open dialog pointing to FreeCAD.getUserAppDataDir() /Mod/WbName/Samples for example? The fonts dialog button in Draft>Shapestring taskpanel comes to mind though for different reasons.
keithsloan52
Posts: 1447
Joined: Mon Feb 27, 2012 5:31 pm

Re: Installable - Add-on Workbench

Postby keithsloan52 » Sun May 31, 2020 1:56 pm

Syres wrote:
Fri May 29, 2020 11:08 am
Would it be unrealistic to expect the Wb author to create a command that creates a File>Open dialog pointing to FreeCAD.getUserAppDataDir() /Mod/WbName/Samples for example? The fonts dialog button in Draft>Shapestring taskpanel comes to mind though for different reasons.
But that means an extra icon/command, surely FreeCAD basic File>Open should also offer access to other directories in .FreeCAD/Mod
User avatar
yorik
Site Admin
Posts: 12034
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Installable - Add-on Workbench

Postby yorik » Mon Jun 15, 2020 10:32 am

keithsloan52 wrote:
Sun May 31, 2020 1:56 pm
surely FreeCAD basic File>Open should also offer access to other directories in .FreeCAD/Mod
Not sure how that could/should be done cleanly.
I also think the WB author should solve that themselves. I would go for having an "open example..." menu item, which pops up a Qt File Open dialog in the right folder. Alternatively, you could have your WB perform a check on first run and copy example files to the FreeCAD examples folder, but I'm not sure this is such a good idea to mix things that way... Seems a better idea to keep example files inside the WB folder so they are easier updatable/uninstallable