mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Fix bulk editing of customn column widgets broken
This commit is contained in:
parent
3d7f782726
commit
9f223175f8
@ -17,13 +17,14 @@ from calibre.gui2 import error_dialog, Dispatcher
|
|||||||
|
|
||||||
class Worker(Thread):
|
class Worker(Thread):
|
||||||
|
|
||||||
def __init__(self, args, db, ids, callback):
|
def __init__(self, args, db, ids, cc_widgets, callback):
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
self.args = args
|
self.args = args
|
||||||
self.db = db
|
self.db = db
|
||||||
self.ids = ids
|
self.ids = ids
|
||||||
self.error = None
|
self.error = None
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
self.cc_widgets = cc_widgets
|
||||||
|
|
||||||
def doit(self):
|
def doit(self):
|
||||||
remove, add, au, aus, do_aus, rating, pub, do_series, \
|
remove, add, au, aus, do_aus, rating, pub, do_series, \
|
||||||
@ -71,7 +72,7 @@ class Worker(Thread):
|
|||||||
if do_remove_conv:
|
if do_remove_conv:
|
||||||
self.db.delete_conversion_options(id, 'PIPE')
|
self.db.delete_conversion_options(id, 'PIPE')
|
||||||
|
|
||||||
for w in getattr(self, 'custom_column_widgets', []):
|
for w in self.cc_widgets:
|
||||||
w.commit(self.ids)
|
w.commit(self.ids)
|
||||||
self.db.bulk_modify_tags(self.ids, add=add, remove=remove,
|
self.db.bulk_modify_tags(self.ids, add=add, remove=remove,
|
||||||
notify=False)
|
notify=False)
|
||||||
@ -213,8 +214,9 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
|||||||
|
|
||||||
bb = BlockingBusy(_('Applying changes to %d books. This may take a while.')
|
bb = BlockingBusy(_('Applying changes to %d books. This may take a while.')
|
||||||
%len(self.ids), parent=self)
|
%len(self.ids), parent=self)
|
||||||
self.worker = Worker(args, self.db, self.ids, Dispatcher(bb.accept,
|
self.worker = Worker(args, self.db, self.ids,
|
||||||
parent=bb))
|
getattr(self, 'custom_column_widgets', []),
|
||||||
|
Dispatcher(bb.accept, parent=bb))
|
||||||
self.worker.start()
|
self.worker.start()
|
||||||
bb.exec_()
|
bb.exec_()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user