diff --git a/src/calibre/ebooks/docx/to_html.py b/src/calibre/ebooks/docx/to_html.py index be0576d2b9..05b4b7e9d3 100644 --- a/src/calibre/ebooks/docx/to_html.py +++ b/src/calibre/ebooks/docx/to_html.py @@ -279,7 +279,7 @@ class Convert(object): self.styles.resolve_numbering(numbering) def write(self, doc): - toc = create_toc(doc, self.body, self.resolved_link_map, self.styles, self.object_map) + toc = create_toc(doc, self.body, self.resolved_link_map, self.styles, self.object_map, self.log) raw = html.tostring(self.html, encoding='utf-8', doctype='') with open(os.path.join(self.dest_dir, 'index.html'), 'wb') as f: f.write(raw) diff --git a/src/calibre/ebooks/docx/toc.py b/src/calibre/ebooks/docx/toc.py index 5936d34355..314dc2479d 100644 --- a/src/calibre/ebooks/docx/toc.py +++ b/src/calibre/ebooks/docx/toc.py @@ -21,7 +21,7 @@ class Count(object): def __init__(self): self.val = 0 -def from_headings(body): +def from_headings(body, log): ' Create a TOC from headings in the document ' headings = ('h1', 'h2', 'h3') tocroot = TOC() @@ -58,6 +58,7 @@ def from_headings(body): level_prev[i] = None if len(tuple(tocroot.flat())) > 1: + log('Generating Table of Contents from headings') return tocroot def structure_toc(entries): @@ -98,7 +99,7 @@ def link_to_txt(a, styles, object_map): return tostring(a, method='text', with_tail=False, encoding=unicode).strip() -def from_toc(docx, link_map, styles, object_map): +def from_toc(docx, link_map, styles, object_map, log): toc_level = None level = 0 TI = namedtuple('TI', 'text anchor indent') @@ -132,9 +133,10 @@ def from_toc(docx, link_map, styles, object_map): ml = 0 toc.append(TI(txt, href[1:], ml)) if toc: + log('Found Word Table of Contents, using it to generate the Table of Contents') return structure_toc(toc) -def create_toc(docx, body, link_map, styles, object_map): - return from_toc(docx, link_map, styles, object_map) or from_headings(body) +def create_toc(docx, body, link_map, styles, object_map, log): + return from_toc(docx, link_map, styles, object_map, log) or from_headings(body, log) diff --git a/src/calibre/gui2/actions/match_books.py b/src/calibre/gui2/actions/match_books.py index 28b6afeba9..93e1cffa43 100644 --- a/src/calibre/gui2/actions/match_books.py +++ b/src/calibre/gui2/actions/match_books.py @@ -1,8 +1,10 @@ #!/usr/bin/env python -# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai +# vim:fileencoding=utf-8 +from __future__ import (unicode_literals, division, absolute_import, + print_function) __license__ = 'GPL v3' -__copyright__ = '2010, Kovid Goyal ' +__copyright__ = '2013, Kovid Goyal ' __docformat__ = 'restructuredtext en' from calibre.gui2 import error_dialog diff --git a/src/calibre/gui2/dialogs/match_books.py b/src/calibre/gui2/dialogs/match_books.py index 847d1cbc70..6914c8bb84 100644 --- a/src/calibre/gui2/dialogs/match_books.py +++ b/src/calibre/gui2/dialogs/match_books.py @@ -1,6 +1,10 @@ #!/usr/bin/env python +# vim:fileencoding=utf-8 +from __future__ import (unicode_literals, division, absolute_import, + print_function) + __license__ = 'GPL v3' -__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' +__copyright__ = '2013, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' @@ -158,7 +162,7 @@ class MatchBooks(QDialog, Ui_MatchBooks): self.save_state() def book_clicked(self, row, column): - self.book_selected = True; + self.book_selected = True id_ = self.books_table.item(row, 0).data(Qt.UserRole).toInt()[0] self.current_library_book_id = id_ @@ -194,4 +198,5 @@ class MatchBooks(QDialog, Ui_MatchBooks): def reject(self): self.close() - QDialog.reject(self) \ No newline at end of file + QDialog.reject(self) + diff --git a/src/calibre/gui2/dialogs/match_books.ui b/src/calibre/gui2/dialogs/match_books.ui index 814b3b831d..4da7038316 100644 --- a/src/calibre/gui2/dialogs/match_books.ui +++ b/src/calibre/gui2/dialogs/match_books.ui @@ -6,7 +6,7 @@ 0 0 - 768 + 751 342 @@ -50,7 +50,7 @@ - + Do a search to find the book you want to match @@ -59,24 +59,26 @@ - + 4 0 - + 0 - + 0 - + - <p>Be sure to update metadata on the device when you are - finished matching books (Device -> Update Metadata)</p> + <p>Remember to update metadata on the device when you are done (Right click the device icon and select <i>Update cached metadata</i>)</p> + + + true @@ -109,7 +111,6 @@ - HistoryLineEdit @@ -117,6 +118,7 @@
calibre/gui2/widgets.h
+ buttonBox diff --git a/src/calibre/gui2/layout.py b/src/calibre/gui2/layout.py index d8d91b99af..20c2588bb4 100644 --- a/src/calibre/gui2/layout.py +++ b/src/calibre/gui2/layout.py @@ -61,7 +61,7 @@ class LocationManager(QObject): # {{{ a = m.addAction(QIcon(I('config.png')), _('Configure this device')) a.triggered.connect(self._configure_requested) self._mem.append(a) - a = m.addAction(QIcon(I('sync.png')), _('Update metadata on device')) + a = m.addAction(QIcon(I('sync.png')), _('Update cached metadata on device')) a.triggered.connect(lambda x : self.update_device_metadata.emit()) self._mem.append(a)