diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 818766d766..f67d14aafe 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -164,6 +164,7 @@ class CuraEngineBackend(QObject, Backend): application.getPreferences().addPreference("general/auto_slice", False) application.getPreferences().addPreference("info/send_engine_crash", True) + application.getPreferences().addPreference("info/anonymous_engine_crash_report", True) self._use_timer: bool = False @@ -198,6 +199,7 @@ class CuraEngineBackend(QObject, Backend): # Ensure that the initial value for send_engine_crash is handled correctly. application.callLater(self._onPreferencesChanged, "info/send_engine_crash") + application.callLater(self._onPreferencesChanged, "info/anonymous_engine_crash_report") def startPlugins(self) -> None: """ @@ -1094,14 +1096,18 @@ class CuraEngineBackend(QObject, Backend): self._change_timer.timeout.disconnect(self.slice) def _onPreferencesChanged(self, preference: str) -> None: - if preference != "general/auto_slice" and preference != "info/send_engine_crash": + if preference != "general/auto_slice" and preference != "info/send_engine_crash" and preference != "info/anonymous_engine_crash_report": return if preference == "general/auto_slice": auto_slice = self.determineAutoSlicing() if auto_slice: self._change_timer.start() elif preference == "info/send_engine_crash": - os.environ["use_sentry"] = "1" if CuraApplication.getInstance().getPreferences().getValue("info/send_engine_crash") else "0" + os.environ["USE_SENTRY"] = "1" if CuraApplication.getInstance().getPreferences().getValue("info/send_engine_crash") else "0" + elif preference == "info/anonymous_engine_crash_report": + account = CuraApplication.getInstance().getCuraAPI().account + if account and account.isLoggedIn and not CuraApplication.getInstance().getPreferences().getValue("info/anonymous_engine_crash_report"): + os.environ["CURAENGINE_SENTRY_USER"] = account.userName def tickle(self) -> None: """Tickle the backend so in case of auto slicing, it starts the timer.""" diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 587084444c..708cc4a441 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -124,6 +124,9 @@ UM.PreferencesPage UM.Preferences.resetPreference("info/send_engine_crash") sendEngineCrashCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_engine_crash")) + UM.Preferences.resetPreference("info/anonymous_engine_crash_report") + sendEngineCrashCheckboxAnonymous.checked = boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report")) + UM.Preferences.resetPreference("info/automatic_update_check") checkUpdatesCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_update_check")) @@ -859,11 +862,12 @@ UM.PreferencesPage font: UM.Theme.getFont("medium_bold") text: catalog.i18nc("@label", "Privacy") } + UM.TooltipArea { width: childrenRect.width height: visible ? childrenRect.height : 0 - text: catalog.i18nc("@info:tooltip", "Should slicing crashes be automatically reported to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") + text: catalog.i18nc("@info:tooltip", "Should slicing crashes be automatically reported to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored, unless you give explicit permission.") UM.CheckBox { @@ -874,6 +878,47 @@ UM.PreferencesPage } } + ButtonGroup + { + id: curaCrashGroup + buttons: [sendEngineCrashCheckboxAnonymous, sendEngineCrashCheckboxUser] + } + + UM.TooltipArea + { + width: childrenRect.width + height: visible ? childrenRect.height : 0 + visible: Cura.API.account.isLoggedIn + text: catalog.i18nc("@info:tooltip", "Send crash reports without any personally identifiable information or models data to UltiMaker.") + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + Cura.RadioButton + { + id: sendEngineCrashCheckboxAnonymous + text: catalog.i18nc("@option:radio", "Anonymous crash reports") + enabled: sendEngineCrashCheckbox.checked + checked: boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report")) + onClicked: UM.Preferences.setValue("info/anonymous_engine_crash_report", true) + } + } + UM.TooltipArea + { + width: childrenRect.width + height: visible ? childrenRect.height : 0 + visible: Cura.API.account.isLoggedIn + text: catalog.i18nc("@info:tooltip", "Send crash reports with your registered UltiMaker account email adress to UltiMaker. No model data is being send.") + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + Cura.RadioButton + { + id: sendEngineCrashCheckboxUser + text: catalog.i18nc("@option:radio", "Crash reports with email adress") + enabled: sendEngineCrashCheckbox.checked + checked: !boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report")) && Cura.API.account.isLoggedIn + onClicked: UM.Preferences.setValue("info/anonymous_engine_crash_report", false) + } + } + UM.TooltipArea { width: childrenRect.width