Commit Graph

25 Commits

Author SHA1 Message Date
Chris Hennes
e9d6a2c4a4 Addon Manager: Create NetworkManager class
To enable single-login authenticated proxy use, and simplified multi-threaded
network accesses, this commit adds a new wrapper around a QNetworkAccessManager
and includes a global instantiation of the class intended to exist for the
lifetime of the program. This instance can be used to enqueue any number of
network requests, which the manager will send out to the networking subsystem
in an appropriate manner.
2022-01-25 13:30:58 -06:00
Chris Hennes
13a626d228 Addon Manager: Improve stability when cache update interrupted 2022-01-08 19:47:57 -06:00
Chris Hennes
6f1c2627b2 Addon Manager: Remove unused imports 2022-01-01 09:43:06 -06:00
Chris Hennes
a5e89982f4 Addon Manager: Ensure cache is rebuilt after firstrun dialog 2022-01-01 09:16:32 -06:00
Chris Hennes
382eabbb62 Addon Manager: Improve wiki page data extraction 2022-01-01 09:16:32 -06:00
Chris Hennes
7d3c6b0cce Addon Manager: Improve macro scanning performance 2022-01-01 09:16:32 -06:00
Chris Hennes
e450e50bb2 Addon Manager: Implement simple macro metadata cache 2022-01-01 09:16:32 -06:00
Chris Hennes
20a74ce423 Addon Manager: Clean up report window output 2021-12-30 20:06:22 -06:00
Chris Hennes
3cc2d402cf Addon Manager: Black reformatting 2021-12-18 20:29:42 -06:00
Chris Hennes
f785436cff Addon Manager: Improve cache behavior
Also includes a number of bug fixes.
2021-12-18 20:29:42 -06:00
Chris Hennes
e42eec2558 Addon Manager: Begin UI redesign
Migrate to a UI that looks more like other software package managers, giving
more space to each addon by hiding the list when an addon is selected, and
providing a "back" button to get back.

Implements a two-style view option for the list of addons: expanded and
condensed, via a delegate that provides the drawing function for each row in
the table based on two different widget designs.
2021-12-18 20:29:42 -06:00
Chris Hennes
a225695dd8 Addon Manager: Rework backend to use package.xml
This shifts to use the model-view-controller pattern for the list of addons,
and moves to using a full model class rather than an indexed array for the
data storage and management. This enables much more information to be stored
as part of the new AddonManagerRepo data type. It now wraps the Macro class
for macros, supports Preference Packs, and provides access to the Metadata
object.
2021-12-18 20:29:42 -06:00
jreinhardt
b56b9b4cbd Fix macro code processing
I believe this code is currently incorrect, as it makes references to code outside the "if code" block, where it can not be ensured that code is a string. Moving the code processing into this block avoids this issue.

I experienced a stuck Addon Manager, which was caused by an exception

```
  File "/usr/share/freecad/Mod/AddonManager/addonmanager_macro.py", line ..., in fill_details_from_wiki
    FreeCAD.Console.PrintWarning(translate("AddonsInstaller", "Unable to clean macro code: ") + code + '\n')
TypeError: can only concatenate str (not "list") to str
```
which is fixed by these changes.

OS: Ubuntu 20.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4.
Build type: Release
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
2020-10-20 19:01:12 +02:00
Matsievskiy S.V
f544688137 AddonManager: Fix python imports
Move misplaced imports from addonmanager_macro to addonmanager_workers
2020-10-06 08:21:04 +02:00
Matsievskiy S.V
ba69518c36 AddonManager: update python source formatting
Update formatting in compliance with pep8 with the following exceptions:

 * truncate to 120 characters in line

 * prefer double quotes `"` to single quotes `'` in strings
2020-10-01 09:53:34 +02:00
Zackles
33206bb6fc Add Proxy to Addon Manager with UI
Correct crash when Macro description is not reachable

Python crashed when under proxy - Macro list is charged - Proxy is undone ( internet connection lost) - Try to load macro description (u=None)

Add Proxy setting in Addon Manager Option UI

Correction of SSL context

Replace ssl.Purpose.CLIENT_AUTH by ssl.Purpose.SERVER_AUTH as context for a client

Add configuration of proxy setting UI

Add proxy management by urllib
2020-01-10 10:01:56 +01:00
Yorik van Havre
a6334a4bfd Cleanup in doxygen stuff 2019-07-15 23:20:52 -03:00
Yorik van Havre
ab68749909 AddonManager: New UI 2019-06-11 17:06:11 -03:00
lorenz
f875775fdb py3: AddonManager-macro: use unicode
proposal from here: https://forum.freecadweb.org/viewtopic.php?f=3&t=33172&start=10#p278156
2019-01-05 14:50:25 +01:00
wmayer
54561c5b6e extend FreeCAD.getUserMacroDir to accept boolean to either return actual or default macro directory 2018-10-28 17:10:10 +01:00
Yorik van Havre
cab232a97f AddonManager: minor bugfix 2018-10-27 16:15:55 -03:00
Gaël Écorchard
c574b72f7d [AddonManager] Fix Python 2 bug with list comprehension 2018-10-25 11:04:43 -03:00
Gaël Écorchard
1052ea6469 [AddonManager] Strip whitespace from other_files
Strip whitespace from the file name in the macro metadata __Files__
field.
2018-10-25 11:04:43 -03:00
Gaël Écorchard
d5e150841d [AddonManager] Add support for __Files__
Read the metadata __Files__ for macros from git and install or remove
files listed there.
__Files__ must be a comma-separated list of files to be copied alongside
the macro.  Their path must be relative to the macro (*.FCMacro file)
and not to othe root of the repository. Each file can be prefixed with a
subdirectory.
2018-10-25 11:04:43 -03:00
Gaël Écorchard
58b5749163 [AddonManager] separate the Macro class
Separate the Macro class of the AddonManager into addonmanager_macro.py
to prepare for future support for dependent files for macros from the
git repository.
2018-10-25 11:04:43 -03:00