Add conditional backend infos to docs
This commit is contained in:
parent
034d727a2c
commit
5c08c6c930
@ -1305,7 +1305,6 @@ Default: empty
|
||||
[[content.print_element_backgrounds]]
|
||||
== content.print_element_backgrounds
|
||||
Whether the background color and images are also drawn when the page is printed.
|
||||
# FIXME:conf This should be added automatically: # This setting only works with Qt 5.8 or newer when using the QtWebEngine backend.
|
||||
|
||||
Valid values:
|
||||
|
||||
@ -1314,6 +1313,8 @@ Valid values:
|
||||
|
||||
Default: +pass:[true]+
|
||||
|
||||
On QtWebEngine, this setting requires Qt 5.8 or newer.
|
||||
|
||||
[[content.private_browsing]]
|
||||
== content.private_browsing
|
||||
Open new windows in private browsing mode which does not record visited pages.
|
||||
@ -1329,7 +1330,6 @@ Default: empty
|
||||
== content.proxy
|
||||
The proxy to use.
|
||||
In addition to the listed values, you can use a `socks://...` or `http://...` URL.
|
||||
# FIXME:conf This should be added automatically: # This setting only works with Qt 5.8 or newer when using the QtWebEngine # backend.
|
||||
|
||||
Valid values:
|
||||
|
||||
@ -1338,6 +1338,8 @@ Valid values:
|
||||
|
||||
Default: +pass:[system]+
|
||||
|
||||
On QtWebEngine, this setting requires Qt 5.8 or newer.
|
||||
|
||||
[[content.proxy_dns_requests]]
|
||||
== content.proxy_dns_requests
|
||||
Whether to send DNS requests over the configured proxy.
|
||||
|
@ -47,7 +47,7 @@ MONOSPACE = (' xos4 Terminus, Terminus, Monospace, '
|
||||
|
||||
|
||||
Option = collections.namedtuple('Option', ['name', 'typ', 'default',
|
||||
'backends', 'conditional_backends',
|
||||
'backends', 'raw_backends',
|
||||
'description'])
|
||||
|
||||
|
||||
@ -154,18 +154,16 @@ def _parse_yaml_backends(name, node):
|
||||
-> setting available based on the given conditionals.
|
||||
|
||||
Return:
|
||||
A list of backends, and a boolean whether the list is conditional based
|
||||
on the Qt version.
|
||||
A list of backends.
|
||||
"""
|
||||
if node is None:
|
||||
return ([usertypes.Backend.QtWebKit, usertypes.Backend.QtWebEngine],
|
||||
False)
|
||||
return [usertypes.Backend.QtWebKit, usertypes.Backend.QtWebEngine]
|
||||
elif node == 'QtWebKit':
|
||||
return ([usertypes.Backend.QtWebKit], False)
|
||||
return [usertypes.Backend.QtWebKit]
|
||||
elif node == 'QtWebEngine':
|
||||
return ([usertypes.Backend.QtWebEngine], False)
|
||||
return [usertypes.Backend.QtWebEngine]
|
||||
elif isinstance(node, dict):
|
||||
return (_parse_yaml_backends_dict(name, node), True)
|
||||
return _parse_yaml_backends_dict(name, node)
|
||||
_raise_invalid_node(name, 'backends', node)
|
||||
|
||||
|
||||
@ -188,15 +186,14 @@ def _read_yaml(yaml_data):
|
||||
raise ValueError("Invalid keys {} for {}".format(
|
||||
option.keys(), name))
|
||||
|
||||
backends, conditional_backends = _parse_yaml_backends(
|
||||
name, option.get('backend', None))
|
||||
backends = option.get('backend', None)
|
||||
|
||||
parsed[name] = Option(
|
||||
name=name,
|
||||
typ=_parse_yaml_type(name, option['type']),
|
||||
default=option['default'],
|
||||
backends=backends,
|
||||
conditional_backends=conditional_backends,
|
||||
backends=_parse_yaml_backends(name, backends),
|
||||
raw_backends=backends if isinstance(backends, dict) else None,
|
||||
description=option['desc'])
|
||||
|
||||
# Make sure no key shadows another.
|
||||
|
@ -439,9 +439,6 @@ content.print_element_backgrounds:
|
||||
Whether the background color and images are also drawn when the page is
|
||||
printed.
|
||||
|
||||
# FIXME:conf This should be added automatically:
|
||||
# This setting only works with Qt 5.8 or newer when using the QtWebEngine backend.
|
||||
|
||||
content.private_browsing:
|
||||
type: Bool
|
||||
default: false
|
||||
@ -460,10 +457,6 @@ content.proxy:
|
||||
In addition to the listed values, you can use a `socks://...` or `http://...`
|
||||
URL.
|
||||
|
||||
# FIXME:conf This should be added automatically:
|
||||
# This setting only works with Qt 5.8 or newer when using the QtWebEngine
|
||||
# backend.
|
||||
|
||||
content.proxy_dns_requests:
|
||||
default: true
|
||||
type: Bool
|
||||
|
@ -387,7 +387,16 @@ def _generate_setting_option(f, opt):
|
||||
f.write("Default: empty\n")
|
||||
|
||||
all_backends = [usertypes.Backend.QtWebKit, usertypes.Backend.QtWebEngine]
|
||||
if opt.backends == all_backends or opt.conditional_backends:
|
||||
if opt.raw_backends is not None:
|
||||
for name, conditional in sorted(opt.raw_backends.items()):
|
||||
if conditional is True:
|
||||
pass
|
||||
elif conditional is False:
|
||||
f.write("\nOn {}, this setting is unavailable.\n".format(name))
|
||||
else:
|
||||
f.write("\nOn {}, this setting requires {} or newer.\n"
|
||||
.format(name, conditional))
|
||||
elif opt.backends == all_backends:
|
||||
pass
|
||||
elif opt.backends == [usertypes.Backend.QtWebKit]:
|
||||
f.write("\nThis setting is only available with the QtWebKit "
|
||||
|
Loading…
Reference in New Issue
Block a user