mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1929462 [Private bug](https://bugs.launchpad.net/calibre/+bug/1929462)
This commit is contained in:
parent
f9cfc4d6a0
commit
1575a29101
@ -11,7 +11,7 @@ from collections import defaultdict
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
from qt.core import QApplication, QDialog, QPixmap, QTimer
|
from qt.core import QApplication, QDialog, QPixmap, QTimer
|
||||||
|
|
||||||
from calibre import as_unicode, guess_type
|
from calibre import as_unicode, guess_type, prepare_string_for_xml
|
||||||
from calibre.constants import iswindows
|
from calibre.constants import iswindows
|
||||||
from calibre.ebooks import BOOK_EXTENSIONS
|
from calibre.ebooks import BOOK_EXTENSIONS
|
||||||
from calibre.ebooks.metadata import MetaInformation, normalize_isbn
|
from calibre.ebooks.metadata import MetaInformation, normalize_isbn
|
||||||
@ -574,10 +574,10 @@ class AddAction(InterfaceAction):
|
|||||||
merged[author].append(title)
|
merged[author].append(title)
|
||||||
lines = []
|
lines = []
|
||||||
for author in sorted(merged, key=sort_key):
|
for author in sorted(merged, key=sort_key):
|
||||||
lines.append(author)
|
lines.append(f'<b><i>{prepare_string_for_xml(author)}</i></b><ol style="margin-top: 0">')
|
||||||
for title in sorted(merged[author], key=sort_key):
|
for title in sorted(merged[author]):
|
||||||
lines.append(' ' + title)
|
lines.append(f'<li>{prepare_string_for_xml(title)}</li>')
|
||||||
lines.append('')
|
lines.append('</ol>')
|
||||||
pm = ngettext('The following duplicate book was found.',
|
pm = ngettext('The following duplicate book was found.',
|
||||||
'The following {} duplicate books were found.',
|
'The following {} duplicate books were found.',
|
||||||
len(adder.merged_books)).format(len(adder.merged_books))
|
len(adder.merged_books)).format(len(adder.merged_books))
|
||||||
|
@ -494,7 +494,16 @@ class JobError(QDialog): # {{{
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from calibre.gui2 import Application, question_dialog
|
from calibre.gui2 import Application, question_dialog
|
||||||
|
from calibre import prepare_string_for_xml
|
||||||
app = Application([])
|
app = Application([])
|
||||||
|
merged = {'Kovid Goyal': ['Waterloo', 'Doomed'], 'Someone Else': ['Some other book ' * 1000]}
|
||||||
|
lines = []
|
||||||
|
for author in sorted(merged):
|
||||||
|
lines.append(f'<b><i>{prepare_string_for_xml(author)}</i></b><ol style="margin-top: 0">')
|
||||||
|
for title in sorted(merged[author]):
|
||||||
|
lines.append(f'<li>{prepare_string_for_xml(title)}</li>')
|
||||||
|
lines.append('</ol>')
|
||||||
|
|
||||||
print(question_dialog(None, 'title', 'msg <a href="http://google.com">goog</a> ',
|
print(question_dialog(None, 'title', 'msg <a href="http://google.com">goog</a> ',
|
||||||
det_msg='<p>hi there <b>guy</b> '*1000,
|
det_msg='\n'.join(lines),
|
||||||
show_copy_button=True))
|
show_copy_button=True))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user