UI for MOBI output options

This commit is contained in:
Kovid Goyal 2018-07-04 15:20:04 +05:30
parent 8f1dd430e3
commit 19d2561f81
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 19 additions and 2 deletions

View File

@ -42,6 +42,7 @@ class MOBIOutput(OutputFormatPlugin):
author = 'Kovid Goyal'
file_type = 'mobi'
commit_name = 'mobi_output'
ui_data = {'file_types': ['old', 'both', 'new']}
options = set([
OptionRecommendation(name='prefer_author_sort',
@ -96,8 +97,7 @@ class MOBIOutput(OutputFormatPlugin):
'formats. This option tells calibre not to do this. '
'Useful if your document contains lots of GIF/PNG images that '
'become very large when converted to JPEG.')),
OptionRecommendation(name='mobi_file_type', choices=['old', 'both',
'new'], recommended_value='old',
OptionRecommendation(name='mobi_file_type', choices=ui_data['file_types'], recommended_value='old',
help=_('By default calibre generates MOBI files that contain the '
'old MOBI 6 format. This format is compatible with all '
'devices. However, by changing this setting, you can tell '

View File

@ -587,6 +587,23 @@ def lrf_output(container):
g.appendChild(lineedit('mono_family', _('&Monospace font family:')))
# }}}
# MOBI Output {{{
@ep
def mobi_output(container):
g = E.div(class_='simple-group')
container.appendChild(g)
g.appendChild(checkbox('no_inline_toc', _('Do not add &Table of Contents to book')))
g.appendChild(lineedit('toc_title', indent + _('&Title for Table of Contents:')))
g.appendChild(checkbox('mobi_toc_at_start', _('Put generated Table of Contents at &start of book instead of end')))
g.appendChild(checkbox('mobi_ignore_margins', _('Ignore &margins')))
g.appendChild(checkbox('prefer_author_sort', _('Use author &sort for author')))
g.appendChild(checkbox('mobi_keep_original_images', _('Do not convert all images to &JPEG (may result in images not working in older viewers)')))
g.appendChild(checkbox('dont_compress', _('Disable &compression of the file contents')))
g.appendChild(choices('mobi_file_type', _('MOBI fi&le type:'), ui_data.file_types))
g.appendChild(lineedit('personal_doc', _('Personal Doc tag:')))
g.appendChild(checkbox('share_not_sync', _('Enable &sharing of book content via Facebook, etc. WARNING: Disables last read syncing')))
# }}}
def restore_defaults():
for setting in registry:
set(setting, get_option_default_value(setting))