Skip to content

Commit 2ed691b

Browse files
committed
crash reporter: add popup asking to confirm to send_report
1 parent 627f5a8 commit 2ed691b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

electrum/gui/qml/components/ExceptionDialog.qml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,17 @@ ElDialog
7777
Layout.fillWidth: true
7878
Layout.preferredWidth: 3
7979
text: qsTr('Send Bug Report')
80-
onClicked: AppController.sendReport(user_text.text)
80+
onClicked: {
81+
var dialog = app.messageDialog.createObject(app, {
82+
text: qsTr('Confirm to send bugreport?'),
83+
yesno: true,
84+
z: 1001 // assure topmost of all other dialogs
85+
})
86+
dialog.accepted.connect(function() {
87+
AppController.sendReport(user_text.text)
88+
})
89+
dialog.open()
90+
}
8191
}
8292
Button {
8393
Layout.fillWidth: true

electrum/gui/qt/exception_window.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, config: 'SimpleConfig', exctype, value, tb):
8383
buttons = QHBoxLayout()
8484

8585
report_button = QPushButton(_('Send Bug Report'))
86-
report_button.clicked.connect(lambda _checked: self.send_report())
86+
report_button.clicked.connect(lambda _checked: self._ask_for_confirm_to_send_report())
8787
report_button.setIcon(read_QIcon("tab_send.png"))
8888
buttons.addWidget(report_button)
8989

@@ -103,6 +103,10 @@ def __init__(self, config: 'SimpleConfig', exctype, value, tb):
103103
self.setLayout(main_box)
104104
self.show()
105105

106+
def _ask_for_confirm_to_send_report(self):
107+
if self.question("Confirm to send bugreport?"):
108+
self.send_report()
109+
106110
def send_report(self):
107111
def on_success(response: CrashReportResponse):
108112
text = response.text

0 commit comments

Comments
 (0)