* src/DataViews/_RelationView.py: renamed from _FamilyView
* src/DataViews/__init__.py: use RelationView.py * src/DataViews/Makefile.am: update svn: r6761
This commit is contained in:
parent
9cb82c9dac
commit
80dcaea023
@ -7,6 +7,9 @@
|
|||||||
birth/deat reference.
|
birth/deat reference.
|
||||||
|
|
||||||
2006-05-23 Don Allingham <don@gramps-project.org>
|
2006-05-23 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/DataViews/_RelationView.py: renamed from _FamilyView
|
||||||
|
* src/DataViews/__init__.py: use RelationView.py
|
||||||
|
* src/DataViews/Makefile.am: update
|
||||||
* src/DataViews/_FamilyView.py: more shading
|
* src/DataViews/_FamilyView.py: more shading
|
||||||
|
|
||||||
2006-05-22 Alex Roitman <shura@gramps-project.org>
|
2006-05-22 Alex Roitman <shura@gramps-project.org>
|
||||||
|
@ -56,7 +56,7 @@ src/Config/_GrampsIniKeys.py
|
|||||||
src/Config/__init__.py
|
src/Config/__init__.py
|
||||||
src/DataViews/_EventView.py
|
src/DataViews/_EventView.py
|
||||||
src/DataViews/_FamilyList.py
|
src/DataViews/_FamilyList.py
|
||||||
src/DataViews/_FamilyView.py
|
src/DataViews/_RelationView.py
|
||||||
src/DataViews/__init__.py
|
src/DataViews/__init__.py
|
||||||
src/DataViews/_MapView.py
|
src/DataViews/_MapView.py
|
||||||
src/DataViews/_MediaView.py
|
src/DataViews/_MediaView.py
|
||||||
|
@ -8,7 +8,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/DataViews
|
|||||||
pkgdata_PYTHON = \
|
pkgdata_PYTHON = \
|
||||||
__init__.py\
|
__init__.py\
|
||||||
_PersonView.py\
|
_PersonView.py\
|
||||||
_FamilyView.py\
|
_RelationView.py\
|
||||||
_FamilyList.py\
|
_FamilyList.py\
|
||||||
_PedigreeView.py\
|
_PedigreeView.py\
|
||||||
_EventView.py\
|
_EventView.py\
|
||||||
|
@ -71,12 +71,13 @@ class AttachList:
|
|||||||
|
|
||||||
def attach(self, widget, x0, x1, y0, y1, xoptions=gtk.EXPAND|gtk.FILL,
|
def attach(self, widget, x0, x1, y0, y1, xoptions=gtk.EXPAND|gtk.FILL,
|
||||||
yoptions=gtk.EXPAND|gtk.FILL):
|
yoptions=gtk.EXPAND|gtk.FILL):
|
||||||
|
assert(widget)
|
||||||
assert(x1>x0)
|
assert(x1>x0)
|
||||||
self.list.append((widget, x0, x1, y0, y1, xoptions, yoptions))
|
self.list.append((widget, x0, x1, y0, y1, xoptions, yoptions))
|
||||||
self.max_x = max(self.max_x, x1)
|
self.max_x = max(self.max_x, x1)
|
||||||
self.max_y = max(self.max_y, y1)
|
self.max_y = max(self.max_y, y1)
|
||||||
|
|
||||||
class FamilyView(PageView.PersonNavView):
|
class RelationshipView(PageView.PersonNavView):
|
||||||
|
|
||||||
def __init__(self, dbstate, uistate):
|
def __init__(self, dbstate, uistate):
|
||||||
|
|
||||||
@ -537,9 +538,24 @@ class FamilyView(PageView.PersonNavView):
|
|||||||
|
|
||||||
label = _("Siblings")
|
label = _("Siblings")
|
||||||
if child_list:
|
if child_list:
|
||||||
|
eventbox = gtk.EventBox()
|
||||||
|
eventbox.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
|
vbox = gtk.VBox()
|
||||||
|
label_cell = self.build_label_cell(_('Siblings'))
|
||||||
|
label_cell.set_alignment(0,0)
|
||||||
|
self.attach.attach(
|
||||||
|
label_cell, _CLABEL_START, _CLABEL_STOP, self.row,
|
||||||
|
self.row+1, xoptions=gtk.FILL|gtk.SHRINK,
|
||||||
|
yoptions=gtk.FILL)
|
||||||
|
|
||||||
for child_handle in child_list:
|
for child_handle in child_list:
|
||||||
self.write_child(label, child_handle)
|
self.write_child(vbox, child_handle)
|
||||||
label = u""
|
|
||||||
|
eventbox.add(vbox)
|
||||||
|
self.attach.attach(
|
||||||
|
eventbox, _CDATA_START, _CDATA_STOP, self.row,
|
||||||
|
self.row+1)
|
||||||
|
|
||||||
self.row += 1
|
self.row += 1
|
||||||
|
|
||||||
def write_person(self, title, handle):
|
def write_person(self, title, handle):
|
||||||
@ -580,39 +596,31 @@ class FamilyView(PageView.PersonNavView):
|
|||||||
self.attach.attach(eventbox, _PDATA_START, _PDATA_STOP,
|
self.attach.attach(eventbox, _PDATA_START, _PDATA_STOP,
|
||||||
self.row, self.row+1)
|
self.row, self.row+1)
|
||||||
self.row += 1
|
self.row += 1
|
||||||
|
return vbox
|
||||||
|
|
||||||
|
def build_label_cell(self, title):
|
||||||
def write_child(self, title, handle):
|
|
||||||
if title:
|
if title:
|
||||||
format = '<span weight="bold">%s: </span>'
|
format = '<span weight="bold">%s: </span>'
|
||||||
else:
|
else:
|
||||||
format = "%s"
|
format = "%s"
|
||||||
|
|
||||||
label = GrampsWidgets.MarkupLabel(format % cgi.escape(title))
|
return GrampsWidgets.MarkupLabel(format % cgi.escape(title))
|
||||||
self.attach.attach(label, _CLABEL_START, _CLABEL_STOP, self.row,
|
|
||||||
self.row+1, xoptions=gtk.FILL|gtk.SHRINK)
|
|
||||||
|
|
||||||
|
def write_child(self, vbox, handle):
|
||||||
link_label = GrampsWidgets.LinkLabel(self.get_name(handle, True),
|
link_label = GrampsWidgets.LinkLabel(self.get_name(handle, True),
|
||||||
self.button_press, handle)
|
self.button_press, handle)
|
||||||
|
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
||||||
self.attach.attach(GrampsWidgets.LinkBox(link_label, button),
|
vbox.pack_start(GrampsWidgets.LinkBox(link_label, button))
|
||||||
_CDATA_START, _CDATA_STOP, self.row, self.row+1,
|
|
||||||
xoptions=gtk.EXPAND|gtk.FILL)
|
|
||||||
|
|
||||||
self.row += 1
|
|
||||||
|
|
||||||
if self.show_details:
|
if self.show_details:
|
||||||
value = self.info_string(handle)
|
value = self.info_string(handle)
|
||||||
if value:
|
if value:
|
||||||
self.attach.attach(GrampsWidgets.BasicLabel(value),
|
vbox.add(GrampsWidgets.BasicLabel(value))
|
||||||
_CDTLS_START, _CDTLS_STOP, self.row,
|
|
||||||
self.row+1)
|
|
||||||
self.row += 1
|
|
||||||
|
|
||||||
def write_data(self, title, start_col=_SDATA_START, stop_col=_SDATA_STOP):
|
def write_data(self, box, title, start_col=_SDATA_START,
|
||||||
self.attach.attach(GrampsWidgets.BasicLabel(title), start_col, stop_col,
|
stop_col=_SDATA_STOP):
|
||||||
self.row, self.row+1, xoptions=gtk.EXPAND|gtk.FILL)
|
box.add(GrampsWidgets.BasicLabel(title))
|
||||||
self.row += 1
|
|
||||||
|
|
||||||
def info_string(self, handle):
|
def info_string(self, handle):
|
||||||
child = self.dbstate.db.get_person_from_handle(handle)
|
child = self.dbstate.db.get_person_from_handle(handle)
|
||||||
@ -637,25 +645,25 @@ class FamilyView(PageView.PersonNavView):
|
|||||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
|
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
|
||||||
self.dbstate.change_active_handle(handle)
|
self.dbstate.change_active_handle(handle)
|
||||||
|
|
||||||
def write_relationship(self, family):
|
def write_relationship(self, box, family):
|
||||||
self.write_data(_('Relationship type: %s') %
|
msg = _('Relationship type: %s') % str(family.get_relationship())
|
||||||
str(family.get_relationship()))
|
box.add(GrampsWidgets.MarkupLabel(msg))
|
||||||
|
|
||||||
def place_name(self, handle):
|
def place_name(self, handle):
|
||||||
p = self.dbstate.db.get_place_from_handle(handle)
|
p = self.dbstate.db.get_place_from_handle(handle)
|
||||||
return p.get_title()
|
return p.get_title()
|
||||||
|
|
||||||
def write_marriage(self, family):
|
def write_marriage(self, vbox, family):
|
||||||
value = False
|
value = False
|
||||||
for event_ref in family.get_event_ref_list():
|
for event_ref in family.get_event_ref_list():
|
||||||
handle = event_ref.ref
|
handle = event_ref.ref
|
||||||
event = self.dbstate.db.get_event_from_handle(handle)
|
event = self.dbstate.db.get_event_from_handle(handle)
|
||||||
if event.get_type() == RelLib.EventType.MARRIAGE:
|
if event.get_type() == RelLib.EventType.MARRIAGE:
|
||||||
self.write_event_ref(_('Marriage'), event)
|
self.write_event_ref(vbox, _('Marriage'), event)
|
||||||
value = True
|
value = True
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def write_event_ref(self, ename, event, start_col=_SDATA_START,
|
def write_event_ref(self, vbox, ename, event, start_col=_SDATA_START,
|
||||||
stop_col=_SDATA_STOP):
|
stop_col=_SDATA_STOP):
|
||||||
if event:
|
if event:
|
||||||
dobj = event.get_date_object()
|
dobj = event.get_date_object()
|
||||||
@ -677,16 +685,16 @@ class FamilyView(PageView.PersonNavView):
|
|||||||
|
|
||||||
if dobj:
|
if dobj:
|
||||||
if pname:
|
if pname:
|
||||||
self.write_data(_('%(event_type)s: %(date)s in %(place)s') %
|
self.write_data(vbox, _('%(event_type)s: %(date)s in %(place)s') %
|
||||||
value, start_col, stop_col)
|
value, start_col, stop_col)
|
||||||
else:
|
else:
|
||||||
self.write_data(_('%(event_type)s: %(date)s') % value,
|
self.write_data(vbox, _('%(event_type)s: %(date)s') % value,
|
||||||
start_col, stop_col)
|
start_col, stop_col)
|
||||||
elif pname:
|
elif pname:
|
||||||
self.write_data(_('%(event_type)s: %(place)s') % value,
|
self.write_data(vbox, _('%(event_type)s: %(place)s') % value,
|
||||||
start_col, stop_col)
|
start_col, stop_col)
|
||||||
else:
|
else:
|
||||||
self.write_data(_('%(event_type)s:') % value,
|
self.write_data(vbox, _('%(event_type)s:') % value,
|
||||||
start_col, stop_col)
|
start_col, stop_col)
|
||||||
|
|
||||||
def write_family(self, family_handle):
|
def write_family(self, family_handle):
|
||||||
@ -700,23 +708,31 @@ class FamilyView(PageView.PersonNavView):
|
|||||||
|
|
||||||
self.write_label("%s:" % _('Family'), family, False)
|
self.write_label("%s:" % _('Family'), family, False)
|
||||||
if handle:
|
if handle:
|
||||||
self.write_person(_('Spouse'), handle)
|
box = self.write_person(_('Spouse'), handle)
|
||||||
|
|
||||||
value = self.info_string(handle)
|
print family
|
||||||
if value:
|
if not self.write_marriage(box, family):
|
||||||
self.attach.attach(GrampsWidgets.BasicLabel(value),
|
self.write_relationship(box, family)
|
||||||
_PDTLS_START, _PDTLS_STOP,
|
|
||||||
self.row, self.row+1)
|
|
||||||
self.row += 1
|
|
||||||
if not self.write_marriage(family):
|
|
||||||
self.write_relationship(family)
|
|
||||||
|
|
||||||
child_list = family.get_child_ref_list()
|
child_list = family.get_child_ref_list()
|
||||||
label = _("Children")
|
|
||||||
if child_list:
|
if child_list:
|
||||||
|
eventbox = gtk.EventBox()
|
||||||
|
eventbox.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
|
vbox = gtk.VBox()
|
||||||
|
label_cell = self.build_label_cell(_('Children'))
|
||||||
|
label_cell.set_alignment(0,0)
|
||||||
|
self.attach.attach(
|
||||||
|
label_cell, _CLABEL_START, _CLABEL_STOP, self.row,
|
||||||
|
self.row+1, xoptions=gtk.FILL|gtk.SHRINK,
|
||||||
|
yoptions=gtk.FILL)
|
||||||
|
|
||||||
for child_ref in child_list:
|
for child_ref in child_list:
|
||||||
self.write_child(label, child_ref.ref)
|
self.write_child(vbox, child_ref.ref)
|
||||||
label = u""
|
|
||||||
|
eventbox.add(vbox)
|
||||||
|
self.attach.attach(
|
||||||
|
eventbox, _CDATA_START, _CDATA_STOP, self.row,
|
||||||
|
self.row+1)
|
||||||
|
|
||||||
self.row += 1
|
self.row += 1
|
||||||
|
|
@ -20,7 +20,7 @@
|
|||||||
# $Id: __init__.py 6067 2006-03-04 05:24:16Z dallingham $
|
# $Id: __init__.py 6067 2006-03-04 05:24:16Z dallingham $
|
||||||
|
|
||||||
from _PersonView import PersonView
|
from _PersonView import PersonView
|
||||||
from _FamilyView import FamilyView
|
from _RelationView import RelationshipView
|
||||||
from _FamilyList import FamilyListView
|
from _FamilyList import FamilyListView
|
||||||
from _PedigreeView import PedigreeView
|
from _PedigreeView import PedigreeView
|
||||||
from _EventView import EventView
|
from _EventView import EventView
|
||||||
@ -31,6 +31,6 @@ from _MapView import MapView
|
|||||||
from _RepositoryView import RepositoryView
|
from _RepositoryView import RepositoryView
|
||||||
|
|
||||||
def get_views():
|
def get_views():
|
||||||
return [PersonView, FamilyView, FamilyListView, PedigreeView,
|
return [PersonView, RelationshipView, FamilyListView, PedigreeView,
|
||||||
EventView, SourceView, PlaceView, MediaView,
|
EventView, SourceView, PlaceView, MediaView,
|
||||||
MapView, RepositoryView]
|
MapView, RepositoryView]
|
||||||
|
Loading…
Reference in New Issue
Block a user