1
0

crash reporter: remove "Never" btn and config.SHOW_CRASH_REPORTER opt

- always hook into sys.excepthook and show the crash reporter
- if we don't hook into sys.excepthook and an exception propagates out on a Qt thread,
  that kills the Qt GUI
  - ref https://github.com/spesmilo/electrum/pull/10049#issuecomment-3089278083
This commit is contained in:
SomberNight
2025-07-18 15:51:27 +00:00
parent 2ed691b8f0
commit 970f84151d
4 changed files with 0 additions and 28 deletions

View File

@@ -89,15 +89,6 @@ ElDialog
dialog.open()
}
}
Button {
Layout.fillWidth: true
Layout.preferredWidth: 2
text: qsTr('Never')
onClicked: {
AppController.showNever()
close()
}
}
Button {
Layout.fillWidth: true
Layout.preferredWidth: 2

View File

@@ -379,10 +379,6 @@ class QEAppController(BaseCrashReporter, QObject):
self.sendingBugreport.emit()
threading.Thread(target=report_task, daemon=True).start()
@pyqtSlot()
def showNever(self):
self.config.SHOW_CRASH_REPORTER = False
def _get_traceback_str_to_display(self) -> str:
# The msg_box that shows the report uses rich_text=True, so
# if traceback contains special HTML characters, e.g. '<',
@@ -551,9 +547,6 @@ class Exception_Hook(QObject, Logger):
@classmethod
def maybe_setup(cls, *, wallet: 'Abstract_Wallet' = None, slot=None) -> None:
if not QEConfig.instance.config.SHOW_CRASH_REPORTER:
EarlyExceptionsQueue.set_hook_as_ready() # flush already queued exceptions
return
if not cls._INSTANCE:
cls._INSTANCE = Exception_Hook(slot=slot)
if wallet:

View File

@@ -87,10 +87,6 @@ class Exception_Window(BaseCrashReporter, QWidget, MessageBoxMixin, Logger):
report_button.setIcon(read_QIcon("tab_send.png"))
buttons.addWidget(report_button)
never_button = QPushButton(_('Never'))
never_button.clicked.connect(lambda _checked: self.show_never())
buttons.addWidget(never_button)
close_button = QPushButton(_('Not Now'))
close_button.clicked.connect(lambda _checked: self.close())
buttons.addWidget(close_button)
@@ -137,10 +133,6 @@ class Exception_Window(BaseCrashReporter, QWidget, MessageBoxMixin, Logger):
Exception_Window._active_window = None
self.close()
def show_never(self):
self.config.SHOW_CRASH_REPORTER = False
self.close()
def closeEvent(self, event):
self.on_close()
event.accept()
@@ -192,9 +184,6 @@ class Exception_Hook(QObject, Logger):
@classmethod
def maybe_setup(cls, *, config: 'SimpleConfig', wallet: 'Abstract_Wallet' = None) -> None:
if not config.SHOW_CRASH_REPORTER:
EarlyExceptionsQueue.set_hook_as_ready() # flush already queued exceptions
return
if not cls._INSTANCE:
cls._INSTANCE = Exception_Hook(config=config)
if wallet:

View File

@@ -886,7 +886,6 @@ Warning: setting this to too low will result in lots of payment failures."""),
long_desc=lambda: _("Select which language is used in the GUI (after restart)."),
)
BLOCKCHAIN_PREFERRED_BLOCK = ConfigVar('blockchain_preferred_block', default=None)
SHOW_CRASH_REPORTER = ConfigVar('show_crash_reporter', default=True, type_=bool)
DONT_SHOW_TESTNET_WARNING = ConfigVar('dont_show_testnet_warning', default=False, type_=bool)
RECENTLY_OPEN_WALLET_FILES = ConfigVar('recently_open', default=None)
IO_DIRECTORY = ConfigVar('io_dir', default=os.path.expanduser('~'), type_=str)