mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 05:25:56 +08:00
Simplify the check for new materials
If there is at least one material, we can already show the message without checking the rest of the installed packages. CURA-8254
This commit is contained in:
parent
5732fc2b51
commit
658e54c8e5
@ -41,11 +41,11 @@ class MaterialManagementModel(QObject):
|
|||||||
a message prompting the user to sync the materials with their printers.
|
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
|
for package_id, package_data in application.getPackageManager().installed_packages.items():
|
||||||
for package_id, package_info in application.getPackageManager().installed_packages.items():
|
if package_data["package_info"]["package_type"] == "material":
|
||||||
new_materials_installed = package_info["package_info"]["package_type"] == "material"
|
# At least one new material was installed
|
||||||
if new_materials_installed:
|
|
||||||
self._showSyncNewMaterialsMessage()
|
self._showSyncNewMaterialsMessage()
|
||||||
|
break
|
||||||
|
|
||||||
def _showSyncNewMaterialsMessage(self):
|
def _showSyncNewMaterialsMessage(self):
|
||||||
sync_materials_message = Message(
|
sync_materials_message = Message(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user