mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-19 03:37:29 +08:00
Add documentation
CURA-8254
This commit is contained in:
parent
4b7f385077
commit
ce34e16cdd
@ -36,9 +36,12 @@ class MaterialManagementModel(QObject):
|
||||
self._checkIfNewMaterialsWereInstalled()
|
||||
|
||||
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()
|
||||
new_materials_installed = False
|
||||
print(application.getPackageManager().installed_packages)
|
||||
for package_id, package_info in application.getPackageManager().installed_packages.items():
|
||||
new_materials_installed = package_info["package_info"]["package_type"] == "material"
|
||||
if new_materials_installed:
|
||||
@ -57,6 +60,7 @@ class MaterialManagementModel(QObject):
|
||||
"sync",
|
||||
name = catalog.i18nc("@action:button", "Sync materials with printers"),
|
||||
icon = "",
|
||||
description = "Sync your newly installed materials with your printers.",
|
||||
button_align = Message.ActionButtonAlignment.ALIGN_RIGHT
|
||||
)
|
||||
|
||||
@ -64,6 +68,7 @@ class MaterialManagementModel(QObject):
|
||||
"learn_more",
|
||||
name = catalog.i18nc("@action:button", "Learn more"),
|
||||
icon = "",
|
||||
description = "Learn more about syncing your newly installed materials with your printers.",
|
||||
button_align = Message.ActionButtonAlignment.ALIGN_LEFT,
|
||||
button_style = Message.ActionButtonStyle.LINK
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user