mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06: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
1 changed files with 5 additions and 5 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue