mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Fix downloadPresenter and initial LicensePresenter.py code
CURA-6983
This commit is contained in:
parent
028aece644
commit
dda3d0b4eb
5 changed files with 196 additions and 43 deletions
30
plugins/Toolbox/src/CloudSync/LicenseModel.py
Normal file
30
plugins/Toolbox/src/CloudSync/LicenseModel.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue