* 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
This commit is contained in:
parent
5cc41d894c
commit
7a38f64b76
@ -1,4 +1,8 @@
|
||||
2005-05-19 Don Allingham <don@gramps-project.org>
|
||||
* 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
|
||||
|
||||
|
@ -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])
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -60,7 +60,6 @@ column_names = [
|
||||
_('Path'),
|
||||
_('Last Changed'),
|
||||
_('Date'),
|
||||
_('Place'),
|
||||
]
|
||||
|
||||
_HANDLE_COL = len(column_names)
|
||||
|
Loading…
x
Reference in New Issue
Block a user