Ui for PDB output options

This commit is contained in:
Kovid Goyal 2018-07-04 15:27:36 +05:30
parent 664ddf49cc
commit 202137dc22
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 12 additions and 2 deletions

View File

@ -17,13 +17,13 @@ class PDBOutput(OutputFormatPlugin):
author = 'John Schember' author = 'John Schember'
file_type = 'pdb' file_type = 'pdb'
commit_name = 'pdb_output' commit_name = 'pdb_output'
ui_data = {'formats': tuple(ALL_FORMAT_WRITERS)}
options = set([ options = set([
OptionRecommendation(name='format', recommended_value='doc', OptionRecommendation(name='format', recommended_value='doc',
level=OptionRecommendation.LOW, level=OptionRecommendation.LOW,
short_switch='f', choices=list(ALL_FORMAT_WRITERS), short_switch='f', choices=list(ALL_FORMAT_WRITERS),
help=(_('Format to use inside the pdb container. Choices are:')+ help=(_('Format to use inside the pdb container. Choices are:') + ' %s' % sorted(ALL_FORMAT_WRITERS))),
' %s' % sorted(ALL_FORMAT_WRITERS))),
OptionRecommendation(name='pdb_output_encoding', recommended_value='cp1252', OptionRecommendation(name='pdb_output_encoding', recommended_value='cp1252',
level=OptionRecommendation.LOW, level=OptionRecommendation.LOW,
help=_('Specify the character encoding of the output document. ' help=_('Specify the character encoding of the output document. '

View File

@ -617,6 +617,16 @@ def azw3_output(container):
g.appendChild(checkbox('share_not_sync', _('Enable &sharing of book content via Facebook, etc. WARNING: Disables last read syncing'))) g.appendChild(checkbox('share_not_sync', _('Enable &sharing of book content via Facebook, etc. WARNING: Disables last read syncing')))
# }}} # }}}
# PDB Output {{{
@ep
def pdb_output(container):
g = E.div(class_='simple-group')
container.appendChild(g)
g.appendChild(choices('format', _('Forma&t:'), ui_data.formats))
g.appendChild(lineedit('pdb_output_encoding', _('O&utput encoding:')))
g.appendChild(checkbox('inline_toc', _('&Inline TOC')))
# }}}
def restore_defaults(): def restore_defaults():
for setting in registry: for setting in registry:
set(setting, get_option_default_value(setting)) set(setting, get_option_default_value(setting))