* src/GrampsDb/_GrampsInMemDB.py (abort_changes): Remove method.

* src/GrampsDb/_GrampsDbBase.py (abort_changes): Remove method.
	* src/GrampsDb/_GrampsBSDDB.py (undo,redo): Use the status from
	GrampsDbBase undo/redo;
	(abort_changes): Remove method.
	* src/ViewManager.py (abort): Add method for abandoning changes.



svn: r6536
This commit is contained in:
Alex Roitman
2006-05-03 23:21:49 +00:00
parent d7063762a6
commit a8b358725d
5 changed files with 61 additions and 40 deletions

View File

@@ -795,11 +795,6 @@ class GrampsBSDDB(GrampsDbBase):
return
def abort_changes(self):
while self.undo():
pass
self.close()
def close(self):
if not self.db_is_open:
return
@@ -1138,19 +1133,27 @@ class GrampsBSDDB(GrampsDbBase):
print "Undoing it"
if self.UseTXN:
self.txn = self.env.txn_begin()
GrampsDbBase.undo(self)
status = GrampsDbBase.undo(self)
if self.UseTXN:
self.txn.commit()
if status:
self.txn.commit()
else:
self.txn.abort()
self.txn = None
return status
def redo(self):
print "Redoing it"
if self.UseTXN:
self.txn = self.env.txn_begin()
GrampsDbBase.redo(self)
status = GrampsDbBase.redo(self)
if self.UseTXN:
self.txn.commit()
self.txn = None
if status:
self.txn.commit()
else:
self.txn.abort()
self.txn = None
return status
def undo_reference(self,data,handle):
if data == None: