Addon Manager improvements

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!
Locked
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Addon Manager improvements

Post by yorik »

Starting a topic to announce, well, Addon Manager improvements... :D

You can now restart FreeCAD directly from the addons manager, after installing a workbench/module.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Addon Manager improvements

Post by microelly2 »

This trick will speed up developement too. :mrgreen:
kisolre
Veteran
Posts: 4164
Joined: Wed Nov 21, 2018 1:13 pm

Re: Addon Manager improvements

Post by kisolre »

Edit: Shouldn't you include revision number where the feature was introduced to avoid confusion if it is available on existing builds?

I am not sure how those 16808 number are called but shouldn't you include that to avoid "It is not here yet" confusions? Just asking...
Last edited by kisolre on Tue May 21, 2019 8:26 pm, edited 2 times in total.
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Addon Manager improvements

Post by chrisb »

kisolre wrote: Tue May 21, 2019 7:29 pm I am not sure how those 16808 number are called but shouldn't you include that to avoid "It is not here yet" confusions? Just asking...
If it's the number as in 0.19.16808, then it's the revision number.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Addon Manager improvements

Post by Kunda1 »

yorik wrote: Tue May 21, 2019 7:21 pm You can now restart FreeCAD directly from the addons manager, after installing a workbench/module.
YES!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
hammax
Veteran
Posts: 1985
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Addon Manager improvements

Post by hammax »

… I just have downloaded
FC 19.16817_x86 on Win10_32
and it doesn't work at all ?????

Code: Select all

Running the Python command 'Std_AddonMgr' failed:
Traceback (most recent call last):
  File "C:\FC.19\FreeCAD_0.19.16817_x86_LP_11.11_PY2QT4-WinVS2013\Mod\AddonManager\AddonManagerGui.py", line 10, in Activated
    import AddonManager

('invalid syntax', ('C:\\FC.19\\FreeCAD_0.19.16817_x86_LP_11.11_PY2QT4-WinVS2013\\Mod\\AddonManager\\AddonManager.py', 306, 28, '                ret = m.exec()\n'))
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Addon Manager improvements

Post by Syres »

hammax wrote: Wed May 22, 2019 6:03 am … I just have downloaded
FC 19.16817_x86 on Win10_32
and it doesn't work at all ?????

Code: Select all

Running the Python command 'Std_AddonMgr' failed:
Traceback (most recent call last):
  File "C:\FC.19\FreeCAD_0.19.16817_x86_LP_11.11_PY2QT4-WinVS2013\Mod\AddonManager\AddonManagerGui.py", line 10, in Activated
    import AddonManager

('invalid syntax', ('C:\\FC.19\\FreeCAD_0.19.16817_x86_LP_11.11_PY2QT4-WinVS2013\\Mod\\AddonManager\\AddonManager.py', 306, 28, '                ret = m.exec()\n'))
Try changing line 306 in AddonManager.py from:

Code: Select all

                ret = m.exec()
to:

Code: Select all

                ret = m.exec_()
This appears to work on both Py2 and Py3.
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Addon Manager improvements

Post by easyw-fc »

yorik wrote: Tue May 21, 2019 7:21 pm Starting a topic to announce, well, Addon Manager improvements... :D
One risky issue:
If you have started a new design or you have modified one, and then you run the Addon Manager, clicking OK to restart FreeCAD will skip the check to Save your work, before restarting FreeCAD. Any changes will be lost without even a rescue option.
(tested with FreeCAD_0.19.16817_x64_LP_12.1.2_PY3QT5-WinVS2015)
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Addon Manager improvements

Post by wmayer »

FC 19.16817_x86 on Win10_32
and it doesn't work at all ?????
exec is a built-in function in Py3 but seems to be a keyword in Py2. So, using it to show a QDialog works with Py3 but raises a syntax error in Py2. Although Py3 is now the default Python version since v0.19 I think it would still be good to make it working with Py2.
One risky issue:
If you have started a new design or you have modified one, and then you run the Addon Manager, clicking OK to restart FreeCAD will skip the check to Save your work, before restarting FreeCAD. Any changes will be lost without even a rescue option.
(tested with FreeCAD_0.19.16817_x64_LP_12.1.2_PY3QT5-WinVS2015)
It's not only risky wrt data loss but it also makes the application crash. I created a document and added a body feature and after installing a plugin I confirmed to restart FreeCAD. The new instance started but the old instance caused a crash.

So, instead of forcing the event loop to stop (using QApplication.quit()) it's safer to use MainWindow.close().

Code: Select all

if Gui.getMainWindow().close():
    QtCore.QProcess.startDetached(QtGui.QApplication.applicationFilePath(),args)
Internally this calls MainWindow::closeEvent that asks the user to save the document, discard it or just to cancel and if needed cleans-up everything so that FreeCAD can be safely closed. If the operation is cancelled close() returns False and True otherwise.

Another thing:
If you open the Addonmanager then it shows a green check mark for all installed plugins and in parentheses it shows "Installed". But when installing a new one then all check marks suddenly disappear. Furthermore it would be good to give a visual feedback after installing a new plugin, e.g. showing an orange check mark and in parentheses write "Restart" or "Require restart".
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Addon Manager improvements

Post by yorik »

All suggested changes done in git commit 73c1a9c9a!
Thanks for the feedback guys!
Locked