mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Add preference to disable sentry engine crash reporting
CURA-11364
This commit is contained in:
parent
f22d82c1e0
commit
60bf2fbc2c
2 changed files with 35 additions and 4 deletions
|
@ -163,6 +163,7 @@ class CuraEngineBackend(QObject, Backend):
|
|||
self._is_disabled: bool = False
|
||||
|
||||
application.getPreferences().addPreference("general/auto_slice", False)
|
||||
application.getPreferences().addPreference("info/send_engine_crash", True)
|
||||
|
||||
self._use_timer: bool = False
|
||||
|
||||
|
@ -173,6 +174,8 @@ class CuraEngineBackend(QObject, Backend):
|
|||
self._change_timer.setSingleShot(True)
|
||||
self._change_timer.setInterval(500)
|
||||
self.determineAutoSlicing()
|
||||
|
||||
|
||||
application.getPreferences().preferenceChanged.connect(self._onPreferencesChanged)
|
||||
|
||||
self._slicing_error_message = Message(
|
||||
|
@ -193,6 +196,9 @@ class CuraEngineBackend(QObject, Backend):
|
|||
|
||||
application.initializationFinished.connect(self.initialize)
|
||||
|
||||
# Ensure that the initial value for send_engine_crash is handled correctly.
|
||||
application.callLater(self._onPreferencesChanged, "info/send_engine_crash")
|
||||
|
||||
def startPlugins(self) -> None:
|
||||
"""
|
||||
Ensure that all backend plugins are started
|
||||
|
@ -1088,11 +1094,17 @@ class CuraEngineBackend(QObject, Backend):
|
|||
self._change_timer.timeout.disconnect(self.slice)
|
||||
|
||||
def _onPreferencesChanged(self, preference: str) -> None:
|
||||
if preference != "general/auto_slice":
|
||||
if preference != "general/auto_slice" and preference != "info/send_engine_crash":
|
||||
return
|
||||
auto_slice = self.determineAutoSlicing()
|
||||
if auto_slice:
|
||||
self._change_timer.start()
|
||||
if preference == "general/auto_slice":
|
||||
auto_slice = self.determineAutoSlicing()
|
||||
if auto_slice:
|
||||
self._change_timer.start()
|
||||
elif preference == "info/send_engine_crash":
|
||||
if CuraApplication.getInstance().getPreferences().getValue("info/send_engine_crash"):
|
||||
os.environ["use_sentry"] = str(1)
|
||||
else:
|
||||
os.environ["use_sentry"] = str(0)
|
||||
|
||||
def tickle(self) -> None:
|
||||
"""Tickle the backend so in case of auto slicing, it starts the timer."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue