Commit Graph

38 Commits

Author SHA1 Message Date
Chris Hennes
bf7732cbca Addon Manager: Fix macro missing warings 2022-09-20 09:05:05 -05:00
Chris Hennes
e0b181e9b1 Addon Manager: Fix macro other file copy 2022-09-09 13:00:11 -05:00
Chris Hennes
9ab037b581 Addon Manager: pylint cleanup of Macro class 2022-08-28 13:50:09 -05:00
Chris Hennes
4c63094331 Addon Manager: Worker refactor (round 1) 2022-08-09 10:23:26 -05:00
Chris Hennes
119a402c66 Addon Manager: Add other_files download for wiki macros 2022-07-30 21:31:26 -05:00
Chris Hennes
0e40b9956e Addon Manager: Improve bad icon handling 2022-04-09 15:15:13 -05:00
Chris Hennes
49b5e7b0c4 Addon Manager: Fix display of Macro wiki details 2022-03-29 15:47:15 -05:00
Chris Hennes
75d2233ed6 Addon Manager: Add wiki macro icon scraping 2022-02-26 21:06:37 -06:00
Chris Hennes
1a7fcd575e Addon Manager: Auto-create toolbar button
When installing a macro, prompt user to install a toolbar button
automatically. Fills in the details of the button using the macro's
metadata, including an icon if the __icon__ metadata variable points to
a file.

Also:
* Support XPM data for macro icon
* Support online icons
* Fix bug in macro uninstall
* Cleaned up macro code
2022-02-26 21:06:37 -06:00
Chris Hennes
85390bfb6d Addon Manager: Minor fixes and error tweaks
* Correct display of tags in list view
* Add error checking for branch name and url match
* Convert some messages to logs
2022-02-23 18:32:05 -06:00
Chris Hennes
781f0bd626 Addon Manager: Improve macro metadata extraction 2022-02-18 17:10:52 -06:00
Chris Hennes
88f6b2f432 Addon Manager: Translation cleanup
pylupdate does not extract translations when f-strings are used for the
translated text, so all f-strings are migrated to calls to format().
Several other minor translation issues are also addressed.

NOTE: This code has been run through the Black reformatter, which adds
trailing commas in many places that the stock Qt 5.x pylupdate does not
recognize. This code must be processed with the corrected pylupdate to
generate the correct translations.
2022-01-27 23:11:31 -06:00
Chris Hennes
f045a0b6f1 Addon Manager: Improve startup speed 2022-01-26 18:41:14 -06:00
Chris Hennes
2b0a4dc643 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
efa08946f2 Addon Manager: Improve stability when cache update interrupted 2022-01-08 19:47:57 -06:00
Chris Hennes
64cf6a68d8 Addon Manager: Remove unused imports 2022-01-01 09:43:06 -06:00
Chris Hennes
70c9804fc0 Addon Manager: Ensure cache is rebuilt after firstrun dialog 2022-01-01 09:16:32 -06:00
Chris Hennes
b370d3dae4 Addon Manager: Improve wiki page data extraction 2022-01-01 09:16:32 -06:00
Chris Hennes
c746be388f Addon Manager: Improve macro scanning performance 2022-01-01 09:16:32 -06:00
Chris Hennes
4c5b8f368c Addon Manager: Implement simple macro metadata cache 2022-01-01 09:16:32 -06:00
Chris Hennes
ae5391eaf9 Addon Manager: Clean up report window output 2021-12-30 20:06:22 -06:00
Chris Hennes
787b1e0f56 Addon Manager: Black reformatting 2021-12-18 20:29:42 -06:00
Chris Hennes
52da213a3c Addon Manager: Improve cache behavior
Also includes a number of bug fixes.
2021-12-18 20:29:42 -06:00
Chris Hennes
a0992902de 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
768a0f086f 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
72eb41b24f 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
706a014ce9 AddonManager: Fix python imports
Move misplaced imports from addonmanager_macro to addonmanager_workers
2020-10-06 08:21:04 +02:00
Matsievskiy S.V
dde64d4a0a 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
d7d88da291 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
8048f93627 Cleanup in doxygen stuff 2019-07-15 23:20:52 -03:00
Yorik van Havre
3e65306a9f AddonManager: New UI 2019-06-11 17:06:11 -03:00
lorenz
ab1f4c442d 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
17c783051b 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
57726db47f AddonManager: minor bugfix 2018-10-27 16:15:55 -03:00
Gaël Écorchard
968ce141d0 [AddonManager] Fix Python 2 bug with list comprehension 2018-10-25 11:04:43 -03:00
Gaël Écorchard
2506f5b207 [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
37b738f86f [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
bac786a8ea [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