From 40b158c997f7051fe95b8bc98cdae877b997d76a Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 22 Dec 2005 04:36:26 +0000 Subject: [PATCH] * src/GrampsDb/_GrampsBSDDB.py (close): close reference_map tables. * src/ViewManager.py (quit): Add function to properly quit. svn: r5612 --- gramps2/ChangeLog | 3 +++ gramps2/src/GrampsDb/_GrampsBSDDB.py | 3 +++ gramps2/src/ViewManager.py | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 4a98cf1dd..beaa3cdef 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -18,6 +18,9 @@ * src/GrampsDb/Makefile.am, src/GrampsDb/.cvsignore: Add to CVS. * configure.in: Create Makefile in new directory. + * src/GrampsDb/_GrampsBSDDB.py (close): close reference_map tables. + * src/ViewManager.py (quit): Add function to properly quit. + 2005-12-21 Richard Taylor * src/EditSource.py: fixed small mistake in display_references diff --git a/gramps2/src/GrampsDb/_GrampsBSDDB.py b/gramps2/src/GrampsDb/_GrampsBSDDB.py index 2797e745d..0e71f187c 100644 --- a/gramps2/src/GrampsDb/_GrampsBSDDB.py +++ b/gramps2/src/GrampsDb/_GrampsBSDDB.py @@ -639,6 +639,7 @@ class GrampsBSDDB(GrampsDbBase): self.source_map.close() self.media_map.close() self.event_map.close() + self.reference_map.close() if not self.readonly: self.metadata['bookmarks'] = self.bookmarks self.metadata['gender_stats'] = self.genderStats.save_stats() @@ -657,6 +658,8 @@ class GrampsBSDDB(GrampsDbBase): self.oid_trans.close() self.sid_trans.close() self.pid_trans.close() + self.reference_map_primary_map.close() + self.reference_map_referenced_map.close() self.env.close() if not self.readonly: diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index af08765ac..0f75bc906 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -157,7 +157,7 @@ class ViewManager: self.views = [] self.pages = [] self.window = gtk.Window() - self.window.connect('destroy', lambda w: gtk.main_quit()) + self.window.connect('destroy', self.quit) self.window.set_size_request(775,500) self.statusbar = gtk.Statusbar() @@ -209,6 +209,10 @@ class ViewManager: self.change_page(None,None) self.actiongroup.set_visible(False) + def quit(self,obj=None): + self.state.db.close() + gtk.main_quit() + def set_color(self,obj): style = obj.get_style().copy() new_color = style.bg[gtk.STATE_ACTIVE] @@ -233,7 +237,7 @@ class ViewManager: ('New', gtk.STOCK_NEW, '_New', "n", None, self.new_activate), ('Open', gtk.STOCK_OPEN, '_Open', "o", None, self.open_activate), ('OpenRecent', gtk.STOCK_OPEN, 'Open _Recent'), - ('Quit', gtk.STOCK_QUIT, '_Quit', "q", None, gtk.main_quit), + ('Quit', gtk.STOCK_QUIT, '_Quit', "q", None, self.quit), ('ViewMenu', None, '_View'), ('Preferences', gtk.STOCK_PREFERENCES, '_Preferences'), ('ColumnEdit', gtk.STOCK_PROPERTIES, '_Column Editor'),