13 Commits

Author SHA1 Message Date
Jelle Spijker
11b3b08198
Implemented code review suggestions
Contributes to CURA-8558
2021-11-04 08:23:46 +01:00
Jelle Spijker
e01e47b8fa
Performance increase for obtaining LocalPackages
The speed increase on the function when running Yappi
`LocalPackageList.updatePackages`
| original | now  |
|----------|------|
|  14 ms   | 4 ms |

Contributes to CURA-8558
2021-11-04 08:23:46 +01:00
Jelle Spijker
3a94fc0ced
Apply suggestions from code review
Applied code review comments

Co-authored-by: Jaime van Kessel <nallath@gmail.com>
2021-11-03 17:58:16 +01:00
Jelle Spijker
e7aecb6c06
Fixed mypy typing failure
@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
2021-11-03 16:29:35 +01:00
j.spijker@ultimaker.com
f9f43b79b0
Don't pollute the package_info with section_title
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
2021-11-03 15:15:46 +01:00
j.spijker@ultimaker.com
edc71f12a3
Updated documentation and typing
Contributes to CURA-8558
2021-11-03 15:15:46 +01:00
j.spijker@ultimaker.com
0218703592
To be installed packages are still listed for the current session
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
2021-11-03 15:15:45 +01:00
j.spijker@ultimaker.com
080e3b9f27
To be removed packages are still listed for the current session
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
2021-11-03 15:15:45 +01:00
j.spijker@ultimaker.com
8fad2e0f39
Changed section header for Installed Plugins
As agreed with UX changed: `Installed Cura Plugins` to `Installed Plugins`

Contributes to CURA-8558
2021-11-03 15:15:45 +01:00
j.spijker@ultimaker.com
1b7b0b9caf
Sort the different sections and packages
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
2021-11-02 16:21:27 +01:00
j.spijker@ultimaker.com
3f700e5d0c
Only show Footer when the packagelist is paginated
It doesn't make sense to show a footer when items are retrieved in one
go. Except when an error occurs.

Contributes to CURA-8558
2021-11-02 14:34:36 +01:00
j.spijker@ultimaker.com
c4c99f6657
Added sections to the packagelists
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
2021-11-02 14:34:35 +01:00
Jelle Spijker
86d5d315bc
Differentiate between local and remote packages
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
2021-11-01 17:12:18 +01:00