Addon Manager Redesign 2021

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: Addon Manager Redesign 2021

Post by balrobs »

I'm confident you will. I have seen here many times how you have used your skills to improve FreeCAD for the best.
Thank you so much for that.
balrobs
User avatar
chennes
Veteran
Posts: 3905
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Redesign 2021

Post by chennes »

I've pushed some changes to PR 5458 -- the most noticeable is a new "loading" screen that I think looks better than the re-rendering web page. I also fixed the display of README data for non-GitHub sites (for example, the CFDOF workbench, which is actually hosted at Gitlab).
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5512
Joined: Thu Apr 05, 2018 1:53 am

Re: Addon Manager Redesign 2021

Post by TheMarkster »

The issue of not being able to fetch macros from the wiki has re-emerged. Changing to client auth fixes it. Could this be a setting in preferences? Then, if the problem happens the warning message can include instructions to change the setting or offer to change it for the user.
User avatar
chennes
Veteran
Posts: 3905
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Redesign 2021

Post by chennes »

What version?! That should have been permanently fixed by a recent backend change I made to the networking.

ETA: This should have been resolved as of git commit 97cc2cf16.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5512
Joined: Thu Apr 05, 2018 1:53 am

Re: Addon Manager Redesign 2021

Post by TheMarkster »

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27129 (Git)
Build type: Release
Branch: master
Hash: fcaa698be874323ae26b20d7adf92214989c2d38
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
User avatar
chennes
Veteran
Posts: 3905
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Redesign 2021

Post by chennes »

TheMarkster wrote: Mon Jan 31, 2022 1:42 am Version: 0.20.27129 (Git)
Where's the "phew!" emoticon... I think that build predates the fix. I think I have a more permanent solution to this problem, that won't break under Python 3.10 (which was the problem with the old solution). Let me know if the problem reappears after your next update and I'll go back to panicking then.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3905
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Redesign 2021

Post by chennes »

I've started in on the feature to automatically add a button for an installed macro to your custom toolbars, and I have some questions for those of you who were interested in this feature.

1) My thinking is that the best user interface is one that asks the fewest questions, and automates the most. So my basic idea is that the first time you install a macro, you get a dialog that asks if you want to install a toolbar button, and that dialog's options are "yes", "no", "always", and "never". Do those make sense to you? The idea being that if you choose either always or never, you won't get asked again (but can change your option in the preferences window).

2) Not all macros have icons: right now the default is for macros without icons to display the macro name as the button. I am not a huge fan. What do you think about either prompting the user to select a button from a list (maybe using Font Awesome?) or even going to GitHub user avatar route and programmatically generating a generic icon? Or asking for a single letter to use as the icon (random-color background so you can learn which B is Bolts and which is BIM, etc.)? I don't really like any of the options here.

3) Should I prompt for which toolbar you want to install into? Or try to guess based on what toolbars are installed? If there isn't a toolbar yet, should I prompt you to create one, or just do it "behind the scenes"?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5512
Joined: Thu Apr 05, 2018 1:53 am

Re: Addon Manager Redesign 2021

Post by TheMarkster »

It would be great if the macro can provide the icon in its own code as an xpm string. It could do this by defining getIcon() which returns the xpm string or as a defined variable, such as __icon__, or another option embedded as a comment in the source code similar to the

Code: Select all

# -*- coding: utf-8 -*-
line in so many files. This way it could be parsed directly from the source.

Maybe something like:

Code: Select all

##XPM_START
""" string literal containing xpm code
on multiple
lines """
##XPM_END
Then the user doesn't need to fuss with downloading icons and putting them into a certain folder. Would benefit macros distributed on the wiki, too, because there it is more difficult to have multiple files for the macro.

I like the getIcon() format because I already use that for making the tree icon for a number of feature python macros.

In the case where the icon is not provided the name of the macro could be used. Building the icon like github does is an interesting idea. It would need to be based on the macro name, I guess, so everybody gets the same icon for that macro, not something randomly generated. Another benefit is if it is uninstalled and reinstalled the user gets the same familiar icon again.

Yes, no, never, always, seems like a good idea when asking if the user wants to install to a toolbar. Might not really need always, just yes, no, and never, with yes and no always implying to ask again next time.

It should be possible to determine whether there are any custom toolbars by examining user parameters. Any that exist could be offered to be used in a list to select from, with the option to create a new toolbar. I think it should ask each time to select the toolbar to use or to create a new one. To paraphrase Ronald Reagan, Guess, but verify.

Toolbars can appear in all workbenches (global) or only in a certain workbench, so that should be an option, too. I have 2 toolbars, one appears globally in all workbenches, the other only in part workbench.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Addon Manager Redesign 2021

Post by GeneFC »

I have been seeing problems with the new addon manager, and it is even worse today. Brand new compile as of late on February 1. FreeCAD totally locks up. I get the following repetitive error messages every few seconds.

Addon manager error.jpg
Addon manager error.jpg (85.58 KiB) Viewed 1867 times

I needed to use a screen shot because the FreeCAD window is totally dead. No resize, no close, no select and copy, etc. I can only close by killing in Task Manager.

Until this latest compile the errors were just annoying. For example, the Addon window would show for a couple of seconds and then hide behind the main window. I needed to reselect on the Windows taskbar to get it back to the foreground. It would only stay for a short time and then hide again.

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27371 (Git)
Build type: Release
Branch: Master
Hash: cfdf334b7f45b6ac0d6432890b1a9c5792ddaaa5
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)

Gene
User avatar
chennes
Veteran
Posts: 3905
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Redesign 2021

Post by chennes »

Thanks for the report, GeneFC -- I still have no idea what's going on with your window losing focus, but at least this particular bug I know exactly what's causing it. I'll push a fix shortly.

ETA:
git commit 95744bab89aaef8809217c5e3807a71875c7c30f
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply