From 45529c59a9993f9424b5183d27493d21bdb2876f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 18 Sep 2018 08:49:01 +0200 Subject: [PATCH] Add QtWebKit warning to backendproblem dialogs --- qutebrowser/misc/backendproblem.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/qutebrowser/misc/backendproblem.py b/qutebrowser/misc/backendproblem.py index 363f7f23c..3bd52eb44 100644 --- a/qutebrowser/misc/backendproblem.py +++ b/qutebrowser/misc/backendproblem.py @@ -68,6 +68,11 @@ def _other_backend(backend): def _error_text(because, text, backend): """Get an error text for the given information.""" other_backend, other_setting = _other_backend(backend) + if other_backend == usertypes.Backend.QtWebKit: + warning = ("Note that QtWebKit hasn't been updated since " + "July 2017 (including security updates).") + else: + warning = "" return ("Failed to start with the {backend} backend!" "

qutebrowser tried to start with the {backend} backend but " "failed because {because}.

{text}" @@ -75,9 +80,10 @@ def _error_text(because, text, backend): "

This forces usage of the {other_backend.name} backend by " "setting the backend = '{other_setting}' option " "(if you have a config.py file, you'll need to set " - "this manually).

".format( + "this manually). {warning}

".format( backend=backend.name, because=because, text=text, - other_backend=other_backend, other_setting=other_setting)) + other_backend=other_backend, other_setting=other_setting, + warning=warning)) class _Dialog(QDialog): @@ -102,8 +108,10 @@ class _Dialog(QDialog): quit_button.clicked.connect(lambda: self.done(_Result.quit)) hbox.addWidget(quit_button) - backend_button = QPushButton("Force {} backend".format( - other_backend.name)) + backend_text = "Force {} backend".format(other_backend.name) + if other_backend == usertypes.Backend.QtWebKit: + backend_text += ' (not recommended)' + backend_button = QPushButton(backend_text) backend_button.clicked.connect(functools.partial( self._change_setting, 'backend', other_setting)) hbox.addWidget(backend_button)