Cura/plugins/Marketplace/LicenseModel.py
casper 28b21628b4 Remove unused package_name property and add package_id in license model
The `_to_be_installed_package_id` and `_to_be_installed_package_path`
can now be removed from the class as they can requested from the model
itself. This we make sure that the we alway install the package for
which the license was recently accepted.

cura 8587
2021-12-06 18:07:44 +01:00

31 lines
921 B
Python

from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
# Model for the LicenseDialog
class LicenseModel(QObject):
packageIdChanged = pyqtSignal()
licenseTextChanged = pyqtSignal()
def __init__(self) -> None:
super().__init__()
self._license_text = ""
self._package_id = ""
@pyqtProperty(str, notify=packageIdChanged)
def packageId(self) -> str:
return self._package_id
def setPackageId(self, name: str) -> None:
self._package_id = name
self.packageIdChanged.emit()
@pyqtProperty(str, notify=licenseTextChanged)
def licenseText(self) -> str:
return self._license_text
def setLicenseText(self, license_text: str) -> None:
if self._license_text != license_text:
self._license_text = license_text
self.licenseTextChanged.emit()