diff --git a/src/calibre/ebooks/epub/iterator.py b/src/calibre/ebooks/epub/iterator.py index e953cbda51..880377f11d 100644 --- a/src/calibre/ebooks/epub/iterator.py +++ b/src/calibre/ebooks/epub/iterator.py @@ -118,10 +118,16 @@ class EbookIterator(object): self.spine = [SpineItem(i.path) for i in self.opf.spine] cover = self.opf.cover - if os.path.splitext(self.pathtoebook)[1].lower() in ('.lit', '.mobi', '.prc') and cover: + if os.path.splitext(self.pathtoebook)[1].lower() in \ + ('.lit', '.mobi', '.prc') and cover: cfile = os.path.join(os.path.dirname(self.spine[0]), 'calibre_ei_cover.html') open(cfile, 'wb').write(TITLEPAGE%cover) self.spine[0:0] = [SpineItem(cfile)] + + if self.opf.path_to_html_toc is not None and \ + self.opf.path_to_html_toc not in self.spine: + self.spine.append(SpineItem(self.opf.path_to_html_toc)) + sizes = [i.character_count for i in self.spine] self.pages = [math.ceil(i/float(self.CHARACTERS_PER_PAGE)) for i in sizes] diff --git a/src/calibre/ebooks/metadata/opf2.py b/src/calibre/ebooks/metadata/opf2.py index c172d26e1a..86a1129b54 100644 --- a/src/calibre/ebooks/metadata/opf2.py +++ b/src/calibre/ebooks/metadata/opf2.py @@ -444,6 +444,7 @@ class OPF(object): if not hasattr(stream, 'read'): stream = open(stream, 'rb') self.basedir = self.base_dir = basedir + self.path_to_html_toc = None raw, self.encoding = xml_to_unicode(stream.read(), strip_encoding_pats=True, resolve_entities=True) raw = raw[raw.find('<'):] self.root = etree.fromstring(raw, self.PARSER) @@ -495,6 +496,7 @@ class OPF(object): if f: self.toc.read_ncx_toc(f[0]) else: + self.path_to_html_toc = toc self.toc.read_html_toc(toc) except: pass diff --git a/src/calibre/gui2/dialogs/metadata_single.ui b/src/calibre/gui2/dialogs/metadata_single.ui index c693cf3eea..8a5fc4f99d 100644 --- a/src/calibre/gui2/dialogs/metadata_single.ui +++ b/src/calibre/gui2/dialogs/metadata_single.ui @@ -1,7 +1,8 @@ - + + MetadataSingleDialog - - + + 0 0 @@ -9,36 +10,36 @@ 750 - - + + 0 0 - + Edit Meta Information - - + + :/images/edit_input.svg:/images/edit_input.svg - + true - + true - + - - + + QFrame::NoFrame - + true - - + + 0 0 @@ -46,65 +47,65 @@ 710 - - + + 0 - - + + 800 665 - + - - + + Qt::Horizontal - - + + - - + + Meta information - - - - + + + + &Title: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + title - - - + + + Change the title of this book - - - + + + Swap the author and title - + ... - - + + :/images/swap.svg:/images/swap.svg - + 16 16 @@ -112,305 +113,305 @@ - - - + + + &Author(s): - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + authors - - - + + + Author S&ort: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + author_sort - - + + - - + + Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles. - - + + Automatically create the author sort entry based on the current author entry - + ... - - + + :/images/auto_author_sort.svg:/images/auto_author_sort.svg - - - + + + &Rating: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + rating - - - + + + Rating of this book. 0-5 stars - + Rating of this book. 0-5 stars - + QAbstractSpinBox::PlusMinus - + stars - + 5 - - - + + + &Publisher: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + publisher - - - + + + Ta&gs: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + tags - - + + - - - Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas. + + + Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas. - - + + Open Tag Editor - + Open Tag Editor - - + + :/images/chapters.svg:/images/chapters.svg - - - + + + &Series: - + Qt::PlainText - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + series - - - + + + 5 - - - + + + 0 0 - + List of known series. You can add new series. - + List of known series. You can add new series. - + true - + QComboBox::InsertAlphabetically - + QComboBox::AdjustToContents - - + + Remove unused series (Series that have no books) - + ... - - + + :/images/trash.svg:/images/trash.svg - - - + + + false - + Series index. - + Series index. - + Book - + 1 - + 10000 - - - + + + IS&BN: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + isbn - - + + - - - + + + true - - + + - - + + Comments - - - + + + - - - Fetch metadata from server + + + &Fetch metadata from server - - + + - - - + + + 0 0 - + Available Formats - + - - - - - + + + + + 0 0 - + 16777215 130 - + 64 64 @@ -418,19 +419,19 @@ - - - + + + Add a new format for this book to the database - + ... - - + + :/images/add_book.svg:/images/add_book.svg - + 32 32 @@ -438,19 +439,19 @@ - - - + + + Remove the selected formats for this book from the database. - + ... - - + + :/images/trash.svg:/images/trash.svg - + 32 32 @@ -458,19 +459,19 @@ - - - + + + Set the cover for the book from the selected format - + ... - - + + :/images/book.svg:/images/book.svg - + 32 32 @@ -485,96 +486,96 @@ - - - + + + 0 10 - + Book Cover - + - - - + + + 0 0 - + - - :/images/book.svg + + :/images/book.svg - + true - - + + 6 - + QLayout::SetMaximumSize - + 0 - - + + Change &cover image: - + cover_path - - + + 6 - + 0 - - + + true - - + + Browse for an image to use as the cover of this book. - + ... - - + + :/images/document_open.svg:/images/document_open.svg - - + + Reset cover to default - + ... - - + + :/images/trash.svg:/images/trash.svg @@ -584,21 +585,21 @@ - + - - - Fetch cover image from server + + + Fetch &cover image from server - - + + Change the username and/or password for your account at LibraryThing.com - - Change password + + Change &password @@ -619,11 +620,11 @@ - - + + Qt::Horizontal - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -666,7 +667,7 @@ button_box - + @@ -675,11 +676,11 @@ MetadataSingleDialog accept() - + 261 710 - + 157 274 @@ -691,11 +692,11 @@ MetadataSingleDialog reject() - + 329 710 - + 286 274 diff --git a/src/calibre/trac/plugins/download.py b/src/calibre/trac/plugins/download.py index ff98123f1d..00bea7d65f 100644 --- a/src/calibre/trac/plugins/download.py +++ b/src/calibre/trac/plugins/download.py @@ -177,11 +177,11 @@ else: compatibility='%s works on OS X Tiger and above.'%(__appname__,), path=MOBILEREAD+file, app=__appname__, note=Markup(\ - ''' + u'''
  1. Before trying to use the command line tools, you must run the app at least once. This will ask you for you password and then setup the symbolic links for the command line tools.
  2. The app cannot be run from within the dmg. You must drag it to a folder on your filesystem (The Desktop, Applications, wherever).
  3. -
  4. In order for localization of the user interface in your language, select your language in the configuration dialog (by clicking the hammer icon next to the search bar) and select your language.
  5. +
  6. In order for localization of the user interface in your language, select your language in the preferences (by pressing u\2318+P) and select your language.
''')) return 'binary.html', data, None