mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Add warning if you haven't sliced before going to layer view
Done as a 5 minute fix. Fixes #7044.
This commit is contained in:
parent
5e70d2c122
commit
2c28f70016
1 changed files with 12 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2020 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
@ -116,8 +116,9 @@ class SimulationView(CuraView):
|
||||||
self._only_show_top_layers = bool(Application.getInstance().getPreferences().getValue("view/only_show_top_layers"))
|
self._only_show_top_layers = bool(Application.getInstance().getPreferences().getValue("view/only_show_top_layers"))
|
||||||
self._compatibility_mode = self._evaluateCompatibilityMode()
|
self._compatibility_mode = self._evaluateCompatibilityMode()
|
||||||
|
|
||||||
self._wireprint_warning_message = Message(catalog.i18nc("@info:status", "Cura does not accurately display layers when Wire Printing is enabled"),
|
self._wireprint_warning_message = Message(catalog.i18nc("@info:status", "Cura does not accurately display layers when Wire Printing is enabled."),
|
||||||
title = catalog.i18nc("@info:title", "Simulation View"))
|
title = catalog.i18nc("@info:title", "Simulation View"))
|
||||||
|
self._slice_first_warning_message = Message(catalog.i18nc("@info:status", "Nothing is shown because you need to slice first."), title = catalog.i18nc("@info:title", "No layer data"))
|
||||||
|
|
||||||
QtApplication.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
|
QtApplication.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
|
||||||
|
|
||||||
|
@ -149,6 +150,7 @@ class SimulationView(CuraView):
|
||||||
if self._activity == activity:
|
if self._activity == activity:
|
||||||
return
|
return
|
||||||
self._activity = activity
|
self._activity = activity
|
||||||
|
self._updateSliceWarningVisibility()
|
||||||
self.activityChanged.emit()
|
self.activityChanged.emit()
|
||||||
|
|
||||||
def getSimulationPass(self) -> SimulationPass:
|
def getSimulationPass(self) -> SimulationPass:
|
||||||
|
@ -543,11 +545,13 @@ class SimulationView(CuraView):
|
||||||
self._composite_pass.getLayerBindings().append("simulationview")
|
self._composite_pass.getLayerBindings().append("simulationview")
|
||||||
self._old_composite_shader = self._composite_pass.getCompositeShader()
|
self._old_composite_shader = self._composite_pass.getCompositeShader()
|
||||||
self._composite_pass.setCompositeShader(self._simulationview_composite_shader)
|
self._composite_pass.setCompositeShader(self._simulationview_composite_shader)
|
||||||
|
self._updateSliceWarningVisibility()
|
||||||
|
|
||||||
elif event.type == Event.ViewDeactivateEvent:
|
elif event.type == Event.ViewDeactivateEvent:
|
||||||
self._controller.getScene().getRoot().childrenChanged.disconnect(self._onSceneChanged)
|
self._controller.getScene().getRoot().childrenChanged.disconnect(self._onSceneChanged)
|
||||||
Application.getInstance().getPreferences().preferenceChanged.disconnect(self._onPreferencesChanged)
|
Application.getInstance().getPreferences().preferenceChanged.disconnect(self._onPreferencesChanged)
|
||||||
self._wireprint_warning_message.hide()
|
self._wireprint_warning_message.hide()
|
||||||
|
self._slice_first_warning_message.hide()
|
||||||
Application.getInstance().globalContainerStackChanged.disconnect(self._onGlobalStackChanged)
|
Application.getInstance().globalContainerStackChanged.disconnect(self._onGlobalStackChanged)
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
||||||
|
@ -661,6 +665,12 @@ class SimulationView(CuraView):
|
||||||
|
|
||||||
self._updateWithPreferences()
|
self._updateWithPreferences()
|
||||||
|
|
||||||
|
def _updateSliceWarningVisibility(self):
|
||||||
|
if not self.getActivity():
|
||||||
|
self._slice_first_warning_message.show()
|
||||||
|
else:
|
||||||
|
self._slice_first_warning_message.hide()
|
||||||
|
|
||||||
|
|
||||||
class _CreateTopLayersJob(Job):
|
class _CreateTopLayersJob(Job):
|
||||||
def __init__(self, scene: "Scene", layer_number: int, solid_layers: int) -> None:
|
def __init__(self, scene: "Scene", layer_number: int, solid_layers: int) -> None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue