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!
User avatar
yorik
Site Admin
Posts: 11552
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Addon Manager improvements

Postby yorik » Tue May 21, 2019 7:21 pm

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
Posts: 4404
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Addon Manager improvements

Postby microelly2 » Tue May 21, 2019 7:26 pm

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

Re: Addon Manager improvements

Postby kisolre » Tue May 21, 2019 7:29 pm

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
Posts: 18784
Joined: Tue Mar 17, 2015 9:14 am

Re: Addon Manager improvements

Postby chrisb » Tue May 21, 2019 7:49 pm

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.
User avatar
Kunda1
Posts: 5759
Joined: Thu Jan 05, 2017 9:03 pm

Re: Addon Manager improvements

Postby Kunda1 » Wed May 22, 2019 2:01 am

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!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
hammax
Posts: 866
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

Re: Addon Manager improvements

Postby hammax » 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'))
Syres
Posts: 364
Joined: Thu Aug 09, 2018 11:14 am

Re: Addon Manager improvements

Postby Syres » Wed May 22, 2019 8:06 am

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
Posts: 2662
Joined: Thu Jul 09, 2015 9:34 am

Re: Addon Manager improvements

Postby easyw-fc » Wed May 22, 2019 8:09 am

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
Site Admin
Posts: 14879
Joined: Thu Feb 19, 2009 10:32 am

Re: Addon Manager improvements

Postby wmayer » Wed May 22, 2019 9:07 am

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
Site Admin
Posts: 11552
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Addon Manager improvements

Postby yorik » Wed May 22, 2019 6:04 pm

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