mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add structure detection UI
This commit is contained in:
parent
f97c9982d2
commit
850640fa0e
@ -108,8 +108,8 @@ def checkbox(name, text, tooltip): # {{{
|
|||||||
)
|
)
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
def lineedit(name, text, width, tooltip): # {{{
|
def lineedit(name, text, width=25, tooltip=None, suffix=None): # {{{
|
||||||
return create_simple_widget(name, text, tooltip, E.input(type='text', size=str(width or 25)),
|
return create_simple_widget(name, text, tooltip, E.input(type='text', size=str(width)),
|
||||||
def getter(w): # noqa: unused-local
|
def getter(w): # noqa: unused-local
|
||||||
ans = w.value
|
ans = w.value
|
||||||
if ans and ans.strip():
|
if ans and ans.strip():
|
||||||
@ -117,6 +117,7 @@ def lineedit(name, text, width, tooltip): # {{{
|
|||||||
,
|
,
|
||||||
def setter(w, val): # noqa: unused-local
|
def setter(w, val): # noqa: unused-local
|
||||||
w.value = val or ''
|
w.value = val or ''
|
||||||
|
, suffix=suffix
|
||||||
)
|
)
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
@ -308,14 +309,13 @@ def page_setup(container):
|
|||||||
def structure_detection(container):
|
def structure_detection(container):
|
||||||
g = E.div(class_='simple-group')
|
g = E.div(class_='simple-group')
|
||||||
container.appendChild(g)
|
container.appendChild(g)
|
||||||
g.appendChild(float_spin('margin_left', _('Left page margin'), unit='pt', step=0.1, min=-1, max=200))
|
g.appendChild(lineedit('chapter', _('Detect chapters at'), 50))
|
||||||
g.appendChild(float_spin('margin_top', _('Top page margin'), unit='pt', step=0.1, min=-1, max=200))
|
g.appendChild(choices('chapter_mark', _('Chap&ter mark:'), ['pagebreak', 'rule', 'both', 'none']))
|
||||||
g.appendChild(float_spin('margin_right', _('Right page margin'), unit='pt', step=0.1, min=-1, max=200))
|
g.appendChild(checkbox('remove_first_image', _('Remove first &image')))
|
||||||
g.appendChild(float_spin('margin_bottom', _('Bottom page margin'), unit='pt', step=0.1, min=-1, max=200))
|
g.appendChild(checkbox('remove_fake_margins', _('Remove &fake margins')))
|
||||||
g.appendChild(choices('input_profile', _('&Input profile:'), {name: profiles.input[name].name for name in profiles.input}))
|
g.appendChild(checkbox('insert_metadata', _('Insert metadata at start of book')))
|
||||||
g.appendChild(E.div(data_profile='input'))
|
g.appendChild(lineedit('page_breaks_before', _('Insert page breaks before'), 50))
|
||||||
g.appendChild(choices('output_profile', _('&Output profile:'), {name: profiles.output[name].name for name in profiles.output}))
|
g.appendChild(lineedit('start_reading_at', _('Start reading at'), 50))
|
||||||
g.appendChild(E.div(data_profile='output'))
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
def create_option_group(group_name, profiles_, container, get_option_value_, get_option_default_value_, is_option_disabled_, get_option_help_, on_close):
|
def create_option_group(group_name, profiles_, container, get_option_value_, get_option_default_value_, is_option_disabled_, get_option_help_, on_close):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user