Don't continue the conversion process with unconvertable books.

This commit is contained in:
John Schember 2009-05-05 20:34:59 -04:00
parent a418271f35
commit 6413208f37
2 changed files with 10 additions and 8 deletions

View File

@ -973,12 +973,13 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
def auto_convert(self, row_ids, on_card, format):
previous = self.library_view.currentIndex()
jobs, changed = convert_single_ebook(self, self.library_view.model().db, row_ids, True)
jobs, changed, bad = convert_single_ebook(self, self.library_view.model().db, row_ids, True)
if jobs == []: return
for func, args, desc, fmt, id, temp_files in jobs:
job = self.job_manager.run_job(Dispatcher(self.book_auto_converted),
if id not in bad:
job = self.job_manager.run_job(Dispatcher(self.book_auto_converted),
func, args=args, description=desc)
self.conversion_jobs[job] = (temp_files, fmt, id, on_card)
self.conversion_jobs[job] = (temp_files, fmt, id, on_card)
if changed:
self.library_view.model().refresh_rows(rows)
@ -1021,12 +1022,13 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
previous = self.library_view.currentIndex()
rows = [x.row() for x in \
self.library_view.selectionModel().selectedRows()]
jobs, changed = convert_single_ebook(self,
jobs, changed, bad = convert_single_ebook(self,
self.library_view.model().db, row_ids)
for func, args, desc, fmt, id, temp_files in jobs:
job = self.job_manager.run_job(Dispatcher(self.book_converted),
if id not in bad:
job = self.job_manager.run_job(Dispatcher(self.book_converted),
func, args=args, description=desc)
self.conversion_jobs[job] = (temp_files, fmt, id)
self.conversion_jobs[job] = (temp_files, fmt, id)
if changed:
self.library_view.model().refresh_rows(rows)

View File

@ -33,7 +33,7 @@ def convert_single_ebook(parent, db, row_ids, auto_conversion=False):
if auto_conversion:
result = QDialog.Accepted
else:
retult = d.exec_()
result = d.exec_()
if result == QDialog.Accepted:
mi = db.get_metadata(row_id, True)
@ -67,7 +67,7 @@ def convert_single_ebook(parent, db, row_ids, auto_conversion=False):
msg = _('<p>Could not convert %d of %d books, because no suitable source format was found.<ul>%s</ul>')%(len(res), total, '\n'.join(res))
warning_dialog(parent, _('Could not convert some books'), msg).exec_()
return jobs, changed
return jobs, changed, bad
def convert_bulk_ebooks(*args):