From 715e7b2b867f7e6bf3f3b07335671675d1391959 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Wed, 3 May 2006 23:36:10 +0000 Subject: [PATCH] (GrampsDbBase.transaction_begin): No aborting after batch transaction. (GrampsBSDDB.transaction_begin): No aborting after batch transaction. svn: r6537 --- ChangeLog | 2 ++ src/GrampsDb/_GrampsBSDDB.py | 4 ++++ src/GrampsDb/_GrampsDbBase.py | 4 ++++ src/ViewManager.py | 8 ++++---- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0da0f8b6b..b707e942e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,11 @@ 2006-05-03 Alex Roitman * src/GrampsDb/_GrampsInMemDB.py (abort_changes): Remove method. * src/GrampsDb/_GrampsDbBase.py (abort_changes): Remove method. + (GrampsDbBase.transaction_begin): No aborting after batch transaction. * src/GrampsDb/_GrampsBSDDB.py (undo,redo): Use the status from GrampsDbBase undo/redo; (abort_changes): Remove method. + (GrampsBSDDB.transaction_begin): No aborting after batch transaction. * src/ViewManager.py (abort): Add method for abandoning changes. * configure.in: Set release to 0.SVN. diff --git a/src/GrampsDb/_GrampsBSDDB.py b/src/GrampsDb/_GrampsBSDDB.py index 9b35568a8..bde5ac084 100644 --- a/src/GrampsDb/_GrampsBSDDB.py +++ b/src/GrampsDb/_GrampsBSDDB.py @@ -1062,6 +1062,10 @@ class GrampsBSDDB(GrampsDbBase): transaction_commit function of the this database object. """ + if batch: + # A batch transaction does not store the commits + # Aborting the session completely will become impossible. + self.abort_possible = False transaction = BdbTransaction(msg,self.undodb,batch,no_magic) if transaction.batch: if self.UseTXN: diff --git a/src/GrampsDb/_GrampsDbBase.py b/src/GrampsDb/_GrampsDbBase.py index 783eaad7a..eea50fe46 100644 --- a/src/GrampsDb/_GrampsDbBase.py +++ b/src/GrampsDb/_GrampsDbBase.py @@ -1204,6 +1204,10 @@ class GrampsDbBase(GrampsDBCallback): if self.__LOG_ALL: log.debug("%s: Transaction begin '%s'\n" % (self.__class__.__name__, str(msg))) + if batch: + # A batch transaction does not store the commits + # Aborting the session completely will become impossible. + self.abort_possible = False return Transaction(msg, self.undodb, batch) def transaction_commit(self, transaction, msg): diff --git a/src/ViewManager.py b/src/ViewManager.py index db87a9292..aed63d54e 100644 --- a/src/ViewManager.py +++ b/src/ViewManager.py @@ -420,10 +420,10 @@ class ViewManager: self.quit() else: QuestionDialog.WarningDialog( - _('Cannot cleanly abandon changes'), - _('Changes cannot be abandoned because the number of ' - 'changes made exceeded the limit.')) - + _("Cannot abandon session's changes"), + _('Changes cannot be completely abandoned because the ' + 'number of changes made in the session exceeded the ' + 'limit.')) def _build_ui_manager(self): self.merge_ids = []