From f6e6f9d27b6dad24f084614d96c55c53752e8596 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 12 Nov 2017 17:17:19 +0100 Subject: [PATCH] Make qutebrowser aware of settings requiring a restart See #3270 --- doc/help/settings.asciidoc | 5 +++-- qutebrowser/config/configdata.py | 6 ++++-- qutebrowser/config/configdata.yml | 18 +++++++----------- scripts/dev/src2asciidoc.py | 2 ++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 89579b39f..15eb79390 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -254,7 +254,7 @@ |<>|Search engines which can be used via the address bar. |<>|Page(s) to open at the start. |<>|URL parameters to strip with `:yank url`. -|<>|Hide the window decoration when using wayland (requires restart). +|<>|Hide the window decoration when using wayland. |<>|Format to use for the window title. The same placeholders like for |<>|Default zoom level. |<>|Available zoom levels. @@ -2989,7 +2989,8 @@ Default: [[window.hide_wayland_decoration]] === window.hide_wayland_decoration -Hide the window decoration when using wayland (requires restart). +Hide the window decoration when using wayland. +This setting requires a restart. Type: <> diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index ccce4c377..143cbd49a 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -48,6 +48,7 @@ class Option: backends = attr.ib() raw_backends = attr.ib() description = attr.ib() + restart = attr.ib(default=False) @attr.s @@ -190,7 +191,7 @@ def _read_yaml(yaml_data): migrations = Migrations() data = utils.yaml_load(yaml_data) - keys = {'type', 'default', 'desc', 'backend'} + keys = {'type', 'default', 'desc', 'backend', 'restart'} for name, option in data.items(): if set(option.keys()) == {'renamed'}: @@ -215,7 +216,8 @@ def _read_yaml(yaml_data): default=option['default'], backends=_parse_yaml_backends(name, backends), raw_backends=backends if isinstance(backends, dict) else None, - description=option['desc']) + description=option['desc'], + restart=option.get('restart', False)) # Make sure no key shadows another. for key1 in parsed: diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index e8581563b..7e66eecd5 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -95,6 +95,7 @@ backend: - webengine: Use QtWebEngine (based on Chromium). - webkit: Use QtWebKit (based on WebKit, similar to Safari). default: webengine + restart: true desc: >- Backend to use to display websites. @@ -109,8 +110,6 @@ backend: resource hungry than QtWebKit and has a couple of missing features in qutebrowser, but is generally the preferred choice. - This setting requires a restart. - ## qt @@ -123,6 +122,7 @@ qt.args: valtype: String none_ok: true default: [] + restart: true desc: >- Additional arguments to pass to Qt, without leading `--`. @@ -130,8 +130,6 @@ qt.args: https://peter.sh/experiments/chromium-command-line-switches/ for a list) will work. - This setting requires a restart. - force_software_rendering: renamed: qt.force_software_rendering @@ -139,30 +137,29 @@ qt.force_software_rendering: type: Bool default: false backend: QtWebEngine + restart: true desc: >- Force software rendering for QtWebEngine. This is needed for QtWebEngine to work with Nouveau drivers. - This setting requires a restart. - qt.force_platform: type: name: String none_ok: true default: null + restart: true desc: >- Force a Qt platform to use. This sets the `QT_QPA_PLATFORM` environment variable and is useful to force using the XCB plugin when running QtWebEngine on Wayland. - This setting requires a restart. - qt.highdpi: type: Bool default: false + restart: true desc: >- Turn on Qt HighDPI scaling. @@ -173,8 +170,6 @@ qt.highdpi: As an alternative to this, it's possible to set font sizes and the `zoom.default` setting. - This setting requires a restart. - ## auto_save auto_save.interval: @@ -1437,7 +1432,8 @@ url.yank_ignored_parameters: window.hide_wayland_decoration: type: Bool default: false - desc: Hide the window decoration when using wayland (requires restart). + restart: true + desc: Hide the window decoration when using wayland. window.title_format: type: diff --git a/scripts/dev/src2asciidoc.py b/scripts/dev/src2asciidoc.py index a58791297..6e5581ad8 100755 --- a/scripts/dev/src2asciidoc.py +++ b/scripts/dev/src2asciidoc.py @@ -416,6 +416,8 @@ def _generate_setting_option(f, opt): f.write('[[{}]]'.format(opt.name) + "\n") f.write("=== {}".format(opt.name) + "\n") f.write(opt.description + "\n") + if opt.restart: + f.write("This setting requires a restart.\n") f.write("\n") typ = opt.typ.get_name().replace(',', ',') f.write('Type: <>\n'.format(typ=typ))