mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Remove the checkbox option to set the preference to hide the messagebox
This commit is contained in:
parent
b7898b5a97
commit
ccc0589495
2 changed files with 70 additions and 42 deletions
|
@ -67,11 +67,11 @@ class SolidView(View):
|
|||
self._next_xray_checking_time = time.time()
|
||||
self._xray_checking_update_time = 1.0 # seconds
|
||||
self._xray_warning_cooldown = 60 * 10 # reshow Model error message every 10 minutes
|
||||
self._xray_warning_message = Message(catalog.i18nc("@info:status", "Your model is not manifold. The highlighted areas indicate either missing or extraneous surfaces.")
|
||||
, lifetime = 60 * 5 # leave message for 5 minutes
|
||||
, title = catalog.i18nc("@info:title", "Model errors"),
|
||||
option_text = catalog.i18nc("@info:option_text", "Do not show this message again"), option_state = False)
|
||||
self._xray_warning_message.optionToggled.connect(self._onDontAskMeAgain)
|
||||
self._xray_warning_message = Message(
|
||||
catalog.i18nc("@info:status", "Your model is not manifold. The highlighted areas indicate either missing or extraneous surfaces."),
|
||||
lifetime = 60 * 5, # leave message for 5 minutes
|
||||
title = catalog.i18nc("@info:title", "Model errors"),
|
||||
)
|
||||
application.getPreferences().addPreference(self._show_xray_warning_preference, True)
|
||||
|
||||
application.engineCreatedSignal.connect(self._onGlobalContainerChanged)
|
||||
|
@ -133,6 +133,17 @@ class SolidView(View):
|
|||
self._support_mesh_shader.setUniformValue("u_vertical_stripes", True)
|
||||
self._support_mesh_shader.setUniformValue("u_width", 5.0)
|
||||
|
||||
if not Application.getInstance().getPreferences().getValue(self._show_xray_warning_preference):
|
||||
self._xray_error_image = None
|
||||
self._xray_shader = None
|
||||
self._xray_composite_shader = None
|
||||
if self._composite_pass and 'xray' in self._composite_pass.getLayerBindings():
|
||||
self._composite_pass.setLayerBindings(self._old_layer_bindings)
|
||||
self._composite_pass.setCompositeShader(self._old_composite_shader)
|
||||
self._old_layer_bindings = None
|
||||
self._old_composite_shader = None
|
||||
self._xray_warning_message.hide()
|
||||
else:
|
||||
if not self._xray_error_image:
|
||||
self._xray_error_image = OpenGL.getInstance().createTexture()
|
||||
texture_file = "xray_error.png"
|
||||
|
@ -291,9 +302,6 @@ class SolidView(View):
|
|||
self._xray_warning_message.show()
|
||||
Logger.log("i", "X-Ray overlay found non-manifold pixels.")
|
||||
|
||||
def _onDontAskMeAgain(self, checked: bool) -> None:
|
||||
Application.getInstance().getPreferences().setValue(self._show_xray_warning_preference, not checked)
|
||||
|
||||
def event(self, event):
|
||||
if event.type == Event.ViewActivateEvent:
|
||||
# FIX: on Max OS X, somehow QOpenGLContext.currentContext() can become None during View switching.
|
||||
|
|
|
@ -87,7 +87,9 @@ UM.PreferencesPage
|
|||
UM.Preferences.resetPreference("view/show_overhang");
|
||||
showOverhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang"))
|
||||
UM.Preferences.resetPreference("view/show_xray_warning");
|
||||
showXrayErrorCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_xray_warning"))
|
||||
showXrayErrorCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_warning"))
|
||||
UM.Preferences.resetPreference("view/show_xray_warning_message");
|
||||
showXrayErrorMessageCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_warning_message"))
|
||||
UM.Preferences.resetPreference("view/center_on_select");
|
||||
centerOnSelectCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
|
||||
UM.Preferences.resetPreference("view/invert_zoom");
|
||||
|
@ -345,7 +347,7 @@ UM.PreferencesPage
|
|||
width: childrenRect.width;
|
||||
height: childrenRect.height;
|
||||
|
||||
text: catalog.i18nc("@info:tooltip", "Show a message if missing or extraneous surfaces are detected. The toolpaths will often be missing parts of the intended geometry.")
|
||||
text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.")
|
||||
|
||||
CheckBox
|
||||
{
|
||||
|
@ -354,7 +356,25 @@ UM.PreferencesPage
|
|||
checked: boolCheck(UM.Preferences.getValue("view/show_xray_warning"))
|
||||
onClicked: UM.Preferences.setValue("view/show_xray_warning", checked)
|
||||
|
||||
text: catalog.i18nc("@option:check", "Display message if model errors are detected");
|
||||
text: catalog.i18nc("@option:check", "Display model errors");
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea
|
||||
{
|
||||
width: childrenRect.width;
|
||||
height: childrenRect.height;
|
||||
|
||||
text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.")
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: showXrayErrorMessageCheckbox
|
||||
|
||||
checked: boolCheck(UM.Preferences.getValue("view/show_xray_warning_message"))
|
||||
onClicked: UM.Preferences.setValue("view/show_xray_warning_message", checked)
|
||||
|
||||
text: catalog.i18nc("@option:check", "Display model errors");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue