Add documentation

CURA-8254
This commit is contained in:
Konstantinos Karmas 2021-10-04 16:47:48 +02:00
parent 4b7f385077
commit ce34e16cdd

View File

@ -36,9 +36,12 @@ class MaterialManagementModel(QObject):
self._checkIfNewMaterialsWereInstalled() self._checkIfNewMaterialsWereInstalled()
def _checkIfNewMaterialsWereInstalled(self): def _checkIfNewMaterialsWereInstalled(self):
"""
Checks whether new material packages were installed in the latest startup. If there were, then it shows
a message prompting the user to sync the materials with their printers.
"""
application = cura.CuraApplication.CuraApplication.getInstance() application = cura.CuraApplication.CuraApplication.getInstance()
new_materials_installed = False new_materials_installed = False
print(application.getPackageManager().installed_packages)
for package_id, package_info in application.getPackageManager().installed_packages.items(): for package_id, package_info in application.getPackageManager().installed_packages.items():
new_materials_installed = package_info["package_info"]["package_type"] == "material" new_materials_installed = package_info["package_info"]["package_type"] == "material"
if new_materials_installed: if new_materials_installed:
@ -57,6 +60,7 @@ class MaterialManagementModel(QObject):
"sync", "sync",
name = catalog.i18nc("@action:button", "Sync materials with printers"), name = catalog.i18nc("@action:button", "Sync materials with printers"),
icon = "", icon = "",
description = "Sync your newly installed materials with your printers.",
button_align = Message.ActionButtonAlignment.ALIGN_RIGHT button_align = Message.ActionButtonAlignment.ALIGN_RIGHT
) )
@ -64,6 +68,7 @@ class MaterialManagementModel(QObject):
"learn_more", "learn_more",
name = catalog.i18nc("@action:button", "Learn more"), name = catalog.i18nc("@action:button", "Learn more"),
icon = "", icon = "",
description = "Learn more about syncing your newly installed materials with your printers.",
button_align = Message.ActionButtonAlignment.ALIGN_LEFT, button_align = Message.ActionButtonAlignment.ALIGN_LEFT,
button_style = Message.ActionButtonStyle.LINK button_style = Message.ActionButtonStyle.LINK
) )