diff --git a/src/calibre/ebooks/conversion/plugins/mobi_output.py b/src/calibre/ebooks/conversion/plugins/mobi_output.py
index f07e01a53c..ab00346be9 100644
--- a/src/calibre/ebooks/conversion/plugins/mobi_output.py
+++ b/src/calibre/ebooks/conversion/plugins/mobi_output.py
@@ -88,6 +88,15 @@ class MOBIOutput(OutputFormatPlugin):
'formats. This option tells calibre not to do this. '
'Useful if your document contains lots of GIF/PNG images that '
'become very large when converted to JPEG.')),
+ OptionRecommendation(name='mobi_file_type', choices=['old', 'both',
+ 'new'], recommended_value='old',
+ help=_('By default calibre generates MOBI files that contain the '
+ 'old MOBI 6 format. This format is compatible with all '
+ 'devices. However, by changing this setting, you can tell '
+ 'calibre to generate MOBI files that contain both MOBI 6 and '
+ 'the new KF8 format, or only the new KF8 format. KF8 has '
+ 'more features than MOBI 6, but only works with newer Kindles.')),
+
])
def check_for_periodical(self):
@@ -165,11 +174,10 @@ class MOBIOutput(OutputFormatPlugin):
toc.nodes[0].href = toc.nodes[0].nodes[0].href
def convert(self, oeb, output_path, input_plugin, opts, log):
- from calibre.utils.config import tweaks
from calibre.ebooks.mobi.writer2.resources import Resources
self.log, self.opts, self.oeb = log, opts, oeb
- mobi_type = tweaks.get('test_mobi_output_type', 'old')
+ mobi_type = opts.mobi_file_type
if self.is_periodical:
mobi_type = 'old' # Amazon does not support KF8 periodicals
create_kf8 = mobi_type in ('new', 'both')
diff --git a/src/calibre/gui2/convert/mobi_output.py b/src/calibre/gui2/convert/mobi_output.py
index 50b67008d9..ac2bf15164 100644
--- a/src/calibre/gui2/convert/mobi_output.py
+++ b/src/calibre/gui2/convert/mobi_output.py
@@ -25,7 +25,7 @@ class PluginWidget(Widget, Ui_Form):
'mobi_keep_original_images',
'mobi_ignore_margins', 'mobi_toc_at_start',
'dont_compress', 'no_inline_toc', 'share_not_sync',
- 'personal_doc']#, 'mobi_navpoints_only_deepest']
+ 'personal_doc', 'mobi_file_type']
)
self.db, self.book_id = db, book_id
@@ -48,6 +48,7 @@ class PluginWidget(Widget, Ui_Form):
self.font_family_model = font_family_model
self.opt_masthead_font.setModel(self.font_family_model)
'''
+ self.opt_mobi_file_type.addItems(['old', 'both', 'new'])
self.initialize_options(get_option, get_help, db, book_id)
diff --git a/src/calibre/gui2/convert/mobi_output.ui b/src/calibre/gui2/convert/mobi_output.ui
index 2c62b8c27a..8c1c107620 100644
--- a/src/calibre/gui2/convert/mobi_output.ui
+++ b/src/calibre/gui2/convert/mobi_output.ui
@@ -14,80 +14,10 @@
Form
- -
-
-
- Kindle options
-
-
-
-
-
-
-
-
-
- Personal Doc tag:
-
-
-
- -
-
-
-
-
- -
-
-
- Enable sharing of book content via Facebook, etc. WARNING: Disables last read syncing
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
+
-
+
- Put generated Table of Contents at &start of book instead of end
-
-
-
- -
-
-
- Ignore &margins
-
-
-
- -
-
-
- Use author &sort for author
+ Do not add Table of Contents to book
@@ -104,17 +34,24 @@
-
- -
-
+
-
+
- Disable compression of the file contents
+ Put generated Table of Contents at &start of book instead of end
- -
-
+
-
+
- Do not add Table of Contents to book
+ Ignore &margins
+
+
+
+ -
+
+
+ Use author &sort for author
@@ -125,6 +62,55 @@
+ -
+
+
+ Disable compression of the file contents
+
+
+
+ -
+
+
+ Kindle options
+
+
+
+ QFormLayout::ExpandingFieldsGrow
+
+
-
+
+
+ MOBI file &type:
+
+
+ opt_mobi_file_type
+
+
+
+ -
+
+
+ -
+
+
+ Personal Doc tag:
+
+
+
+ -
+
+
+ -
+
+
+ Enable sharing of book content via Facebook, etc. WARNING: Disables last read syncing
+
+
+
+
+
+