mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 20:46:19 +01:00
Refresh editor containing toc is present when deleting files causes toc to change
This commit is contained in:
parent
746ceb6c66
commit
408a7b5d4f
1 changed files with 4 additions and 1 deletions
|
|
@ -23,7 +23,7 @@
|
|||
from calibre.ebooks.oeb.polish.pretty import fix_all_html, pretty_all
|
||||
from calibre.ebooks.oeb.polish.replace import rename_files, replace_file
|
||||
from calibre.ebooks.oeb.polish.split import split, merge, AbortError
|
||||
from calibre.ebooks.oeb.polish.toc import remove_names_from_toc
|
||||
from calibre.ebooks.oeb.polish.toc import remove_names_from_toc, find_existing_toc
|
||||
from calibre.gui2 import error_dialog, choose_files, question_dialog, info_dialog, choose_save_file
|
||||
from calibre.gui2.dialogs.confirm_delete import confirm
|
||||
from calibre.gui2.tweak_book import set_current_container, current_container, tprefs, actions, editors
|
||||
|
|
@ -266,6 +266,9 @@ def delete_requested(self, spine_items, other_items):
|
|||
self.gui.preview.clear()
|
||||
if remove_names_from_toc(current_container(), spine_names + list(other_items)):
|
||||
self.gui.toc_view.update_if_visible()
|
||||
toc = find_existing_toc(current_container())
|
||||
if toc and toc in editors:
|
||||
editors[toc].replace_data(c.raw_data(toc))
|
||||
|
||||
def commit_dirty_opf(self):
|
||||
c = current_container()
|
||||
|
|
|
|||
Loading…
Reference in a new issue