Use config.get() for qute:settings.

Fixes #628.
This commit is contained in:
Florian Bruhin 2015-04-16 22:19:54 +02:00
parent cc738fa846
commit 71ffe8f656
2 changed files with 6 additions and 3 deletions

View File

@ -29,6 +29,7 @@ Module attributes:
pyeval_output: The output of the last :pyeval command.
"""
import functools
import configparser
from PyQt5.QtCore import pyqtSlot, QObject
@ -171,8 +172,10 @@ def qute_help(win_id, request):
def qute_settings(win_id, _request):
"""Handler for qute:settings. View/change qute configuration."""
config_getter = functools.partial(objreg.get('config').get, raw=True)
html = jinja.env.get_template('settings.html').render(
win_id=win_id, title='settings', config=configdata)
win_id=win_id, title='settings', config=configdata,
confget=config_getter)
return html.encode('UTF-8', errors='xmlcharrefreplace')

View File

@ -24,11 +24,11 @@ th pre { color: grey; text-align: left; }
<tr><th colspan="2"><h3>{{ section }}</h3><pre>{{ config.SECTION_DESC.get(section)|wordwrap(width=120) }}</pre></th></tr>
{% for d, e in config.DATA.get(section).items() %}
<tr>
<td>{{ d }} (Current: {{ e.value()|truncate(100) }})</td>
<td>{{ d }} (Current: {{ confget(section, d)|truncate(100) }})</td>
<td>
<input type="input"
onblur="cset('{{ section }}', '{{ d }}', this)"
value="{{ e.value() }}">
value="{{ confget(section, d) }}">
</input>
</td>
</tr>