diff --git a/src/calibre/ebooks/comic/input.py b/src/calibre/ebooks/comic/input.py
index c9b11e31f2..7710d41fb3 100755
--- a/src/calibre/ebooks/comic/input.py
+++ b/src/calibre/ebooks/comic/input.py
@@ -304,6 +304,10 @@ class ComicInput(InputFormatPlugin):
help=_('Specify the image size as widthxheight pixels. Normally,'
' an image size is automatically calculated from the output '
'profile, this option overrides it.')),
+ OptionRecommendation(name='dont_add_comic_pages_to_toc', recommended_value=False,
+ help=_('When converting a CBC do not add links to each page to'
+ ' the TOC. Note this only applies if the TOC has more than one'
+ ' section')),
])
recommendations = set([
@@ -449,10 +453,11 @@ class ComicInput(InputFormatPlugin):
wrappers = comic[2]
stoc = toc.add_item(href(wrappers[0]),
None, comic[0], play_order=po)
- for i, x in enumerate(wrappers):
- stoc.add_item(href(x), None,
- _('Page')+' %d'%(i+1), play_order=po)
- po += 1
+ if not opts.dont_add_comic_pages_to_toc:
+ for i, x in enumerate(wrappers):
+ stoc.add_item(href(x), None,
+ _('Page')+' %d'%(i+1), play_order=po)
+ po += 1
opf.set_toc(toc)
m, n = open('metadata.opf', 'wb'), open('toc.ncx', 'wb')
opf.render(m, n, 'toc.ncx')
diff --git a/src/calibre/gui2/convert/comic_input.py b/src/calibre/gui2/convert/comic_input.py
index f7f8023c0e..ed8053b8e6 100644
--- a/src/calibre/gui2/convert/comic_input.py
+++ b/src/calibre/gui2/convert/comic_input.py
@@ -22,7 +22,8 @@ class PluginWidget(Widget, Ui_Form):
['colors', 'dont_normalize', 'keep_aspect_ratio', 'right2left',
'despeckle', 'no_sort', 'no_process', 'landscape',
'dont_sharpen', 'disable_trim', 'wide', 'output_format',
- 'dont_grayscale', 'comic_image_size']
+ 'dont_grayscale', 'comic_image_size',
+ 'dont_add_comic_pages_to_toc']
)
self.db, self.book_id = db, book_id
for x in get_option('output_format').option.choices:
diff --git a/src/calibre/gui2/convert/comic_input.ui b/src/calibre/gui2/convert/comic_input.ui
index 52c0ad2bb5..676032942f 100644
--- a/src/calibre/gui2/convert/comic_input.ui
+++ b/src/calibre/gui2/convert/comic_input.ui
@@ -14,7 +14,7 @@
Form
- -
+
-
&Number of Colors:
@@ -24,7 +24,7 @@
- -
+
-
8
@@ -37,70 +37,70 @@
- -
+
-
Disable &normalize
- -
+
-
Keep &aspect ratio
- -
+
-
Disable &Sharpening
- -
+
-
Disable &Trimming
- -
+
-
&Wide
- -
+
-
&Landscape
- -
+
-
&Right to left
- -
+
-
Don't so&rt
- -
+
-
De&speckle
- -
+
-
Qt::Vertical
@@ -120,7 +120,7 @@
- -
+
-
&Output format:
@@ -130,7 +130,7 @@
- -
+
-
-
@@ -140,7 +140,7 @@
- -
+
-
Override image &size:
@@ -150,9 +150,16 @@
- -
+
-
+ -
+
+
+ Don't add links to &pages to the Table of Contents for CBC files
+
+
+