mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-27 22:03:20 +02:00
Dont display configuration links for non-configurable groups
This commit is contained in:
parent
cc539d549c
commit
9285e4a065
1 changed files with 10 additions and 2 deletions
|
|
@ -244,12 +244,19 @@ def show_group(ev):
|
|||
current_state = 'configure-group'
|
||||
apply_state_to_markup()
|
||||
|
||||
def is_group_configurable(name):
|
||||
if entry_points[name]:
|
||||
return True
|
||||
if name is 'input_fmt':
|
||||
name = conversion_data.conversion_options.input_plugin_name
|
||||
elif name is 'output_fmt':
|
||||
name = conversion_data.conversion_options.output_plugin_name
|
||||
return bool(entry_points[name])
|
||||
|
||||
def category(name):
|
||||
ans = E.li(E.a(class_='simple-link', href='javascript: void(0)'))
|
||||
ans.dataset.group = name
|
||||
ans.firstChild.addEventListener('click', show_group)
|
||||
if name is not 'input_fmt' and name is not 'output_fmt' and not entry_points[name]:
|
||||
ans.style.display = 'none'
|
||||
return ans
|
||||
|
||||
GROUP_TITLES = {
|
||||
|
|
@ -287,6 +294,7 @@ def initialize(container):
|
|||
ignore_changes = False
|
||||
for li in container.querySelectorAll('.group-names > li'):
|
||||
group_name = li.dataset.group
|
||||
li.style.display = 'block' if is_group_configurable(group_name) else 'none'
|
||||
if GROUP_TITLES[group_name]:
|
||||
title = GROUP_TITLES[group_name]
|
||||
elif group_name is 'input_fmt':
|
||||
|
|
|
|||
Loading…
Reference in a new issue