mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Optional inline TOC for RB, PDB, TXT, FB2 output.
This commit is contained in:
parent
12c99d6a9d
commit
a0821a6882
@ -104,7 +104,7 @@ class FB2MLizer(object):
|
|||||||
'</description>\n<body>\n<section>' % (author_first, author_middle,
|
'</description>\n<body>\n<section>' % (author_first, author_middle,
|
||||||
author_last, self.oeb_book.metadata.title[0].value,
|
author_last, self.oeb_book.metadata.title[0].value,
|
||||||
__appname__, __version__)
|
__appname__, __version__)
|
||||||
|
|
||||||
def get_cover_page(self):
|
def get_cover_page(self):
|
||||||
output = u''
|
output = u''
|
||||||
if 'titlepage' in self.oeb_book.guide:
|
if 'titlepage' in self.oeb_book.guide:
|
||||||
|
@ -18,8 +18,7 @@ class FB2Output(OutputFormatPlugin):
|
|||||||
options = set([
|
options = set([
|
||||||
OptionRecommendation(name='inline_toc',
|
OptionRecommendation(name='inline_toc',
|
||||||
recommended_value=False, level=OptionRecommendation.LOW,
|
recommended_value=False, level=OptionRecommendation.LOW,
|
||||||
help=_('Add Table of Contents to begenning of the book. Useful if '
|
help=_('Add Table of Contents to begenning of the book.')),
|
||||||
'the book has its own table of contents.')),
|
|
||||||
])
|
])
|
||||||
|
|
||||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from calibre.customize.conversion import OutputFormatPlugin
|
|
||||||
from calibre.ebooks.pdb.ereader.writer import Writer
|
|
||||||
|
|
||||||
class EREADEROutput(OutputFormatPlugin):
|
|
||||||
|
|
||||||
name = 'eReader PDB Output'
|
|
||||||
author = 'John Schember'
|
|
||||||
file_type = 'erpdb'
|
|
||||||
|
|
||||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
|
||||||
writer = Writer(log)
|
|
||||||
|
|
||||||
close = False
|
|
||||||
if not hasattr(output_path, 'write'):
|
|
||||||
close = True
|
|
||||||
if not os.path.exists(os.path.dirname(output_path)) and os.path.dirname(output_path) != '':
|
|
||||||
os.makedirs(os.path.dirname(output_path))
|
|
||||||
out_stream = open(output_path, 'wb')
|
|
||||||
else:
|
|
||||||
out_stream = output_path
|
|
||||||
|
|
||||||
out_stream.seek(0)
|
|
||||||
out_stream.truncate()
|
|
||||||
|
|
||||||
writer.dump(oeb_book, out_stream)
|
|
||||||
|
|
||||||
if close:
|
|
||||||
out_stream.close()
|
|
||||||
|
|
@ -27,6 +27,9 @@ class PDBOutput(OutputFormatPlugin):
|
|||||||
help=_('Specify the character encoding of the output document. ' \
|
help=_('Specify the character encoding of the output document. ' \
|
||||||
'The default is cp1252. Note: This option is not honored by all ' \
|
'The default is cp1252. Note: This option is not honored by all ' \
|
||||||
'formats.')),
|
'formats.')),
|
||||||
|
OptionRecommendation(name='inline_toc',
|
||||||
|
recommended_value=False, level=OptionRecommendation.LOW,
|
||||||
|
help=_('Add Table of Contents to begenning of the book.')),
|
||||||
])
|
])
|
||||||
|
|
||||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
||||||
|
@ -31,8 +31,10 @@ class PMLOutput(OutputFormatPlugin):
|
|||||||
OptionRecommendation(name='output_encoding', recommended_value='cp1252',
|
OptionRecommendation(name='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. ' \
|
||||||
'The default is cp1252. Note: This option is not honored by all ' \
|
'The default is cp1252.')),
|
||||||
'formats.')),
|
OptionRecommendation(name='inline_toc',
|
||||||
|
recommended_value=False, level=OptionRecommendation.LOW,
|
||||||
|
help=_('Add Table of Contents to begenning of the book.')),
|
||||||
])
|
])
|
||||||
|
|
||||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
||||||
|
@ -85,6 +85,15 @@ class PMLMLizer(object):
|
|||||||
def pmlmlize_spine(self):
|
def pmlmlize_spine(self):
|
||||||
self.image_hrefs = {}
|
self.image_hrefs = {}
|
||||||
self.link_hrefs = {}
|
self.link_hrefs = {}
|
||||||
|
output = u''
|
||||||
|
output += self.get_cover_page()
|
||||||
|
output += u'ghji87yhjko0Caliblre-toc-placeholder-for-insertion-later8ujko0987yjk'
|
||||||
|
output += self.get_text()
|
||||||
|
output = output.replace(u'ghji87yhjko0Caliblre-toc-placeholder-for-insertion-later8ujko0987yjk', self.get_toc())
|
||||||
|
output = self.clean_text(output)
|
||||||
|
return output
|
||||||
|
|
||||||
|
def get_cover_page(self):
|
||||||
output = u''
|
output = u''
|
||||||
if 'titlepage' in self.oeb_book.guide:
|
if 'titlepage' in self.oeb_book.guide:
|
||||||
self.log.debug('Generating title page...')
|
self.log.debug('Generating title page...')
|
||||||
@ -93,14 +102,28 @@ class PMLMLizer(object):
|
|||||||
if item.spine_position is None:
|
if item.spine_position is None:
|
||||||
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
||||||
output += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
|
output += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
|
||||||
|
return output
|
||||||
|
|
||||||
|
def get_toc(self):
|
||||||
|
toc = u''
|
||||||
|
if self.opts.inline_toc:
|
||||||
|
self.log.debug('Generating table of contents...')
|
||||||
|
toc += u'\\X0%s\\X0\n\n' % _('Table of Contents:')
|
||||||
|
for item in self.oeb_book.toc:
|
||||||
|
if item.href in self.link_hrefs.keys():
|
||||||
|
toc += '* \\q="#%s"%s\\q\n' % (self.link_hrefs[item.href], item.title)
|
||||||
|
else:
|
||||||
|
self.oeb.warn('Ignoring toc item: %s not found in document.' % item)
|
||||||
|
return toc
|
||||||
|
|
||||||
|
def get_text(self):
|
||||||
|
text = u''
|
||||||
for item in self.oeb_book.spine:
|
for item in self.oeb_book.spine:
|
||||||
self.log.debug('Converting %s to PML markup...' % item.href)
|
self.log.debug('Converting %s to PML markup...' % item.href)
|
||||||
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
||||||
output += self.add_page_anchor(item)
|
text += self.add_page_anchor(item)
|
||||||
output += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
|
text += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
|
||||||
output = self.clean_text(output)
|
return text
|
||||||
|
|
||||||
return output
|
|
||||||
|
|
||||||
def add_page_anchor(self, page):
|
def add_page_anchor(self, page):
|
||||||
return self.get_anchor(page, '')
|
return self.get_anchor(page, '')
|
||||||
|
@ -6,7 +6,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from calibre.customize.conversion import OutputFormatPlugin
|
from calibre.customize.conversion import OutputFormatPlugin, OptionRecommendation
|
||||||
from calibre.ebooks.rb.writer import RBWriter
|
from calibre.ebooks.rb.writer import RBWriter
|
||||||
|
|
||||||
class RBOutput(OutputFormatPlugin):
|
class RBOutput(OutputFormatPlugin):
|
||||||
@ -15,6 +15,12 @@ class RBOutput(OutputFormatPlugin):
|
|||||||
author = 'John Schember'
|
author = 'John Schember'
|
||||||
file_type = 'rb'
|
file_type = 'rb'
|
||||||
|
|
||||||
|
options = set([
|
||||||
|
OptionRecommendation(name='inline_toc',
|
||||||
|
recommended_value=False, level=OptionRecommendation.LOW,
|
||||||
|
help=_('Add Table of Contents to begenning of the book.')),
|
||||||
|
])
|
||||||
|
|
||||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
||||||
close = False
|
close = False
|
||||||
if not hasattr(output_path, 'write'):
|
if not hasattr(output_path, 'write'):
|
||||||
|
@ -72,6 +72,16 @@ class RBMLizer(object):
|
|||||||
def mlize_spine(self):
|
def mlize_spine(self):
|
||||||
self.link_hrefs = {}
|
self.link_hrefs = {}
|
||||||
output = u'<HTML><HEAD><TITLE></TITLE></HEAD><BODY>'
|
output = u'<HTML><HEAD><TITLE></TITLE></HEAD><BODY>'
|
||||||
|
output += self.get_cover_page()
|
||||||
|
output += u'ghji87yhjko0Caliblre-toc-placeholder-for-insertion-later8ujko0987yjk'
|
||||||
|
output += self.get_text()
|
||||||
|
output += u'</BODY></HTML>'
|
||||||
|
output = output.replace(u'ghji87yhjko0Caliblre-toc-placeholder-for-insertion-later8ujko0987yjk', self.get_toc())
|
||||||
|
output = self.clean_text(output)
|
||||||
|
return output
|
||||||
|
|
||||||
|
def get_cover_page(self):
|
||||||
|
output = u''
|
||||||
if 'titlepage' in self.oeb_book.guide:
|
if 'titlepage' in self.oeb_book.guide:
|
||||||
self.log.debug('Generating cover page...')
|
self.log.debug('Generating cover page...')
|
||||||
href = self.oeb_book.guide['titlepage'].href
|
href = self.oeb_book.guide['titlepage'].href
|
||||||
@ -79,13 +89,28 @@ class RBMLizer(object):
|
|||||||
if item.spine_position is None:
|
if item.spine_position is None:
|
||||||
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
||||||
output += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
|
output += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
|
||||||
|
return output
|
||||||
|
|
||||||
|
def get_toc(self):
|
||||||
|
toc = u''
|
||||||
|
if self.opts.inline_toc:
|
||||||
|
self.log.debug('Generating table of contents...')
|
||||||
|
toc += u'<H1>%s</H1><UL>\n' % _('Table of Contents:')
|
||||||
|
for item in self.oeb_book.toc:
|
||||||
|
if item.href in self.link_hrefs.keys():
|
||||||
|
toc += '<LI><A HREF="#%s">%s</A></LI>\n' % (self.link_hrefs[item.href], item.title)
|
||||||
|
else:
|
||||||
|
self.oeb.warn('Ignoring toc item: %s not found in document.' % item)
|
||||||
|
toc += '</UL>'
|
||||||
|
return toc
|
||||||
|
|
||||||
|
def get_text(self):
|
||||||
|
output = u''
|
||||||
for item in self.oeb_book.spine:
|
for item in self.oeb_book.spine:
|
||||||
self.log.debug('Converting %s to RocketBook HTML...' % item.href)
|
self.log.debug('Converting %s to RocketBook HTML...' % item.href)
|
||||||
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
||||||
output += self.add_page_anchor(item)
|
output += self.add_page_anchor(item)
|
||||||
output += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
|
output += self.dump_text(item.data.find(XHTML('body')), stylizer, item)
|
||||||
output += u'</BODY></HTML>'
|
|
||||||
output = self.clean_text(output)
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def add_page_anchor(self, page):
|
def add_page_anchor(self, page):
|
||||||
|
@ -30,7 +30,10 @@ class TXTOutput(OutputFormatPlugin):
|
|||||||
help=_('Specify the character encoding of the output document. ' \
|
help=_('Specify the character encoding of the output document. ' \
|
||||||
'The default is utf-8. Note: This option is not honored by all ' \
|
'The default is utf-8. Note: This option is not honored by all ' \
|
||||||
'formats.')),
|
'formats.')),
|
||||||
])
|
OptionRecommendation(name='inline_toc',
|
||||||
|
recommended_value=False, level=OptionRecommendation.LOW,
|
||||||
|
help=_('Add Table of Contents to begenning of the book.')),
|
||||||
|
])
|
||||||
|
|
||||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
||||||
writer = TXTMLizer(log)
|
writer = TXTMLizer(log)
|
||||||
|
@ -44,6 +44,7 @@ class TXTMLizer(object):
|
|||||||
|
|
||||||
def mlize_spine(self):
|
def mlize_spine(self):
|
||||||
output = u''
|
output = u''
|
||||||
|
output += self.get_toc()
|
||||||
for item in self.oeb_book.spine:
|
for item in self.oeb_book.spine:
|
||||||
self.log.debug('Converting %s to TXT...' % item.href)
|
self.log.debug('Converting %s to TXT...' % item.href)
|
||||||
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts.output_profile)
|
||||||
@ -62,6 +63,15 @@ class TXTMLizer(object):
|
|||||||
|
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
def get_toc(self):
|
||||||
|
toc = u''
|
||||||
|
if getattr(self.opts, 'inline_toc', None):
|
||||||
|
self.log.debug('Generating table of contents...')
|
||||||
|
toc += u'%s\n\n' % _(u'Table of Contents:')
|
||||||
|
for item in self.oeb_book.toc:
|
||||||
|
toc += u'* %s\n\n' % item.title
|
||||||
|
return toc
|
||||||
|
|
||||||
def cleanup_text(self, text):
|
def cleanup_text(self, text):
|
||||||
self.log.debug('\tClean up text...')
|
self.log.debug('\tClean up text...')
|
||||||
# Replace bad characters.
|
# Replace bad characters.
|
||||||
|
20
src/calibre/gui2/convert/fb2_output.py
Normal file
20
src/calibre/gui2/convert/fb2_output.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
from calibre.gui2.convert.fb2_output_ui import Ui_Form
|
||||||
|
from calibre.gui2.convert import Widget
|
||||||
|
|
||||||
|
format_model = None
|
||||||
|
|
||||||
|
class PluginWidget(Widget, Ui_Form):
|
||||||
|
|
||||||
|
TITLE = _('FB2 Output')
|
||||||
|
HELP = _('Options specific to')+' FB2 '+_('output')
|
||||||
|
|
||||||
|
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
||||||
|
Widget.__init__(self, parent, 'fb2_output', ['inline_toc'])
|
||||||
|
self.db, self.book_id = db, book_id
|
||||||
|
self.initialize_options(get_option, get_help, db, book_id)
|
41
src/calibre/gui2/convert/fb2_output.ui
Normal file
41
src/calibre/gui2/convert/fb2_output.ui
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Form</class>
|
||||||
|
<widget class="QWidget" name="Form">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>246</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="opt_inline_toc">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Inline TOC</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -17,7 +17,7 @@ class PluginWidget(Widget, Ui_Form):
|
|||||||
HELP = _('Options specific to')+' PDB '+_('output')
|
HELP = _('Options specific to')+' PDB '+_('output')
|
||||||
|
|
||||||
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
||||||
Widget.__init__(self, parent, 'pdb_output', ['format'])
|
Widget.__init__(self, parent, 'pdb_output', ['format', 'inline_toc'])
|
||||||
self.db, self.book_id = db, book_id
|
self.db, self.book_id = db, book_id
|
||||||
self.initialize_options(get_option, get_help, db, book_id)
|
self.initialize_options(get_option, get_help, db, book_id)
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QComboBox" name="opt_format"/>
|
<widget class="QComboBox" name="opt_format"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -40,6 +40,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="opt_inline_toc">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Inline TOC</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
20
src/calibre/gui2/convert/rb_output.py
Normal file
20
src/calibre/gui2/convert/rb_output.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
__license__ = 'GPL 3'
|
||||||
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
from calibre.gui2.convert.rb_output_ui import Ui_Form
|
||||||
|
from calibre.gui2.convert import Widget
|
||||||
|
|
||||||
|
format_model = None
|
||||||
|
|
||||||
|
class PluginWidget(Widget, Ui_Form):
|
||||||
|
|
||||||
|
TITLE = _('RB Output')
|
||||||
|
HELP = _('Options specific to')+' RB '+_('output')
|
||||||
|
|
||||||
|
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
||||||
|
Widget.__init__(self, parent, 'rb_output', ['inline_toc'])
|
||||||
|
self.db, self.book_id = db, book_id
|
||||||
|
self.initialize_options(get_option, get_help, db, book_id)
|
41
src/calibre/gui2/convert/rb_output.ui
Normal file
41
src/calibre/gui2/convert/rb_output.ui
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Form</class>
|
||||||
|
<widget class="QWidget" name="Form">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>246</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="opt_inline_toc">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Inline TOC</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -17,7 +17,7 @@ class PluginWidget(Widget, Ui_Form):
|
|||||||
HELP = _('Options specific to')+' TXT '+_('output')
|
HELP = _('Options specific to')+' TXT '+_('output')
|
||||||
|
|
||||||
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
||||||
Widget.__init__(self, parent, 'txt_output', ['newline'])
|
Widget.__init__(self, parent, 'txt_output', ['newline', 'inline_toc'])
|
||||||
self.db, self.book_id = db, book_id
|
self.db, self.book_id = db, book_id
|
||||||
self.initialize_options(get_option, get_help, db, book_id)
|
self.initialize_options(get_option, get_help, db, book_id)
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QComboBox" name="opt_newline"/>
|
<widget class="QComboBox" name="opt_newline"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -40,6 +40,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="opt_inline_toc">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Inline TOC</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user