summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2017-10-13 07:52:55 +0200
committerFlorian Bruhin <git@the-compiler.org>2017-10-13 07:52:55 +0200
commit2bf9a814511c7f2ff56510e5ae460e922d9ae4ff (patch)
tree1b9bf2ee078ba1907b44680685ffe1c26cac8f53
parent35d5038ab13718918d176ea7c1900b32e692d348 (diff)
downloadqutebrowser-2bf9a814511c7f2ff56510e5ae460e922d9ae4ff.tar.gz
qutebrowser-2bf9a814511c7f2ff56510e5ae460e922d9ae4ff.zip
Prevent empty segfault reports
-rw-r--r--qutebrowser/misc/crashdialog.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/qutebrowser/misc/crashdialog.py b/qutebrowser/misc/crashdialog.py
index 60c83d36b..a4fcf8435 100644
--- a/qutebrowser/misc/crashdialog.py
+++ b/qutebrowser/misc/crashdialog.py
@@ -32,7 +32,7 @@ import pkg_resources
from PyQt5.QtCore import pyqtSlot, Qt, QSize
from PyQt5.QtWidgets import (QDialog, QLabel, QTextEdit, QPushButton,
QVBoxLayout, QHBoxLayout, QCheckBox,
- QDialogButtonBox, QApplication)
+ QDialogButtonBox, QApplication, QMessageBox)
import qutebrowser
from qutebrowser.utils import version, log, utils, objreg, usertypes
@@ -515,6 +515,23 @@ class FatalCrashDialog(_CrashDialog):
except Exception:
self._crash_info.append(("History", traceback.format_exc()))
+ @pyqtSlot()
+ def on_report_clicked(self):
+ """Prevent empty reports."""
+ if (not self._info.toPlainText().strip() and
+ not self._contact.toPlainText().strip() and
+ self._type == 'Segmentation fault' and
+ self._func == 'qt_mainloop'):
+ msgbox.msgbox(parent=self, title='Empty crash info',
+ text="Empty reports for fatal crashes are useless "
+ "and mean I'll spend time deleting reports I could "
+ "spend on developing qutebrowser instead.\n\nPlease "
+ "help making qutebrowser better by providing more "
+ "information, or don't report this.",
+ icon=QMessageBox.Critical)
+ else:
+ super().on_report_clicked()
+
class ReportDialog(_CrashDialog):