issue #1352, include all children as siblings in relationship view
svn: r9323
This commit is contained in:
parent
766d9147b8
commit
4e9f909083
@ -1,3 +1,8 @@
|
|||||||
|
2007-11-08 Stéphane Charette <stephanecharette@gmail.com>
|
||||||
|
* src/DataViews/_RelationView.py: issue #1352
|
||||||
|
* src/GrampsWidgets.py: issue #1352, include all siblings in
|
||||||
|
relationship view, but make current person non-linkable
|
||||||
|
|
||||||
2007-11-07 Benny Malengier <benny.malengier@gramps-project.org>
|
2007-11-07 Benny Malengier <benny.malengier@gramps-project.org>
|
||||||
* src/AddMedia.py: fix issue #1350, relative path not working addmedia
|
* src/AddMedia.py: fix issue #1350, relative path not working addmedia
|
||||||
* src/Editors/_EditPerson.py: family rebuild callback error
|
* src/Editors/_EditPerson.py: family rebuild callback error
|
||||||
|
@ -772,8 +772,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
if self.show_siblings:
|
if self.show_siblings:
|
||||||
active = self.dbstate.active.handle
|
active = self.dbstate.active.handle
|
||||||
|
|
||||||
child_list = [ref.ref for ref in family.get_child_ref_list()\
|
child_list = [ref.ref for ref in family.get_child_ref_list()]
|
||||||
if ref.ref != active]
|
|
||||||
|
|
||||||
if child_list:
|
if child_list:
|
||||||
eventbox = gtk.EventBox()
|
eventbox = gtk.EventBox()
|
||||||
@ -789,7 +788,8 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
|
|
||||||
i = 1
|
i = 1
|
||||||
for child_handle in child_list:
|
for child_handle in child_list:
|
||||||
self.write_child(vbox, child_handle, i)
|
child_should_be_linked = (child_handle != active)
|
||||||
|
self.write_child(vbox, child_handle, i, child_should_be_linked)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
eventbox.add(vbox)
|
eventbox.add(vbox)
|
||||||
@ -892,19 +892,30 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
lbl.set_padding(0, 5)
|
lbl.set_padding(0, 5)
|
||||||
return lbl
|
return lbl
|
||||||
|
|
||||||
def write_child(self, vbox, handle, index):
|
def write_child(self, vbox, handle, index, child_should_be_linked):
|
||||||
parent = has_children(self.dbstate.db,
|
parent = has_children(self.dbstate.db,
|
||||||
self.dbstate.db.get_person_from_handle(handle))
|
self.dbstate.db.get_person_from_handle(handle))
|
||||||
if parent:
|
|
||||||
|
format = ''
|
||||||
|
if child_should_be_linked and parent:
|
||||||
format = 'underline="single" weight="heavy" style="italic"'
|
format = 'underline="single" weight="heavy" style="italic"'
|
||||||
else:
|
elif child_should_be_linked and not parent:
|
||||||
format = 'underline="single"'
|
format = 'underline="single"'
|
||||||
|
elif parent and not child_should_be_linked:
|
||||||
|
format = 'weight="heavy" style="italic"'
|
||||||
|
|
||||||
|
if child_should_be_linked:
|
||||||
|
link_func = self._button_press
|
||||||
|
else:
|
||||||
|
link_func = None
|
||||||
|
|
||||||
link_label = GrampsWidgets.LinkLabel(self.get_name(handle, True),
|
link_label = GrampsWidgets.LinkLabel(self.get_name(handle, True),
|
||||||
self._button_press, handle, format)
|
link_func, handle, format)
|
||||||
|
|
||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
link_label.set_padding(3, 0)
|
link_label.set_padding(3, 0)
|
||||||
if Config.get(Config.RELEDITBTN):
|
if child_should_be_linked and Config.get(Config.RELEDITBTN):
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
||||||
else:
|
else:
|
||||||
button = None
|
button = None
|
||||||
@ -1137,7 +1148,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
|
|
||||||
i = 1
|
i = 1
|
||||||
for child_ref in child_list:
|
for child_ref in child_list:
|
||||||
self.write_child(vbox, child_ref.ref, i)
|
self.write_child(vbox, child_ref.ref, i, True)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
eventbox.add(vbox)
|
eventbox.add(vbox)
|
||||||
|
@ -126,12 +126,13 @@ class LinkLabel(gtk.EventBox):
|
|||||||
self.decoration = decoration
|
self.decoration = decoration
|
||||||
text = '<span %s>%s</span>' % (self.decoration, self.orig_text)
|
text = '<span %s>%s</span>' % (self.decoration, self.orig_text)
|
||||||
|
|
||||||
msg = _('Click to make the active person\n'
|
if func:
|
||||||
'Right click to display the edit menu')
|
msg = _('Click to make the active person\n'
|
||||||
if not Config.get(Config.RELEDITBTN):
|
'Right click to display the edit menu')
|
||||||
msg += "\n" + _('Edit icons can be enabled in the Preferences dialog')
|
if not Config.get(Config.RELEDITBTN):
|
||||||
|
msg += "\n" + _('Edit icons can be enabled in the Preferences dialog')
|
||||||
|
|
||||||
self.tooltips.set_tip(self, msg)
|
self.tooltips.set_tip(self, msg)
|
||||||
|
|
||||||
self.label = gtk.Label(text)
|
self.label = gtk.Label(text)
|
||||||
self.label.set_use_markup(True)
|
self.label.set_use_markup(True)
|
||||||
@ -143,11 +144,12 @@ class LinkLabel(gtk.EventBox):
|
|||||||
hbox.pack_start(GenderLabel(label[1]), False, False, 0)
|
hbox.pack_start(GenderLabel(label[1]), False, False, 0)
|
||||||
hbox.set_spacing(4)
|
hbox.set_spacing(4)
|
||||||
self.add(hbox)
|
self.add(hbox)
|
||||||
|
|
||||||
self.connect('button-press-event', func, handle)
|
if func:
|
||||||
self.connect('enter-notify-event', self.enter_text, handle)
|
self.connect('button-press-event', func, handle)
|
||||||
self.connect('leave-notify-event', self.leave_text, handle)
|
self.connect('enter-notify-event', self.enter_text, handle)
|
||||||
self.connect('realize', realize_cb)
|
self.connect('leave-notify-event', self.leave_text, handle)
|
||||||
|
self.connect('realize', realize_cb)
|
||||||
|
|
||||||
def set_padding(self, x, y):
|
def set_padding(self, x, y):
|
||||||
self.label.set_padding(x, y)
|
self.label.set_padding(x, y)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user