parent
cc738fa846
commit
71ffe8f656
@ -29,6 +29,7 @@ Module attributes:
|
|||||||
pyeval_output: The output of the last :pyeval command.
|
pyeval_output: The output of the last :pyeval command.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import functools
|
||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSlot, QObject
|
from PyQt5.QtCore import pyqtSlot, QObject
|
||||||
@ -171,8 +172,10 @@ def qute_help(win_id, request):
|
|||||||
|
|
||||||
def qute_settings(win_id, _request):
|
def qute_settings(win_id, _request):
|
||||||
"""Handler for qute:settings. View/change qute configuration."""
|
"""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(
|
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')
|
return html.encode('UTF-8', errors='xmlcharrefreplace')
|
||||||
|
|
||||||
|
|
||||||
|
@ -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>
|
<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() %}
|
{% for d, e in config.DATA.get(section).items() %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ d }} (Current: {{ e.value()|truncate(100) }})</td>
|
<td>{{ d }} (Current: {{ confget(section, d)|truncate(100) }})</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="input"
|
<input type="input"
|
||||||
onblur="cset('{{ section }}', '{{ d }}', this)"
|
onblur="cset('{{ section }}', '{{ d }}', this)"
|
||||||
value="{{ e.value() }}">
|
value="{{ confget(section, d) }}">
|
||||||
</input>
|
</input>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user