From 80364863a9d2f8a8c78222d217c7223204147117 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 8 Apr 2021 14:29:59 +0530 Subject: [PATCH] Edit book: Upgrade book internals: Fix skipping the NCX removal dialog not remembering the chosen option. Fixes #1921604 [Suggestion about update book internal](https://bugs.launchpad.net/calibre/+bug/1921604) --- src/calibre/gui2/tweak_book/__init__.py | 1 + src/calibre/gui2/tweak_book/polish.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/__init__.py b/src/calibre/gui2/tweak_book/__init__.py index 7f365ba5ed..445e57199f 100644 --- a/src/calibre/gui2/tweak_book/__init__.py +++ b/src/calibre/gui2/tweak_book/__init__.py @@ -83,6 +83,7 @@ d['preserve_aspect_ratio_when_inserting_image'] = False d['file_list_shows_full_pathname'] = False d['auto_link_stylesheets'] = True d['check_external_link_anchors'] = True +d['remove_ncx'] = True del d ucase_map = {l:string.ascii_uppercase[i] for i, l in enumerate(string.ascii_lowercase)} diff --git a/src/calibre/gui2/tweak_book/polish.py b/src/calibre/gui2/tweak_book/polish.py index 5bb5c56bcb..32893f3d37 100644 --- a/src/calibre/gui2/tweak_book/polish.py +++ b/src/calibre/gui2/tweak_book/polish.py @@ -79,7 +79,7 @@ def get_customization(action, name, parent): if action == 'remove_unused_css': customize_remove_unused_css(name, parent, ans) elif action == 'upgrade_book': - ans['remove_ncx'] = question_dialog( + ans['remove_ncx'] = tprefs['remove_ncx'] = question_dialog( parent, _('Remove NCX ToC file'), _('Remove the legacy Table of Contents in NCX form?'), _('This form of Table of Contents is superseded by the new HTML based Table of Contents.' @@ -87,6 +87,7 @@ def get_customization(action, name, parent): ' old devices that lack proper support for EPUB 3'), skip_dialog_name='edit-book-remove-ncx', skip_dialog_msg=_('Ask this question again in the future'), + skip_dialog_skipped_value=tprefs['remove_ncx'], yes_text=_('Remove NCX'), no_text=_('Keep NCX') ) except Abort: