Fix downloadPresenter and initial LicensePresenter.py code

CURA-6983
This commit is contained in:
Nino van Hooff 2020-01-09 16:56:53 +01:00
parent 028aece644
commit dda3d0b4eb
5 changed files with 196 additions and 43 deletions

View file

@ -0,0 +1,30 @@
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
# Model for the ToolboxLicenseDialog
class LicenseModel(QObject):
titleChanged = pyqtSignal()
licenseTextChanged = pyqtSignal()
def __init__(self, title: str = "", license_text: str = ""):
super().__init__()
self._title = title
self._license_text = license_text
@pyqtProperty(str, notify=titleChanged)
def title(self) -> str:
return self._title
def setTitle(self, title: str) -> None:
if self._title != title:
self._title = title
self.titleChanged.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()