diff --git a/plugins/Marketplace/LicenseModel.py b/plugins/Marketplace/LicenseModel.py index 1bedb02cad..64625185d7 100644 --- a/plugins/Marketplace/LicenseModel.py +++ b/plugins/Marketplace/LicenseModel.py @@ -5,32 +5,15 @@ catalog = i18nCatalog("cura") # Model for the LicenseDialog class LicenseModel(QObject): - DEFAULT_DECLINE_BUTTON_TEXT = catalog.i18nc("@button", "Decline") - ACCEPT_BUTTON_TEXT = catalog.i18nc("@button", "Agree") dialogTitleChanged = pyqtSignal() packageNameChanged = pyqtSignal() licenseTextChanged = pyqtSignal() - def __init__(self, decline_button_text: str = DEFAULT_DECLINE_BUTTON_TEXT) -> None: + def __init__(self, licence_text: str, package_name: str) -> None: super().__init__() - - self._dialogTitle = "" self._license_text = "" self._package_name = "" - self._decline_button_text = decline_button_text - - @pyqtProperty(str, constant = True) - def acceptButtonText(self): - return self.ACCEPT_BUTTON_TEXT - - @pyqtProperty(str, constant = True) - def declineButtonText(self): - return self._decline_button_text - - @pyqtProperty(str, notify=dialogTitleChanged) - def dialogTitle(self) -> str: - return self._dialogTitle @pyqtProperty(str, notify=packageNameChanged) def packageName(self) -> str: @@ -48,7 +31,3 @@ class LicenseModel(QObject): if self._license_text != license_text: self._license_text = license_text self.licenseTextChanged.emit() - - def _updateDialogTitle(self): - self._dialogTitle = catalog.i18nc("@title:window", "Plugin License Agreement") - self.dialogTitleChanged.emit() diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 0640379895..6d863ecce5 100644 --- a/plugins/Marketplace/resources/qml/LicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/LicenseDialog.qml @@ -14,7 +14,7 @@ import Cura 1.6 as Cura UM.Dialog { id: licenseDialog - title: licenseModel.dialogTitle + title: catalog.i18nc("@button", "Plugin license agreement") minimumWidth: UM.Theme.getSize("license_window_minimum").width minimumHeight: UM.Theme.getSize("license_window_minimum").height width: minimumWidth @@ -72,7 +72,7 @@ UM.Dialog [ Cura.PrimaryButton { - text: licenseModel.acceptButtonText + text: catalog.i18nc("@button", "Accept") onClicked: { handler.onLicenseAccepted() } } ] @@ -81,7 +81,7 @@ UM.Dialog [ Cura.SecondaryButton { - text: licenseModel.declineButtonText + text: catalog.i18nc("@button", "Decline") onClicked: { handler.onLicenseDeclined() } } ]