From ec017f3aa3b58e2d8839b2fd98ea36428d001bb9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 29 May 2020 20:58:21 +0200 Subject: backendproblem: Deduplicate text --- qutebrowser/misc/backendproblem.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/qutebrowser/misc/backendproblem.py b/qutebrowser/misc/backendproblem.py index 73044cd99..01cfc988a 100644 --- a/qutebrowser/misc/backendproblem.py +++ b/qutebrowser/misc/backendproblem.py @@ -165,6 +165,14 @@ class _BackendProblemChecker: """Check for various backend-specific issues.""" + SOFTWARE_RENDERING_TEXT = ( + "

Forcing software rendering

" + "

This allows you to use the newer QtWebEngine backend (based on " + "Chromium) but could have noticeable performance impact (depending on " + "your hardware). This sets the qt.force_software_rendering = " + "'chromium' option (if you have a config.py file, you'll " + "need to set this manually).

") + def __init__(self, *, no_err_windows: bool, save_manager: savemanager.SaveManager) -> None: @@ -238,14 +246,8 @@ class _BackendProblemChecker: self._show_dialog( backend=usertypes.Backend.QtWebEngine, because="you're using Nouveau graphics", - text=("

There are two ways to fix this:

" - "

Forcing software rendering

" - "

This allows you to use the newer QtWebEngine backend " - "(based on Chromium) but could have noticeable performance " - "impact (depending on your hardware). This sets the " - "qt.force_software_rendering = 'chromium' option " - "(if you have a config.py file, you'll need to set " - "this manually).

"), + text=("

There are two ways to fix this:

" + + self.SOFTWARE_RENDERING_TEXT), buttons=[button], ) @@ -290,13 +292,7 @@ class _BackendProblemChecker: buttons.append(_Button("Force software rendering", 'qt.force_software_rendering', 'chromium')) - text += ("

Forcing software rendering

" - "

This allows you to use the newer QtWebEngine backend " - "(based on Chromium) but could have noticeable " - "performance impact (depending on your hardware). This " - "sets the qt.force_software_rendering = " - "'chromium' option (if you have a config.py " - "file, you'll need to set this manually).

") + text += self.SOFTWARE_RENDERING_TEXT self._show_dialog(backend=usertypes.Backend.QtWebEngine, because="you're using Wayland", -- cgit v1.2.3-54-g00ecf