From 7471f00b0415f83e9cc0b3b85bdf439ff8d9f850 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 3 Aug 2011 23:09:42 -0600 Subject: [PATCH] MOBI Output: Remove option to choose masthead font as the font selection control causes crashes on some windows systems --- src/calibre/ebooks/mobi/output.py | 7 ------- src/calibre/ebooks/mobi/writer.py | 3 +-- src/calibre/gui2/convert/mobi_output.py | 11 +++++++---- src/calibre/gui2/convert/mobi_output.ui | 23 +++-------------------- 4 files changed, 11 insertions(+), 33 deletions(-) diff --git a/src/calibre/ebooks/mobi/output.py b/src/calibre/ebooks/mobi/output.py index 4451bc66b8..542889f506 100644 --- a/src/calibre/ebooks/mobi/output.py +++ b/src/calibre/ebooks/mobi/output.py @@ -55,13 +55,6 @@ class MOBIOutput(OutputFormatPlugin): ' specified directory. If the directory already ' 'exists, it will be deleted.') ), - OptionRecommendation(name='mobi_navpoints_only_deepest', - recommended_value=False, - help=_('When adding navpoints for the chapter-to-chapter' - ' navigation on the kindle, use only the lowest level ' - 'of items in the TOC, instead of items at every level.') - ), - OptionRecommendation(name='kindlegen', recommended_value=False, help=('Use kindlegen (must be in your PATH) to generate the' diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 55e3ad0b03..90747d0a73 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -1710,8 +1710,7 @@ class MobiWriter(object): ''' from calibre.ebooks.oeb.base import TOC items = list(self._oeb.toc.iterdescendants()) - if self.opts.mobi_navpoints_only_deepest: - items = [i for i in items if i.depth == 1] + items = [i for i in items if i.depth == 1] offsets = {i:self._id_offsets.get(i.href, -1) for i in items if i.href} items = [i for i in items if offsets[i] > -1] items.sort(key=lambda i:offsets[i]) diff --git a/src/calibre/gui2/convert/mobi_output.py b/src/calibre/gui2/convert/mobi_output.py index 4bbf15e3ef..f268ac8606 100644 --- a/src/calibre/gui2/convert/mobi_output.py +++ b/src/calibre/gui2/convert/mobi_output.py @@ -6,11 +6,9 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -from PyQt4.Qt import Qt from calibre.gui2.convert.mobi_output_ui import Ui_Form from calibre.gui2.convert import Widget -from calibre.gui2.widgets import FontFamilyModel font_family_model = None @@ -26,11 +24,13 @@ class PluginWidget(Widget, Ui_Form): ['prefer_author_sort', 'rescale_images', 'toc_title', 'mobi_ignore_margins', 'mobi_toc_at_start', 'dont_compress', 'no_inline_toc', - 'masthead_font','personal_doc', 'mobi_navpoints_only_deepest'] + 'personal_doc']#, 'mobi_navpoints_only_deepest'] ) - from calibre.utils.fonts import fontconfig self.db, self.book_id = db, book_id + ''' + from calibre.utils.fonts import fontconfig + global font_family_model if font_family_model is None: font_family_model = FontFamilyModel() @@ -46,9 +46,11 @@ class PluginWidget(Widget, Ui_Form): self.font_family_model = font_family_model self.opt_masthead_font.setModel(self.font_family_model) + ''' self.initialize_options(get_option, get_help, db, book_id) + ''' def set_value_handler(self, g, val): if unicode(g.objectName()) in 'opt_masthead_font': idx = -1 @@ -59,3 +61,4 @@ class PluginWidget(Widget, Ui_Form): g.setCurrentIndex(idx) return True return False + ''' diff --git a/src/calibre/gui2/convert/mobi_output.ui b/src/calibre/gui2/convert/mobi_output.ui index b849bff72c..7643d791f3 100644 --- a/src/calibre/gui2/convert/mobi_output.ui +++ b/src/calibre/gui2/convert/mobi_output.ui @@ -7,7 +7,7 @@ 0 0 521 - 331 + 342 @@ -55,22 +55,12 @@ - + Kindle options - - - - Periodical masthead font: - - - - - - @@ -101,7 +91,7 @@ - + Qt::Vertical @@ -128,13 +118,6 @@ - - - - Use only &lowest level of items in the TOC for chapter-to-chapter navigation - - -