crash reporter: add popup asking to confirm to send_report
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user