Skip to content

Commit 970f841

Browse files
committed
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 spesmilo#10049 (comment)
1 parent 2ed691b commit 970f841

File tree

4 files changed

+0
-28
lines changed

4 files changed

+0
-28
lines changed

electrum/gui/qml/components/ExceptionDialog.qml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,6 @@ ElDialog
8989
dialog.open()
9090
}
9191
}
92-
Button {
93-
Layout.fillWidth: true
94-
Layout.preferredWidth: 2
95-
text: qsTr('Never')
96-
onClicked: {
97-
AppController.showNever()
98-
close()
99-
}
100-
}
10192
Button {
10293
Layout.fillWidth: true
10394
Layout.preferredWidth: 2

electrum/gui/qml/qeapp.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,6 @@ def report_task():
379379
self.sendingBugreport.emit()
380380
threading.Thread(target=report_task, daemon=True).start()
381381

382-
@pyqtSlot()
383-
def showNever(self):
384-
self.config.SHOW_CRASH_REPORTER = False
385-
386382
def _get_traceback_str_to_display(self) -> str:
387383
# The msg_box that shows the report uses rich_text=True, so
388384
# if traceback contains special HTML characters, e.g. '<',
@@ -551,9 +547,6 @@ def __init__(self, *, slot):
551547

552548
@classmethod
553549
def maybe_setup(cls, *, wallet: 'Abstract_Wallet' = None, slot=None) -> None:
554-
if not QEConfig.instance.config.SHOW_CRASH_REPORTER:
555-
EarlyExceptionsQueue.set_hook_as_ready() # flush already queued exceptions
556-
return
557550
if not cls._INSTANCE:
558551
cls._INSTANCE = Exception_Hook(slot=slot)
559552
if wallet:

electrum/gui/qt/exception_window.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ def __init__(self, config: 'SimpleConfig', exctype, value, tb):
8787
report_button.setIcon(read_QIcon("tab_send.png"))
8888
buttons.addWidget(report_button)
8989

90-
never_button = QPushButton(_('Never'))
91-
never_button.clicked.connect(lambda _checked: self.show_never())
92-
buttons.addWidget(never_button)
93-
9490
close_button = QPushButton(_('Not Now'))
9591
close_button.clicked.connect(lambda _checked: self.close())
9692
buttons.addWidget(close_button)
@@ -137,10 +133,6 @@ def on_close(self):
137133
Exception_Window._active_window = None
138134
self.close()
139135

140-
def show_never(self):
141-
self.config.SHOW_CRASH_REPORTER = False
142-
self.close()
143-
144136
def closeEvent(self, event):
145137
self.on_close()
146138
event.accept()
@@ -192,9 +184,6 @@ def __init__(self, *, config: 'SimpleConfig'):
192184

193185
@classmethod
194186
def maybe_setup(cls, *, config: 'SimpleConfig', wallet: 'Abstract_Wallet' = None) -> None:
195-
if not config.SHOW_CRASH_REPORTER:
196-
EarlyExceptionsQueue.set_hook_as_ready() # flush already queued exceptions
197-
return
198187
if not cls._INSTANCE:
199188
cls._INSTANCE = Exception_Hook(config=config)
200189
if wallet:

electrum/simple_config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,6 @@ def __setattr__(self, name, value):
886886
long_desc=lambda: _("Select which language is used in the GUI (after restart)."),
887887
)
888888
BLOCKCHAIN_PREFERRED_BLOCK = ConfigVar('blockchain_preferred_block', default=None)
889-
SHOW_CRASH_REPORTER = ConfigVar('show_crash_reporter', default=True, type_=bool)
890889
DONT_SHOW_TESTNET_WARNING = ConfigVar('dont_show_testnet_warning', default=False, type_=bool)
891890
RECENTLY_OPEN_WALLET_FILES = ConfigVar('recently_open', default=None)
892891
IO_DIRECTORY = ConfigVar('io_dir', default=os.path.expanduser('~'), type_=str)

0 commit comments

Comments
 (0)