mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Add icon to licenseDialog (clowd flow)
CURA-7129
This commit is contained in:
parent
1287ebdc51
commit
b3812a3630
5 changed files with 72 additions and 24 deletions
|
@ -34,7 +34,7 @@ class LicensePresenter(QObject):
|
|||
## Show a license dialog for multiple packages where users can read a license and accept or decline them
|
||||
# \param plugin_path: Root directory of the Toolbox plugin
|
||||
# \param packages: Dict[package id, file path]
|
||||
def present(self, plugin_path: str, packages: Dict[str, str]) -> None:
|
||||
def present(self, plugin_path: str, packages: Dict[str, Dict[str, str]]) -> None:
|
||||
path = os.path.join(plugin_path, self._compatibility_dialog_path)
|
||||
|
||||
self._initState(packages)
|
||||
|
@ -60,14 +60,15 @@ class LicensePresenter(QObject):
|
|||
self._package_models[self._current_package_idx]["accepted"] = False
|
||||
self._checkNextPage()
|
||||
|
||||
def _initState(self, packages: Dict[str, str]) -> None:
|
||||
def _initState(self, packages: Dict[str, Dict[str, str]]) -> None:
|
||||
self._package_models = [
|
||||
{
|
||||
"package_id" : package_id,
|
||||
"package_path" : package_path,
|
||||
"package_path" : item["package_path"],
|
||||
"icon_url" : item["icon_url"],
|
||||
"accepted" : None #: None: no answer yet
|
||||
}
|
||||
for package_id, package_path in packages.items()
|
||||
for package_id, item in packages.items()
|
||||
]
|
||||
|
||||
def _presentCurrentPackage(self) -> None:
|
||||
|
@ -80,6 +81,7 @@ class LicensePresenter(QObject):
|
|||
|
||||
self._license_model.setCurrentPageIdx(self._current_package_idx)
|
||||
self._license_model.setPackageName(package_model["package_id"])
|
||||
self._license_model.setIconUrl(package_model["icon_url"])
|
||||
self._license_model.setLicenseText(license_content)
|
||||
if self._dialog:
|
||||
self._dialog.open() # Does nothing if already open
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue