From 7a38f64b76d50010d6823e7cb6cbe34fc35feb7e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 20 May 2005 03:43:59 +0000 Subject: [PATCH] * src/DisplayModels.py: remove place column * src/MediaView.py: delete Place option * src/GrampsDbBase.py: new default for media columns * src/GrampsBSDDB.py: upgrade database version for media columns svn: r4638 --- gramps2/ChangeLog | 4 ++++ gramps2/src/DisplayModels.py | 9 --------- gramps2/src/GrampsBSDDB.py | 12 +++++++++++- gramps2/src/GrampsDbBase.py | 2 +- gramps2/src/MediaView.py | 1 - 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index c8b6ee2aa..0078d0eba 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,8 @@ 2005-05-19 Don Allingham + * src/DisplayModels.py: remove place column + * src/MediaView.py: delete Place option + * src/GrampsDbBase.py: new default for media columns + * src/GrampsBSDDB.py: upgrade database version for media columns * src/MediaView.py: enable sorting by columns * src/DisplayModels.py: enable sorting by columns for MediaModel diff --git a/gramps2/src/DisplayModels.py b/gramps2/src/DisplayModels.py index 6e5db0cff..0aabac838 100644 --- a/gramps2/src/DisplayModels.py +++ b/gramps2/src/DisplayModels.py @@ -439,7 +439,6 @@ class MediaModel(BaseModel): self.column_path, self.column_change, self.column_date, - self.column_place, self.column_handle, ] self.smap = [ @@ -449,7 +448,6 @@ class MediaModel(BaseModel): self.column_path, self.sort_change, self.column_date, - self.column_place, self.column_handle, ] BaseModel.__init__(self,db,scol,order) @@ -477,13 +475,6 @@ class MediaModel(BaseModel): return unicode(DateHandler.displayer.display(data[9])) return u'' - def column_place(self,data): - if data[10]: - place = self.db.get_place_from_handle(data[10]) - if place: - return place.get_title() - return u'' - def column_handle(self,data): return unicode(data[0]) diff --git a/gramps2/src/GrampsBSDDB.py b/gramps2/src/GrampsBSDDB.py index bfb6f205d..7376c4c53 100644 --- a/gramps2/src/GrampsBSDDB.py +++ b/gramps2/src/GrampsBSDDB.py @@ -43,7 +43,7 @@ from bsddb import dbshelve, db from RelLib import * from GrampsDbBase import * -_DBVERSION = 5 +_DBVERSION = 6 def find_surname(key,data): return str(data[3].get_surname()) @@ -415,6 +415,8 @@ class GrampsBSDDB(GrampsDbBase): self.upgrade_4(child_rel_notrans) if version < 5: self.upgrade_5() + if version < 6: + self.upgrade_6() self.metadata['version'] = _DBVERSION print 'Successfully finished all upgrades' @@ -723,3 +725,11 @@ class GrampsBSDDB(GrampsDbBase): self.commit_source(source,None) data = cursor.next() cursor.close() + + def upgrade_6(self): + print "Upgrading to DB version 6" + order = [] + for val in self.get_media_column_order(): + if val[1] != 6: + order.append(val) + self.set_media_column_order(order) diff --git a/gramps2/src/GrampsDbBase.py b/gramps2/src/GrampsDbBase.py index b6a025aa4..618559e82 100644 --- a/gramps2/src/GrampsDbBase.py +++ b/gramps2/src/GrampsDbBase.py @@ -1291,7 +1291,7 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback): Returns the MediaObject display common information stored in the database's metadata. """ - default = [(1,1),(0,5),(0,6),(1,2),(1,3),(0,4)] + default = [(1,1),(0,5),(0,4),(1,2),(1,3)] if self.metadata == None: return default else: diff --git a/gramps2/src/MediaView.py b/gramps2/src/MediaView.py index f03319fb8..81f009722 100644 --- a/gramps2/src/MediaView.py +++ b/gramps2/src/MediaView.py @@ -60,7 +60,6 @@ column_names = [ _('Path'), _('Last Changed'), _('Date'), - _('Place'), ] _HANDLE_COL = len(column_names)