From 202137dc22df40229da46f97c0a99f8ef90637a5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 Jul 2018 15:27:36 +0530 Subject: [PATCH] Ui for PDB output options --- src/calibre/ebooks/conversion/plugins/pdb_output.py | 4 ++-- src/pyj/book_list/conversion_widgets.pyj | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/conversion/plugins/pdb_output.py b/src/calibre/ebooks/conversion/plugins/pdb_output.py index 64addc05cc..e567f26fc3 100644 --- a/src/calibre/ebooks/conversion/plugins/pdb_output.py +++ b/src/calibre/ebooks/conversion/plugins/pdb_output.py @@ -17,13 +17,13 @@ class PDBOutput(OutputFormatPlugin): author = 'John Schember' file_type = 'pdb' commit_name = 'pdb_output' + ui_data = {'formats': tuple(ALL_FORMAT_WRITERS)} options = set([ OptionRecommendation(name='format', recommended_value='doc', level=OptionRecommendation.LOW, short_switch='f', choices=list(ALL_FORMAT_WRITERS), - help=(_('Format to use inside the pdb container. Choices are:')+ - ' %s' % sorted(ALL_FORMAT_WRITERS))), + help=(_('Format to use inside the pdb container. Choices are:') + ' %s' % sorted(ALL_FORMAT_WRITERS))), OptionRecommendation(name='pdb_output_encoding', recommended_value='cp1252', level=OptionRecommendation.LOW, help=_('Specify the character encoding of the output document. ' diff --git a/src/pyj/book_list/conversion_widgets.pyj b/src/pyj/book_list/conversion_widgets.pyj index a3360d3944..3a09605b4f 100644 --- a/src/pyj/book_list/conversion_widgets.pyj +++ b/src/pyj/book_list/conversion_widgets.pyj @@ -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'))) # }}} +# 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(): for setting in registry: set(setting, get_option_default_value(setting))