mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Catalog generation: Do not use inline-block CSS as apparently Adobe Digital Editions cannot handle it. Fixes #8566 (Problem with Catalog on Sony PRS650 in v7.42)
This commit is contained in:
commit
894037ec9e
@ -62,6 +62,18 @@ div.description {
|
||||
text-indent: 1em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to minimize widows and orphans by logically grouping chunks
|
||||
* Recommend enabling for iPad
|
||||
* Some reports of problems with Sony ereaders, presumably ADE engines
|
||||
*/
|
||||
/*
|
||||
div.logical_group {
|
||||
display:inline-block;
|
||||
width:100%;
|
||||
}
|
||||
*/
|
||||
|
||||
p.date_index {
|
||||
font-size:x-large;
|
||||
text-align:center;
|
||||
|
@ -550,6 +550,14 @@ def choose_dir(window, name, title, default_dir='~'):
|
||||
if dir:
|
||||
return dir[0]
|
||||
|
||||
def choose_osx_app(window, name, title, default_dir='/Applications'):
|
||||
fd = FileDialog(title=title, parent=window, name=name, mode=QFileDialog.ExistingFile,
|
||||
default_dir=default_dir)
|
||||
app = fd.get_files()
|
||||
fd.setParent(None)
|
||||
if app:
|
||||
return app
|
||||
|
||||
def choose_files(window, name, title,
|
||||
filters=[], all_files=True, select_only_single_file=False):
|
||||
'''
|
||||
|
@ -165,10 +165,12 @@ class FetchAnnotationsAction(InterfaceAction):
|
||||
ka_soup.insert(0,divTag)
|
||||
return ka_soup
|
||||
|
||||
'''
|
||||
def mark_book_as_read(self,id):
|
||||
read_tag = gprefs.get('catalog_epub_mobi_read_tag')
|
||||
if read_tag:
|
||||
self.db.set_tags(id, [read_tag], append=True)
|
||||
'''
|
||||
|
||||
def canceled(self):
|
||||
self.pd.hide()
|
||||
@ -201,10 +203,12 @@ class FetchAnnotationsAction(InterfaceAction):
|
||||
# Update library comments
|
||||
self.db.set_comment(id, mi.comments)
|
||||
|
||||
'''
|
||||
# Update 'read' tag except for Catalogs/Clippings
|
||||
if bm.value.percent_read >= self.FINISHED_READING_PCT_THRESHOLD:
|
||||
if not set(mi.tags).intersection(ignore_tags):
|
||||
self.mark_book_as_read(id)
|
||||
'''
|
||||
|
||||
# Add bookmark file to id
|
||||
self.db.add_format_with_hooks(id, bm.value.bookmark_extension,
|
||||
|
@ -335,7 +335,7 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
'''
|
||||
|
||||
return
|
||||
|
||||
'''
|
||||
if new_state == 0:
|
||||
# unchecked
|
||||
self.merge_source_field.setEnabled(False)
|
||||
@ -348,6 +348,7 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
self.merge_before.setEnabled(True)
|
||||
self.merge_after.setEnabled(True)
|
||||
self.include_hr.setEnabled(True)
|
||||
'''
|
||||
|
||||
def header_note_source_field_changed(self,new_index):
|
||||
'''
|
||||
|
@ -1820,6 +1820,9 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
|
||||
self.booksByTitle_noSeriesPrefix = nspt
|
||||
|
||||
# Loop through the books by title
|
||||
# Generate one divRunningTag per initial letter for the purposes of
|
||||
# minimizing widows and orphans on readers that can handle large
|
||||
# <divs> styled as inline-block
|
||||
title_list = self.booksByTitle
|
||||
if not self.useSeriesPrefixInTitlesSection:
|
||||
title_list = self.booksByTitle_noSeriesPrefix
|
||||
@ -1832,7 +1835,7 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
|
||||
divTag.insert(dtc, divRunningTag)
|
||||
dtc += 1
|
||||
divRunningTag = Tag(soup, 'div')
|
||||
divRunningTag['style'] = 'display:inline-block;width:100%'
|
||||
divRunningTag['class'] = "logical_group"
|
||||
drtc = 0
|
||||
current_letter = self.letter_or_symbol(book['title_sort'][0])
|
||||
pIndexTag = Tag(soup, "p")
|
||||
@ -1954,6 +1957,8 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
|
||||
drtc = 0
|
||||
|
||||
# Loop through booksByAuthor
|
||||
# Each author/books group goes in an openingTag div (first) or
|
||||
# a runningTag div (subsequent)
|
||||
book_count = 0
|
||||
current_author = ''
|
||||
current_letter = ''
|
||||
@ -1977,7 +1982,7 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
|
||||
current_letter = self.letter_or_symbol(book['author_sort'][0].upper())
|
||||
author_count = 0
|
||||
divOpeningTag = Tag(soup, 'div')
|
||||
divOpeningTag['style'] = 'display:inline-block;width:100%'
|
||||
divOpeningTag['class'] = "logical_group"
|
||||
dotc = 0
|
||||
pIndexTag = Tag(soup, "p")
|
||||
pIndexTag['class'] = "letter_index"
|
||||
@ -2001,7 +2006,7 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
|
||||
|
||||
# Create a divRunningTag for the rest of the authors in this letter
|
||||
divRunningTag = Tag(soup, 'div')
|
||||
divRunningTag['style'] = 'display:inline-block;width:100%'
|
||||
divRunningTag['class'] = "logical_group"
|
||||
drtc = 0
|
||||
|
||||
non_series_books = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user