Make qutebrowser aware of settings requiring a restart

See #3270
This commit is contained in:
Florian Bruhin 2017-11-12 17:17:19 +01:00
parent c47f0402ab
commit f6e6f9d27b
4 changed files with 16 additions and 15 deletions

View File

@ -254,7 +254,7 @@
|<<url.searchengines,url.searchengines>>|Search engines which can be used via the address bar.
|<<url.start_pages,url.start_pages>>|Page(s) to open at the start.
|<<url.yank_ignored_parameters,url.yank_ignored_parameters>>|URL parameters to strip with `:yank url`.
|<<window.hide_wayland_decoration,window.hide_wayland_decoration>>|Hide the window decoration when using wayland (requires restart).
|<<window.hide_wayland_decoration,window.hide_wayland_decoration>>|Hide the window decoration when using wayland.
|<<window.title_format,window.title_format>>|Format to use for the window title. The same placeholders like for
|<<zoom.default,zoom.default>>|Default zoom level.
|<<zoom.levels,zoom.levels>>|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: <<types,Bool>>

View File

@ -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:

View File

@ -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:

View File

@ -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(',', '&#44;')
f.write('Type: <<types,{typ}>>\n'.format(typ=typ))