From 65753f7ece0d459c1d8794c0e39c6dc3a873e7b5 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 19 Jan 2006 18:18:55 +0000 Subject: [PATCH] * src/plugins/ChangeNames.py (on_ok_clicked): Properly set batch transaction. * src/GrampsDb/_GrampsDbBase.py (transaction_begin): Add batch argument; (set_batch): Remove method. svn: r5800 --- ChangeLog | 4 ++++ src/GrampsDb/_GrampsDbBase.py | 9 ++++----- src/plugins/ChangeNames.py | 3 +-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee386f087..c09efdf2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,10 @@ * src/GrampsDb/_GrampsBSDDB.py (transaction_begin): Disconnect unneeded secondary indices; (transaction_commit): Create new secondary indices to replace the ones removed. + * src/plugins/ChangeNames.py (on_ok_clicked): Properly set batch + transaction. + * src/GrampsDb/_GrampsDbBase.py (transaction_begin): Add batch + argument; (set_batch): Remove method. 2006-01-19 Richard Taylor * src/ListBox.py: added import for gettext diff --git a/src/GrampsDb/_GrampsDbBase.py b/src/GrampsDb/_GrampsDbBase.py index efb3d139c..e2e917982 100644 --- a/src/GrampsDb/_GrampsDbBase.py +++ b/src/GrampsDb/_GrampsDbBase.py @@ -1063,7 +1063,7 @@ class GrampsDbBase(GrampsDBCallback): """ self.rprefix = self._validated_id_prefix(val,"R") - def transaction_begin(self,msg=""): + def transaction_begin(self,msg="",batch=False): """ Creates a new Transaction tied to the current UNDO database. The transaction has no effect until it is committed using the @@ -1072,7 +1072,7 @@ class GrampsDbBase(GrampsDBCallback): if self.__LOG_ALL: log.debug("%s: Transaction begin '%s'\n" % (self.__class__.__name__, str(msg))) - return Transaction(msg,self.undodb) + return Transaction(msg,self.undodb,batch) def transaction_commit(self,transaction,msg): """ @@ -1795,9 +1795,8 @@ class Transaction: self.repository_del = [] self.repository_update = [] - - def set_batch(self,batch): - self.batch = batch +## def set_batch(self,batch): +## self.batch = batch def get_batch(self): return self.batch diff --git a/src/plugins/ChangeNames.py b/src/plugins/ChangeNames.py index 9c8242ee2..185e41ae6 100644 --- a/src/plugins/ChangeNames.py +++ b/src/plugins/ChangeNames.py @@ -159,8 +159,7 @@ class ChangeNames(Tool.Tool): self.window.present() def on_ok_clicked(self,obj): - self.trans = self.db.transaction_begin() - self.trans.set_batch(True) + self.trans = self.db.transaction_begin("",batch=True) self.db.disable_signals() changelist = [] for node in self.iter_list: