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
This commit is contained in:
Jelle Spijker 2021-11-01 17:02:07 +01:00
parent 03e1fc34b4
commit 86d5d315bc
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
11 changed files with 307 additions and 136 deletions

View file

@ -13,7 +13,8 @@ from UM.Extension import Extension # We are implementing the main object of an
from UM.Logger import Logger
from UM.PluginRegistry import PluginRegistry # To find out where we are stored (the proper way).
from .PackageList import PackageList # To register this type with QML.
from .RemotePackageList import RemotePackageList # To register this type with QML.
from .LocalPackageList import LocalPackageList # To register this type with QML.
if TYPE_CHECKING:
from PyQt5.QtCore import QObject
@ -31,7 +32,8 @@ class Marketplace(Extension):
super().__init__()
self._window: Optional["QObject"] = None # If the window has been loaded yet, it'll be cached in here.
qmlRegisterType(PackageList, "Marketplace", 1, 0, "PackageList")
qmlRegisterType(RemotePackageList, "Marketplace", 1, 0, "RemotePackageList")
qmlRegisterType(LocalPackageList, "Marketplace", 1, 0, "LocalPackageList")
@pyqtSlot()
def show(self) -> None: