mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add commit= parameter to set custom. Use it in cc_widgets
This commit is contained in:
parent
c334e84b48
commit
c29ee263e0
@ -41,7 +41,8 @@ class Base(object):
|
|||||||
val = self.gui_val
|
val = self.gui_val
|
||||||
val = self.normalize_ui_val(val)
|
val = self.normalize_ui_val(val)
|
||||||
if val != self.initial_val:
|
if val != self.initial_val:
|
||||||
self.db._set_custom(book_id, val, num=self.col_id, notify=notify)
|
self.db.set_custom(book_id, val, num=self.col_id, notify=notify,
|
||||||
|
commit=False)
|
||||||
|
|
||||||
def normalize_db_val(self, val):
|
def normalize_db_val(self, val):
|
||||||
return val
|
return val
|
||||||
@ -304,8 +305,8 @@ class Series(Base):
|
|||||||
num=self.col_id)
|
num=self.col_id)
|
||||||
else:
|
else:
|
||||||
s_index = None
|
s_index = None
|
||||||
self.db._set_custom(book_id, val, extra=s_index,
|
self.db.set_custom(book_id, val, extra=s_index,
|
||||||
num=self.col_id, notify=notify)
|
num=self.col_id, notify=notify, commit=False)
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'bool' : Bool,
|
'bool' : Bool,
|
||||||
|
@ -412,9 +412,10 @@ class CustomColumns(object):
|
|||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
|
|
||||||
def set_custom(self, id, val, label=None, num=None,
|
def set_custom(self, id, val, label=None, num=None,
|
||||||
append=False, notify=True, extra=None):
|
append=False, notify=True, extra=None, commit=True):
|
||||||
self._set_custom(id, val, label=label, num=num, append=append,
|
self._set_custom(id, val, label=label, num=num, append=append,
|
||||||
notify=notify, extra=extra)
|
notify=notify, extra=extra)
|
||||||
|
if commit:
|
||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
|
|
||||||
def _set_custom(self, id_, val, label=None, num=None,
|
def _set_custom(self, id_, val, label=None, num=None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user