Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various issues reported via crash-logs. #19900

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cura/Settings/MachineManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def _validateVariantsAndMaterials(self, global_stack) -> None:
self.setVariantByName(extruder.getMetaDataEntry("position"), machine_node.preferred_variant_name)
variant_node = machine_node.variants.get(machine_node.preferred_variant_name)

material_node = variant_node.materials.get(extruder.material.getMetaDataEntry("base_file"))
material_node = variant_node.materials.get(extruder.material.getMetaDataEntry("base_file")) if variant_node else None
if material_node is None:
Logger.log("w", "An extruder has an unknown material, switching it to the preferred material")
if not self.setMaterialById(extruder.getMetaDataEntry("position"), machine_node.preferred_material):
Expand Down
2 changes: 2 additions & 0 deletions cura/UI/CuraSplashScreen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2020 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
import math

from PyQt6.QtCore import Qt, QCoreApplication, QTimer
from PyQt6.QtGui import QPixmap, QColor, QFont, QPen, QPainter
Expand Down Expand Up @@ -51,6 +52,7 @@ def updateLoadingImage(self):
self._last_update_time = time.time()
# Since we don't know how much time actually passed, check how many intervals of 50 we had.
self._loading_image_rotation_angle -= 10 * (time_since_last_update * 1000 / 50)
self._loading_image_rotation_angle = math.fmod(self._loading_image_rotation_angle, 360)
self.repaint()

# Override the mousePressEvent so the splashscreen doesn't disappear when clicked
Expand Down
3 changes: 1 addition & 2 deletions cura/UI/WelcomePagesModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ def getPageIndexById(self, page_id: str) -> Optional[int]:
def _getBuiltinWelcomePagePath(page_filename: str) -> QUrl:
"""Convenience function to get QUrl path to pages that's located in "resources/qml/WelcomePages"."""
from cura.CuraApplication import CuraApplication
return QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
os.path.join("WelcomePages", page_filename)))
return QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "WelcomePages", page_filename))

# FIXME: HACKs for optimization that we don't update the model every time the active machine gets changed.
def _onActiveMachineChanged(self) -> None:
Expand Down
Loading