Commit Graph

103 Commits

Author SHA1 Message Date
Campbell Barton
c0f39e7b40 Extensions: correct 3D coat mapping 2024-06-07 21:44:14 +10:00
Campbell Barton
059dc93cde Extensions: support refreshing local repositories when offline
Since [0] there was no way to refresh local repositories,
with the poll messages suggesting to restart Blender to see updates
which isn't practical for developers.

The ability to refresh was prevented when "Online Access" was disabled,
meaning a developer couldn't easily develop their own add-ons unless
they were online.

[0]: 651621da0d
2024-06-07 17:36:59 +10:00
Campbell Barton
3dd8c826b5 Extensions: correct the descriptions for active repository actions 2024-06-07 16:52:51 +10:00
Campbell Barton
dc0e559cbb Extensions: remove intermediate operators for upgrade and sync
The buttons to upgrade or sync extensions called extension
operators via bpy.app.handlers, requiring awkward glue-code
which didn't show error reports in to the user.

Remove these operators and call the upgrade & sync operators directly.
2024-06-07 16:33:03 +10:00
Campbell Barton
9c60fe88fa Cleanup: de-duplicate check/update poll function 2024-06-07 15:11:54 +10:00
Campbell Barton
239f032186 Fix #122857: error validating older permissions list 2024-06-07 12:49:16 +10:00
Campbell Barton
98bb157ad9 License headers: add SPDX header
Also include "addons_core" in license check.
2024-06-07 12:09:58 +10:00
Campbell Barton
fa5f2354f7 Extensions: adjust add-ons shown in missing built-in extensions
Based on feedback in !122727, include previously built-in add-ons
in the built-in extensions panel even if there is no support for
adding it back via the extensions repository.
2024-06-06 18:19:54 +10:00
Campbell Barton
8cb94adbef Extensions: support updated permissions table in the manifest
- Update the example manifest.
- Validate the values are short, single line strings.
2024-06-06 17:42:20 +10:00
Campbell Barton
d5850809cd Cleanup: update Makefile to quite mypy errors, remove redundant check 2024-06-06 17:40:24 +10:00
Campbell Barton
fc0a538168 Extensions: translate each permission individually
Without translating terms individually, the translation lookup table
would have had to included every permutation of permissions.
2024-06-06 16:42:22 +10:00
Campbell Barton
2533ff39f9 Extensions: support replacing missing legacy add-ons with extensions
This groups all the add-ons from 4.1 which were enabled but are no
longer distributed with Blender and provides an easy way for users to
install them. This panel is collapsed by default.

Ref !122727

Co-authored-by: Dalai Felinto <dalai@blender.org>
2024-06-06 14:41:20 +10:00
Campbell Barton
809be0c8e0 Extensions: disable translation for labels such as URL & repo name 2024-06-06 10:20:13 +10:00
Campbell Barton
e60887c642 Cleanup: address mypy warnings 2024-06-06 10:07:13 +10:00
Campbell Barton
b56ddb6c90 Fix error building an extension without any paths defined
When the [build] table was defined without any paths, duplicate files
could be added to the zipfile.
2024-06-06 10:05:37 +10:00
Campbell Barton
613f00d5ff Fix variable use before assignment in extensions timer
Also remove unused global.
2024-06-06 09:55:13 +10:00
Campbell Barton
83a2693818 Fix error with debugging operator to lock/unlock extension repos 2024-06-06 09:55:13 +10:00
Pablo Vazquez
7b601464c3 UI: Add new TAG icon
Introduce a new icon: `TAG`. A generic tag/label, to be used anywhere
there are tags.

Details and images in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/122738
2024-06-05 17:56:51 +02:00
Campbell Barton
7c143367d7 Extensions: use deflate compression for ZIP files
Replace LZMA with ZLIB compression as default tools on Linux & Windows
can't decompress these ZIP files and some users wish to open and inspect
the extensions.

While LZMA has the potential for significantly better compression it
turns out the actual gains were marginal for extensions that contain
many Python files (compared with `tar.lzma`) because each file is
compressed individually, see #122710.
2024-06-05 17:18:42 +10:00
Campbell Barton
8719057b4a Cleanup: unused arguments and warnings raised by pylint 2024-06-05 16:21:20 +10:00
Campbell Barton
17ec64770c Extensions: ensure paths are always included for the "build" command
Scanning the file-system for paths to include didn't detect cases when
explicitly included paths (such as wheels) were missing.

Change the logic to build a list of paths which is merged with pattern
matched paths (de-duplicating), then add all files into the ZIP.
Any missing paths will raise an error.
2024-06-05 15:50:14 +10:00
Campbell Barton
6c1b908d46 Extensions: correct type checks for permissions 2024-06-05 14:41:20 +10:00
Pablo Vazquez
fac32e9647 Cleanup: make format
Missed in my previous commit e2458001e4
2024-06-04 19:15:14 +02:00
Dalai Felinto
ffa363355d Extensions: "permissions" Expect a dictionary instead of a list
We don't do anything with the content of the dictionary yet (the reason
why each permission is required. But Blender can talk again with the
extensions server.

This still requires changes on the validation and build and
server_generate commands. To be tackled separately.
2024-06-04 19:08:17 +02:00
Pablo Vazquez
e2458001e4 UI: Extensions: Layout tweaks to list items
Light redesign of the extension/add-on list item.

The last time this layout was updated was in Blender 2.5, when text was
usually left-aligned, and add-ons preferences weren't streamlined yet.

The goal is to keep a familiar look, while making some improvements to
organization such as group actions (install/uninstall, buttons to external sources
like website, documentation, report a bug).

Detail images available in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/122726
2024-06-04 19:07:56 +02:00
Dalai Felinto
98dd62ebda UI: Extensions: Missing Script Files tweaks
* Move missing script files inside a panel.
* Call it Missing Add-ons.
* Add an explicit "X" to dismiss (instead of the checkbox).

Note: The panel is collapsed by default.

Co-authored by Pablo Vazquez.

Pull Request: https://projects.blender.org/blender/blender/pulls/122721
2024-06-04 18:16:34 +02:00
Pablo Vazquez
ae26d0468b UI: Extensions: Use icon for check notification
This message replaces labels that contain icons, since this message
didn't have an icon the UI looks like it flickers since the text
shifts position.
2024-06-04 18:05:42 +02:00
Dalai Felinto
c67bf1be9c UI: Extensions: "Online Extensions" panel tweaks
* Make the text smaller.
* Stash the entire panel content inside a box.

Co-authored by: Pablo Vazquez

Pull Request: https://projects.blender.org/blender/blender/pulls/122715
2024-06-04 18:04:54 +02:00
Dalai Felinto
67c292f26b Extensions: update Show Legacy Add-ons tooltip
The old tooltip was wrong. But it was also not very informative on to
what is a legacy add-on.
2024-06-04 15:02:11 +02:00
Dalai Felinto
a4aa5faa20 UI: Extensions: stash Dismiss/Allow Online Access buttons inside the panel
This includes a small cleanup:
* Remove dead code.
* Rename context to _context since it is not being used.
2024-06-04 09:49:36 +02:00
Campbell Barton
595ac21d85 Cleanup: remove now unused logic for refreshing the splash screen 2024-06-04 10:49:11 +10:00
Campbell Barton
a26031ed9b Fix #122652: Clicking offline status icon enabled online access
Oversight in [0] made clicking on the status bar icon enable online
access instead of opening the preferences.

[0]: c9a99c7eeb
2024-06-03 23:49:07 +10:00
Campbell Barton
916268bed9 Fix #122645: Extensions tag popover empty until checking for updates 2024-06-03 21:02:33 +10:00
Campbell Barton
1839ec7d9c Extensions: support showing files included in the build sub-command
Add a verbose argument to list all files included in a package,
useful when checking paths are properly included.
2024-06-03 21:02:32 +10:00
Campbell Barton
4a117f3116 Extensions: add popover to filter by tags
Since the categories from add-ons are no longer shown all extensions
are shown together. Support filtering by tags as an alternative.
2024-06-02 23:25:49 +10:00
Campbell Barton
5e462135f3 Extensions: avoid redundant conversion the new manifest to bl_info
Converting the manifest TOML to the bl_info ran before checking
if the add-on was legacy.
2024-06-02 23:00:11 +10:00
Campbell Barton
f1bf9d366c Extensions: support canceling asynchronous operations
Pressing escape now passes `canceled` the finished action
(not currently used).
2024-06-02 21:49:44 +10:00
Dalai Felinto
c9a99c7eeb Extensions: revised welcome message + behavior
Make it possible allow online access directly from the welcome screen.

Ref !122511
2024-06-01 23:17:11 +10:00
Campbell Barton
42c4678707 Cleanup: quiet warnings from mypy & ruff 2024-06-01 22:54:52 +10:00
Brecht Van Lommel
d568abea62 Extensions: Install From Disk operator handling both legacy and new
When a user has downloaded an add-on as a zip file, it's not clear in
advance if this is a legacy add-on or a new extension. So they would
have to use trial and error, or inspect the zip file contents.

This uses a simple heuristic to check if the file is a legacy add-on,
and if so automatically calls the legacy operator instead.

The operator now show both extension and legacy add-on properties,
with the latter in a default collapsed subpanel.

Pull Request: https://projects.blender.org/blender/blender/pulls/121926
2024-05-31 16:22:08 +02:00
Campbell Barton
a21f75d04d Extensions: improve checks for packages to upgrade
- All remote repositories are included in the check for outdated
  packages, the check-for-updates setting is only used to sync with
  the remote before checking for outdated packages.
- Defer checking for repositories to notify until after Blender
  has opened since checking for installed packages & outdated
  repositories could add some noticeable overhead.
2024-05-31 23:26:28 +10:00
Campbell Barton
8bd3be2160 Extensions: show extension updates in the status bar
Move extension update display from the splash screen to the status bar.
Based on !122413 with minor changes & removal of splash text.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
2024-05-31 21:37:37 +10:00
Dalai Felinto
711b722ec1 Extensions: Fix missing operator
This was probably borked during one of the recent renames.
To reproduce the original issue:

* Go to Preferences > Extensions
* Check the console:

rna_uiItemO: unknown operator 'extensions.show_online_prefs'
4.2/scripts/addons_core/bl_pkg/bl_extension_ui.py:354
2024-05-31 13:06:29 +02:00
Campbell Barton
43a47f39f9 UI: always show text on the splash when running in offline mode
see #119521
2024-05-31 18:47:15 +10:00
Campbell Barton
eb59a7f574 Cleanup: correct incorrect internal naming of URL params/query
The "query" component of the URL was misnamed "params".
2024-05-31 11:17:58 +10:00
Campbell Barton
d3850b329c Fix dropping extension URL's failing to match local URL's
Dropping an extensions into Blender would was not finding the meta-data
because the recently added parameter caused the URL lookup to fail.
2024-05-31 11:00:20 +10:00
Campbell Barton
24abd35d14 Extensions: use "extensions" category for operator
Replace use of "bl_pkg" operator category with "extensions",
this naming was used while the functionality was experimental,
not intended to be used once extensions was moved out of experimental.
2024-05-31 10:32:01 +10:00
Campbell Barton
29f1c96657 Extensions: detect dropping URL's from disabled repositories
Report an error when dropping a URL into a repository which has been
disabled.
2024-05-30 23:22:12 +10:00
Campbell Barton
b19d4d7df6 Extensions: suppress connection errors in console for automatic checks
Being offline shouldn't be considered an error which checking for
updates on startup, so connectivity issues are suppressed unless
running in debug mode.

Ref !122463
2024-05-30 23:22:09 +10:00
Campbell Barton
a8a976e09b Extensions: separate URL drop message when offline mode is forced 2024-05-30 17:35:55 +10:00