* src/DisplayModels.py: support for Spouse column
* src/MediaView.py: fix try_to_find_object_from_id * src/PeopleModel.py: support for Spouse column * src/RelLib.py: handle expanding columns svn: r3198
This commit is contained in:
parent
9cb2a3afc3
commit
6a25e86405
@ -1,3 +1,9 @@
|
|||||||
|
2004-06-02 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
|
* src/DisplayModels.py: support for Spouse column
|
||||||
|
* src/MediaView.py: fix try_to_find_object_from_id
|
||||||
|
* src/PeopleModel.py: support for Spouse column
|
||||||
|
* src/RelLib.py: handle expanding columns
|
||||||
|
|
||||||
2004-05-30 Don Allingham <dallingham@users.sourceforge.net>
|
2004-05-30 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
* src/EditSource.py: try_to_find_person_from_id fix
|
* src/EditSource.py: try_to_find_person_from_id fix
|
||||||
* src/PedView.py: try_to_find_person_from_id fix
|
* src/PedView.py: try_to_find_person_from_id fix
|
||||||
|
@ -67,7 +67,7 @@ class BaseModel(gtk.GenericTreeModel):
|
|||||||
return gtk.TREE_MODEL_LIST_ONLY
|
return gtk.TREE_MODEL_LIST_ONLY
|
||||||
|
|
||||||
def on_get_n_columns(self):
|
def on_get_n_columns(self):
|
||||||
return 9
|
return 10
|
||||||
|
|
||||||
def on_get_path(self, node):
|
def on_get_path(self, node):
|
||||||
'''returns the tree path (a tuple of indices at the various
|
'''returns the tree path (a tuple of indices at the various
|
||||||
|
@ -177,7 +177,7 @@ class MediaView:
|
|||||||
|
|
||||||
id = store.get_value(iter,1)
|
id = store.get_value(iter,1)
|
||||||
|
|
||||||
mobj = self.db.try_to_find_object_from_id(id,None)
|
mobj = self.db.try_to_find_object_from_id(id)
|
||||||
type = mobj.get_mime_type()
|
type = mobj.get_mime_type()
|
||||||
type_name = Utils.get_mime_description(type)
|
type_name = Utils.get_mime_description(type)
|
||||||
path = mobj.get_path()
|
path = mobj.get_path()
|
||||||
|
@ -49,9 +49,9 @@ from RelLib import *
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
COLUMN_NAME = 0
|
COLUMN_NAME = 0
|
||||||
COLUMN_NAME_SORT = 7
|
COLUMN_NAME_SORT = 8
|
||||||
COLUMN_VIEW = 8
|
COLUMN_VIEW = COLUMN_NAME_SORT + 1
|
||||||
COLUMN_BOLD = 9
|
COLUMN_BOLD = COLUMN_VIEW + 1
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -76,6 +76,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
self.column_birth_place,
|
self.column_birth_place,
|
||||||
self.column_death_day,
|
self.column_death_day,
|
||||||
self.column_death_place,
|
self.column_death_place,
|
||||||
|
self.column_spouse,
|
||||||
self.sort_name,
|
self.sort_name,
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -319,6 +320,21 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
def sort_name(self,data):
|
def sort_name(self,data):
|
||||||
return data[2].get_sort_name()
|
return data[2].get_sort_name()
|
||||||
|
|
||||||
|
def column_spouse(self,data):
|
||||||
|
id = data[0]
|
||||||
|
if data[8]:
|
||||||
|
fid = data[8][0]
|
||||||
|
else:
|
||||||
|
return u""
|
||||||
|
d2 = self.db.family_map.get(str(fid))
|
||||||
|
if fid and d2 :
|
||||||
|
if d2[1] == id:
|
||||||
|
return self.db.person_map.get(str(d2[2]))[2].get_name()
|
||||||
|
else:
|
||||||
|
return self.db.person_map.get(str(d2[1]))[2].get_name()
|
||||||
|
else:
|
||||||
|
return u""
|
||||||
|
|
||||||
def column_name(self,data):
|
def column_name(self,data):
|
||||||
return data[2].get_name()
|
return data[2].get_name()
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ column_names = [
|
|||||||
_('Birth Place'),
|
_('Birth Place'),
|
||||||
_('Death Date'),
|
_('Death Date'),
|
||||||
_('Death Place'),
|
_('Death Place'),
|
||||||
|
_('Spouse'),
|
||||||
]
|
]
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -81,7 +82,8 @@ class PeopleView:
|
|||||||
self.person_selection = self.person_tree.get_selection()
|
self.person_selection = self.person_tree.get_selection()
|
||||||
self.person_selection.connect('changed',self.row_changed)
|
self.person_selection.connect('changed',self.row_changed)
|
||||||
self.person_tree.connect('row_activated', self.alpha_event)
|
self.person_tree.connect('row_activated', self.alpha_event)
|
||||||
self.person_tree.connect('button-press-event',self.on_plist_button_press)
|
self.person_tree.connect('button-press-event',
|
||||||
|
self.on_plist_button_press)
|
||||||
|
|
||||||
def get_maps(self):
|
def get_maps(self):
|
||||||
return (self.person_model.top_iter2path,
|
return (self.person_model.top_iter2path,
|
||||||
@ -136,9 +138,10 @@ class PeopleView:
|
|||||||
return mlist
|
return mlist
|
||||||
|
|
||||||
def row_changed(self,obj):
|
def row_changed(self,obj):
|
||||||
"""Called with a row is changed. Check the selected objects from the person_tree
|
"""Called with a row is changed. Check the selected objects from
|
||||||
to get the IDs of the selected objects. Set the active person to the first person
|
the person_tree to get the IDs of the selected objects. Set the
|
||||||
in the list. If no one is selected, set the active person to None"""
|
active person to the first person in the list. If no one is
|
||||||
|
selected, set the active person to None"""
|
||||||
|
|
||||||
selected_ids = self.get_selected_objects()
|
selected_ids = self.get_selected_objects()
|
||||||
|
|
||||||
@ -163,8 +166,8 @@ class PeopleView:
|
|||||||
self.person_tree.set_model(self.sort_model)
|
self.person_tree.set_model(self.sort_model)
|
||||||
|
|
||||||
def remove_from_person_list(self,person,old_id=None):
|
def remove_from_person_list(self,person,old_id=None):
|
||||||
"""Remove the selected person from the list. A person object is expected,
|
"""Remove the selected person from the list. A person object is
|
||||||
not an ID"""
|
expected, not an ID"""
|
||||||
if old_id == None:
|
if old_id == None:
|
||||||
old_id = person.get_id()
|
old_id = person.get_id()
|
||||||
path = self.person_model.on_get_path(old_id)
|
path = self.person_model.on_get_path(old_id)
|
||||||
@ -216,7 +219,8 @@ class PeopleView:
|
|||||||
def apply_filter(self,current_model=None):
|
def apply_filter(self,current_model=None):
|
||||||
self.parent.status_text(_('Updating display...'))
|
self.parent.status_text(_('Updating display...'))
|
||||||
|
|
||||||
keys = self.DataFilter.apply(self.parent.db,self.parent.db.get_person_keys())
|
keys = self.DataFilter.apply(self.parent.db,
|
||||||
|
self.parent.db.get_person_keys())
|
||||||
self.person_model.reset_visible()
|
self.person_model.reset_visible()
|
||||||
for person_id in keys:
|
for person_id in keys:
|
||||||
self.person_model.set_visible(person_id,1)
|
self.person_model.set_visible(person_id,1)
|
||||||
|
@ -2965,6 +2965,7 @@ class GrampsDB:
|
|||||||
If no such Person exists, a new Person is added to the database."""
|
If no such Person exists, a new Person is added to the database."""
|
||||||
|
|
||||||
data = self.person_map.get(str(val))
|
data = self.person_map.get(str(val))
|
||||||
|
print data
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
person = Person()
|
person = Person()
|
||||||
@ -2979,7 +2980,6 @@ class GrampsDB:
|
|||||||
|
|
||||||
person = Person()
|
person = Person()
|
||||||
data = self.person_map.get(str(val))
|
data = self.person_map.get(str(val))
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
person.unserialize(data)
|
person.unserialize(data)
|
||||||
else:
|
else:
|
||||||
@ -3557,10 +3557,15 @@ class GrampsDB:
|
|||||||
self.metadata['media_columns'] = list
|
self.metadata['media_columns'] = list
|
||||||
|
|
||||||
def get_column_order(self):
|
def get_column_order(self):
|
||||||
|
default = [(1,1),(1,2),(1,3),(0,4),(1,5),(0,6),(0,7)]
|
||||||
if self.metadata == None:
|
if self.metadata == None:
|
||||||
return [(1,1),(1,2),(1,3),(0,4),(1,5),(0,6)]
|
return default
|
||||||
else:
|
else:
|
||||||
return self.metadata.get('columns',[(1,1),(1,2),(1,3),(0,4),(1,5),(0,6)])
|
cols = self.metadata.get('columns',default)
|
||||||
|
if len(cols) != len(default):
|
||||||
|
return cols + default[len(cols):]
|
||||||
|
else:
|
||||||
|
return cols
|
||||||
|
|
||||||
def get_place_column_order(self):
|
def get_place_column_order(self):
|
||||||
default = [(1,1),(1,2),(0,3),(1,4),(0,5),(1,6),(0,7),(0,8)]
|
default = [(1,1),(1,2),(0,3),(1,4),(0,5),(1,6),(0,7),(0,8)]
|
||||||
|
@ -122,6 +122,7 @@ class SelectChild:
|
|||||||
self.frel.set_text(_("Birth"))
|
self.frel.set_text(_("Birth"))
|
||||||
|
|
||||||
self.refmodel = PeopleModel.PeopleModel(self.db)
|
self.refmodel = PeopleModel.PeopleModel(self.db)
|
||||||
|
|
||||||
self.add_child.set_model(self.refmodel)
|
self.add_child.set_model(self.refmodel)
|
||||||
self.redraw_child_list(2)
|
self.redraw_child_list(2)
|
||||||
self.add_itself_to_menu()
|
self.add_itself_to_menu()
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<tips>
|
<tips>
|
||||||
|
<tip>You can represent a range of dates by using the format of "between January 4, 2000 and March 20, 2003"</tip>
|
||||||
<tip>You can drag and drop an image from either the Media View or any gallery into another gallery</tip>
|
<tip>You can drag and drop an image from either the Media View or any gallery into another gallery</tip>
|
||||||
<tip>You can add an image to any gallery or the Media View by dragging and dropping from a file manager or a web browser.</tip>
|
<tip>You can add an image to any gallery or the Media View by dragging and dropping from a file manager or a web browser.</tip>
|
||||||
<tip>You can set the birth order of children in a family even if you do not have birth dates by using drag and drop.</tip>
|
<tip>You can set the birth order of children in a family even if you do not have birth dates by using drag and drop.</tip>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user