Long API calls might return after the Local or Remote
PackageList has been deconstructed. Somehow setting
the ownership in QML doesn't seem to work for this.
So we guard against this with a try catch block.
Contributes to: CURA-8587
The server is queried using the local packages_id and version to
determine if they can be updated. The Manage button state is set
accordingly. This is done in an async way to keep the UI responsive
A.t.m I'm not sure if I might need to move this logic out, since
we also need to make this query when check periodically for updates.
when the list is not shown. But that would also entail creating
the installed packages list before the Manage Packages tab is ever
created in the Marketplace.
Contributes to: CURA-8587
The speed increase on the function when running Yappi
`LocalPackageList.updatePackages`
| original | now |
|----------|------|
| 14 ms | 4 ms |
Contributes to CURA-8558
@ghostkeeper being nerd snipped
It's giving that typing failure because the section variable is re-used.
First as elements from self._getSections (strs) and then as elements
from sorted_sections.values() (List[PackageModel]s). Python has no
variable scopes within functions so the variable still exists after the
first for loop.
Contributes to CURA-8558
The previous implementation added a section_title to the package_info
which was also stored in the packages.json. The section_title is now
provided to the PackageModel as an extra optional argument.
Contributes to CURA-8558
A user might still need to interact with a **to be installed** package.
But the current package list doesn't list that package anymore.
Introduced a `getPackagesToInstall()` method in the Uranium PackageManager
to circumvent this issue.
Contributes to CURA-8558
A user might still need to interact with a **to be removed** package and
it is also still being used in the current Cura session. But the current
package list doesn't list that package anymore.
Introduced a `getPackagesToRemove()` method in the Uranium PackageManager
to circumvent this issue.
Contributes to CURA-8558
The order in which UX defined the different sections are:
- Installed Cura Plugins
- Installed Materials
- Bundled Plugins
- Bundled Materials
All packages need to be order at least by section, but I also took
the liberty to sort the packages in these sections by Alphabet.
Contributes to CURA-8558
By providing a `section_title` with a string to the `package_data`
packages can be subdivided in sections, each with its own header.
For remote packages this will be `None` and therefore no sections are
created there.
Contributes to CURA-8558
There is a distinction between packages which are already
installed on the local machine and packages which are
available on the remote server. Even with this difference
it is important that they are handled the same and can be
reused in the same GUI elements.
In order to reduce code duplication I created a parent object
PackageList which contains the base logic and interface for
the QML and let both RemotePackageList and LocalPackageList
inherit from this.
UX specified that the gear icon (Settings.svg) should be
separate from the tabs of material and plugins. This also
ment that the current tab item couldn't set the pageTitle
anymore. This is now defined in the Package component and
set when the loader has loaded the external QML file.
Contributes to CURA-8558