mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Rename MarketplaceLicenseDialog to MultipleLicenceDialog
CURA-9146
This commit is contained in:
parent
5ce5ce769e
commit
3ed182cd74
2 changed files with 13 additions and 26 deletions
|
|
@ -28,7 +28,7 @@ class LicensePresenter(QObject):
|
|||
super().__init__()
|
||||
self._presented = False
|
||||
"""Whether present() has been called and state is expected to be initialized"""
|
||||
self._catalog = i18nCatalog("cura")
|
||||
|
||||
self._dialog = None # type: Optional[QObject]
|
||||
self._package_manager = app.getPackageManager() # type: PackageManager
|
||||
# Emits List[Dict[str, [Any]] containing for example
|
||||
|
|
@ -37,13 +37,15 @@ class LicensePresenter(QObject):
|
|||
|
||||
self._current_package_idx = 0
|
||||
self._package_models = [] # type: List[Dict]
|
||||
|
||||
self._catalog = i18nCatalog("cura")
|
||||
decline_button_text = self._catalog.i18nc("@button", "Decline and remove from account")
|
||||
self._license_model = LicenseModel(decline_button_text=decline_button_text) # type: LicenseModel
|
||||
self._page_count = 0
|
||||
|
||||
self._app = app
|
||||
|
||||
self._compatibility_dialog_path = "resources/qml/MarketplaceLicenseDialog.qml"
|
||||
self._compatibility_dialog_path = "resources/qml/MultipleLicenseDialog.qml"
|
||||
|
||||
def present(self, plugin_path: str, packages: Dict[str, Dict[str, str]]) -> None:
|
||||
"""Show a license dialog for multiple packages where users can read a license and accept or decline them
|
||||
|
|
@ -90,7 +92,6 @@ class LicensePresenter(QObject):
|
|||
self._checkNextPage()
|
||||
|
||||
def _initState(self, packages: Dict[str, Dict[str, Any]]) -> None:
|
||||
|
||||
implicitly_accepted_count = 0
|
||||
|
||||
for package_id, item in packages.items():
|
||||
|
|
@ -114,7 +115,6 @@ class LicensePresenter(QObject):
|
|||
self._page_count = len(self._package_models) - implicitly_accepted_count
|
||||
self._license_model.setPageCount(self._page_count)
|
||||
|
||||
|
||||
def _presentCurrentPackage(self) -> None:
|
||||
package_model = self._package_models[self._current_package_idx]
|
||||
package_info = self._package_manager.getPackageInfo(package_model["package_path"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue