1
0

crash reporter: add popup asking to confirm to send_report

This commit is contained in:
SomberNight
2025-07-18 15:34:33 +00:00
parent 627f5a88b3
commit 2ed691b8f0
2 changed files with 16 additions and 2 deletions

View File

@@ -77,7 +77,17 @@ ElDialog
Layout.fillWidth: true
Layout.preferredWidth: 3
text: qsTr('Send Bug Report')
onClicked: AppController.sendReport(user_text.text)
onClicked: {
var dialog = app.messageDialog.createObject(app, {
text: qsTr('Confirm to send bugreport?'),
yesno: true,
z: 1001 // assure topmost of all other dialogs
})
dialog.accepted.connect(function() {
AppController.sendReport(user_text.text)
})
dialog.open()
}
}
Button {
Layout.fillWidth: true

View File

@@ -83,7 +83,7 @@ class Exception_Window(BaseCrashReporter, QWidget, MessageBoxMixin, Logger):
buttons = QHBoxLayout()
report_button = QPushButton(_('Send Bug Report'))
report_button.clicked.connect(lambda _checked: self.send_report())
report_button.clicked.connect(lambda _checked: self._ask_for_confirm_to_send_report())
report_button.setIcon(read_QIcon("tab_send.png"))
buttons.addWidget(report_button)
@@ -103,6 +103,10 @@ class Exception_Window(BaseCrashReporter, QWidget, MessageBoxMixin, Logger):
self.setLayout(main_box)
self.show()
def _ask_for_confirm_to_send_report(self):
if self.question("Confirm to send bugreport?"):
self.send_report()
def send_report(self):
def on_success(response: CrashReportResponse):
text = response.text