Pre02 for gramps-0.9.0

svn: r1160
This commit is contained in:
Don Allingham 2002-11-02 21:19:58 +00:00
parent 8fda52fb98
commit 814af540c2
11 changed files with 222 additions and 1045 deletions

View File

@ -100,8 +100,7 @@ class AutoCompBase:
this form of a select_region() call works in a signal handler and
the other form doesn't is a mystery.
"""
#entry.select_region(0, 0)
pass
entry.select_region(0, 0)
def timer_callback(self,entry):
"""

View File

@ -137,7 +137,6 @@ class EditPerson:
"on_ldsendow_src_clicked" : self.on_ldsendow_source_clicked,
"on_ldsseal_src_clicked" : self.on_ldsseal_source_clicked,
"on_name_source_clicked" : self.on_primary_name_source_clicked,
"on_photolist_button_press_event" : self.gallery.on_button_press_event,
"on_photolist_select_icon" : self.gallery.on_photo_select_icon,
"on_update_address_clicked" : self.on_update_addr_clicked,
"on_update_attr_clicked" : self.on_update_attr_clicked,

View File

@ -40,6 +40,7 @@ import GrampsCfg
from RelLib import Person
import AddSpouse
import SelectChild
import DisplayTrace
import Marriage
import ChooseParents
@ -88,6 +89,7 @@ class FamilyView:
self.top.get_widget('del_spparents').connect('clicked',self.del_sp_parents)
self.top.get_widget('fam_back').connect('clicked',self.child_back)
self.top.get_widget('del_child_btn').connect('clicked',self.remove_child_clicked)
self.top.get_widget('add_child_btn').connect('clicked',self.add_child_clicked)
column = gtk.TreeViewColumn('',gtk.CellRendererText(),text=0)
self.spouse_list.append_column(column)
@ -154,6 +156,16 @@ class FamilyView:
except:
DisplayTrace.DisplayTrace()
def add_child_clicked(self,obj):
if not self.person:
return
try:
SelectChild.SelectChild(self.parent.db, self.family,
self.person,
self.load_family)
except:
DisplayTrace.DisplayTrace()
def remove_child_clicked(self,obj):
if not self.family or not self.person:
return

View File

@ -25,6 +25,7 @@
#-------------------------------------------------------------------------
import os
import string
import urlparse
#-------------------------------------------------------------------------
#
@ -226,6 +227,47 @@ class Gallery(ImageSelect):
self.x = 0
self.y = 0
def item_event(self, widget, event=None):
photo = widget.get_data('obj')
if event.type == gtk.gdk.BUTTON_PRESS:
if event.button == 1:
# Remember starting position.
self.remember_x = event.x
self.remember_y = event.y
return gtk.TRUE
elif event.button == 3:
self.show_popup(photo)
return gtk.TRUE
elif event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
#Change the item's color.
print photo,self.path,self
LocalMediaProperties(photo,self.path,self)
return gtk.TRUE
elif event.type == gtk.gdk.MOTION_NOTIFY:
if event.state & gtk.gdk.BUTTON1_MASK:
# Get the new position and move by the difference
new_x = event.x
new_y = event.y
self.remember_x = new_x
self.remember_y = new_y
return gtk.TRUE
elif event.type == gtk.gdk.ENTER_NOTIFY:
# Make the outline wide.
return gtk.TRUE
elif event.type == gtk.gdk.LEAVE_NOTIFY:
# Make the outline thin.
return gtk.TRUE
return gtk.FALSE
def savephoto(self, photo):
"""Save the photo in the dataobj object. (Required function)"""
self.db.addObject(photo)
@ -247,6 +289,8 @@ class Gallery(ImageSelect):
y = image.get_height()
grp = self.root.add(gnome.canvas.CanvasGroup,x=self.cx,y=self.cy)
grp.connect('event',self.item_event)
grp.set_data('obj',photo)
xloc = (_IMAGEX-x)/2
yloc = (_IMAGEX-y)/2
@ -284,10 +328,13 @@ class Gallery(ImageSelect):
self.cx = 10
self.cy = 10
(self.x,self.y) = self.iconlist.get_size()
self.max = (self.x)/(_IMAGEX+10)
for photo in self.dataobj.getPhotoList():
self.add_thumbnail(photo)
(self.x,self.y) = self.iconlist.get_size()
if self.cy > self.y:
self.iconlist.set_scroll_region(0,0,self.x,self.cy)
else:
@ -297,10 +344,16 @@ class Gallery(ImageSelect):
"""User clicked on a photo. Remember which one."""
self.selectedIcon = iconNumber
def get_index(self,obj,x,y):
x_offset = x/(_IMAGEX+10)
y_offset = y/(_IMAGEY+10)
index = (y_offset*self.max)+x_offset
return min(index,len(self.dataobj.getPhotoList()))
def on_photolist_drag_data_received(self,w, context, x, y, data, info, time):
import urlparse
print "receive",w
if data and data.format == 8:
icon_index = w.get_icon_at(x,y)
icon_index = self.get_index(w,x,y)
d = string.strip(string.replace(data.data,'\0',' '))
protocol,site,file, j,k,l = urlparse.urlparse(d)
if protocol == "file":
@ -348,7 +401,7 @@ class Gallery(ImageSelect):
photo.setPath(name)
except:
photo.setPath(tfile)
w.drag_finish(context, 1, 0, time)
# w.drag_finish(context, 1, 0, time)
return
self.add_thumbnail(oref)
self.parent.lists_changed = 1
@ -357,14 +410,15 @@ class Gallery(ImageSelect):
GlobalMediaProperties(self.db,photo,None)
else:
if self.db.getObjectMap().has_key(data.data):
icon_index = self.get_index(w,x,y)
index = 0
for p in self.dataobj.getPhotoList():
if data.data == p.getReference().getId():
if index == icon_index or icon_index == -1:
w.drag_finish(context, 0, 0, time)
# w.drag_finish(context, 0, 0, time)
return
else:
w.drag_finish(context, 1, 0, time)
# w.drag_finish(context, 1, 0, time)
nl = self.dataobj.getPhotoList()
item = nl[index]
if icon_index == 0:
@ -387,11 +441,13 @@ class Gallery(ImageSelect):
if GrampsCfg.globalprop:
LocalMediaProperties(oref,self.path,self)
Utils.modified()
w.drag_finish(context, 1, 0, time)
#w.drag_finish(context, 1, 0, time)
else:
w.drag_finish(context, 0, 0, time)
pass
#w.drag_finish(context, 0, 0, time)
def on_photolist_drag_data_get(self,w, context, selection_data, info, time):
print "drag data get",w
if info == 1:
return
if self.selectedIcon != -1:
@ -420,38 +476,34 @@ class Gallery(ImageSelect):
self.selectedIcon = 0
self.icon_list.select_icon(0)
def on_button_press_event(self, obj, event):
def show_popup(self, photo):
"""Look for right-clicks on a picture and create a popup
menu of the available actions."""
icon = self.selectedIcon
if icon == -1:
return
if event.button == 3:
photo = self.dataobj.getPhotoList()[icon]
menu = gtk.Menu()
item = gtk.TearoffMenuItem()
item.show()
menu.append(item)
mtype = object.getMimeType()
progname = grampslib.default_application_name(mtype)
Utils.add_menuitem(menu,_("Open in %s") % progname,
None,self.popup_view_photo)
object = photo.getReference()
if mtype[0:5] == "image":
Utils.add_menuitem(menu,_("Edit with the GIMP"),
None,self.popup_edit_photo)
Utils.add_menuitem(menu,_("Edit Object Properties"),None,
self.popup_change_description)
if object.getLocal() == 0:
Utils.add_menuitem(menu,_("Convert to local copy"),None,
self.popup_convert_to_private)
menu.popup(None,None,None,0,0)
menu = gtk.Menu()
item = gtk.TearoffMenuItem()
item.show()
menu.append(item)
object = photo.getReference()
mtype = object.getMimeType()
progname = grampslib.default_application_name(mtype)
Utils.add_menuitem(menu,_("Open in %s") % progname,
photo,self.popup_view_photo)
if mtype[0:5] == "image":
Utils.add_menuitem(menu,_("Edit with the GIMP"),
photo,self.popup_edit_photo)
Utils.add_menuitem(menu,_("Edit Object Properties"),photo,
self.popup_change_description)
if object.getLocal() == 0:
Utils.add_menuitem(menu,_("Convert to local copy"),photo,
self.popup_convert_to_private)
menu.popup(None,None,None,0,0)
def popup_view_photo(self, obj):
"""Open this picture in a picture viewer"""
photo = self.dataobj.getPhotoList()[self.selectedIcon]
photo = obj.get_data('o')
Utils.view_photo(photo.getReference())
def popup_edit_photo(self, obj):
@ -501,18 +553,19 @@ class LocalMediaProperties:
self.attr_value = self.change_dialog.get_widget("attr_value")
self.attr_details = self.change_dialog.get_widget("attr_details")
self.attr_list = self.change_dialog.get_widget("attr_list")
self.attr_model = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_STRING)
Utils.build_columns(self.attr_list, [(_('Attribute'),150,-1), (_('Value'),100,-1)])
Utils.build_columns(self.attr_list, [(_('Attribute'),150,-1),
(_('Value'),100,-1)])
self.attr_list.set_model(self.attr_model)
self.attr_list.get_selection().connect('changed',self.on_attr_list_select_row)
descr_window.set_text(self.object.getDescription())
mtype = self.object.getMimeType()
self.pix = gtk.gdk.pixbuf_new_from_file(path)
pixmap.set_from_pixbuf(self.pix)
if os.path.isfile(path):
self.pix = gtk.gdk.pixbuf_new_from_file(path)
pixmap.set_from_pixbuf(self.pix)
self.change_dialog.get_widget("private").set_active(photo.getPrivacy())
self.change_dialog.get_widget("gid").set_text(self.object.getId())

View File

@ -58,9 +58,21 @@ class ListModel:
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn(name[0],renderer,text=cnum)
column.set_min_width(name[1])
if name[2]:
column.set_sort_column_id(name[2])
if name[0] == '':
column.set_clickable(gtk.TRUE)
column.set_visible(gtk.FALSE)
else:
column.set_resizable(gtk.TRUE)
cnum = cnum + 1
tree.append_column(column)
if cnum == 1:
column.clicked()
def clear(self):
self.model.clear()
def add(self,data):
iter = self.model.append()
col = 0

View File

@ -32,8 +32,7 @@ import gnome.ui
#
#-------------------------------------------------------------------------
import Utils
from intl import gettext
_ = gettext
from intl import gettext as _
#-------------------------------------------------------------------------
#
@ -62,7 +61,7 @@ class NoteEditor:
self.entry = gtk.TextView()
self.entry.set_editable(gtk.TRUE)
self.entry.show()
scroll = gtk.ScrolledWindow()
scroll.add(self.entry)
scroll.set_policy (gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)

View File

@ -23,8 +23,14 @@
# internationalization
#
#-------------------------------------------------------------------------
from intl import gettext
_ = gettext
from intl import gettext as _
#-------------------------------------------------------------------------
#
# standard python modules
#
#-------------------------------------------------------------------------
import string
#-------------------------------------------------------------------------
#
@ -44,8 +50,8 @@ import const
import sort
import Utils
import GrampsCfg
import string
import AutoComp
import ListModel
#-------------------------------------------------------------------------
#
@ -64,13 +70,13 @@ class SelectChild:
self.xml.signal_autoconnect({
"on_save_child_clicked" : self.on_save_child_clicked,
"on_show_toggled" : self.on_show_toggled,
"on_add_person_clicked" : self.on_add_person_clicked,
"destroy_passed_object" : Utils.destroy_passed_object
})
self.select_child_list = {}
self.top = self.xml.get_widget("selectChild")
self.add_child = self.xml.get_widget("addChild")
# self.add_child.set_column_visibility(1,GrampsCfg.id_visible)
self.add_child = self.xml.get_widget("childlist")
if (self.family):
father = self.family.getFather()
@ -99,14 +105,17 @@ class SelectChild:
self.mrel = self.xml.get_widget("mrel")
self.frel = self.xml.get_widget("frel")
self.mrel.set_text(_("Birth"))
self.frel.set_text(_("Birth"))
self.refmodel = ListModel.ListModel(self.add_child,[(_('Name'),150,3),(_('ID'),50,1),
(_('Birth Date'),100,4),
('',0,0),('',0,0)])
self.redraw_child_list(2)
self.top.show()
def redraw_child_list(self,filter):
self.add_child.freeze()
self.add_child.clear()
self.refmodel.clear()
index = 0
bday = self.person.getBirth().getDateObj()
@ -160,39 +169,40 @@ class SelectChild:
person_list.append(person)
person_list.sort(sort.by_last_name)
for person in person_list:
self.add_child.append([Utils.phonebook_name(person),
Utils.birthday(person),
person.getId()])
self.add_child.set_row_data(index,person)
index = index + 1
self.add_child.thaw()
dinfo = self.db.getPersonDisplay(id)
rdata = [dinfo[0],dinfo[1],dinfo[3],dinfo[5],dinfo[6]]
self.refmodel.add(rdata)
def on_save_child_clicked(self,obj):
for row in self.add_child.selection:
select_child = self.add_child.get_row_data(row)
if self.family == None:
self.family = self.db.newFamily()
self.person.addFamily(self.family)
if self.person.getGender() == Person.male:
self.family.setFather(self.person)
else:
self.family.setMother(self.person)
store,iter = self.refmodel.selection.get_selected()
self.family.addChild(select_child)
mrel = const.childRelations[self.mrel.get_text()]
mother = self.family.getMother()
if mother and mother.getGender() != Person.female:
if mrel == "Birth":
mrel = "Unknown"
if not iter:
return
id = self.refmodel.model.get_value(iter,1)
select_child = self.db.getPerson(id)
if self.family == None:
self.family = self.db.newFamily()
self.person.addFamily(self.family)
if self.person.getGender() == Person.male:
self.family.setFather(self.person)
else:
self.family.setMother(self.person)
frel = const.childRelations[self.frel.get_text()]
father = self.family.getFather()
if father and father.getGender() != Person.male:
if frel == "Birth":
frel = "Unknown"
self.family.addChild(select_child)
mrel = const.childRelations[self.mrel.get_text()]
mother = self.family.getMother()
if mother and mother.getGender() != Person.female:
if mrel == "Birth":
mrel = "Unknown"
frel = const.childRelations[self.frel.get_text()]
father = self.family.getFather()
if father and father.getGender() != Person.male:
if frel == "Birth":
frel = "Unknown"
# if mrel == "Birth" and frel == "Birth":
# family = select_child.getMainFamily()
@ -201,9 +211,9 @@ class SelectChild:
#
# select_child.setMainFamily(self.family)
# else:
select_child.addAltFamily(self.family,mrel,frel)
select_child.addAltFamily(self.family,mrel,frel)
Utils.modified()
Utils.modified()
Utils.destroy_passed_object(obj)
self.redraw(self.family)
@ -211,185 +221,18 @@ class SelectChild:
def on_show_toggled(self,obj):
self.redraw_child_list(obj.get_active())
class NewChild:
def __init__(self,db,family,person,update,update_disp,autoname=3):
self.db = db
self.person = person
self.family = family
self.update = update
self.edit_update = update_disp
def on_add_person_clicked(self,obj):
"""Called with the Add button is pressed. Calls the QuickAdd
class to create a new person."""
self.xml = gtk.glade.XML(const.gladeFile,"addChild")
self.xml.signal_autoconnect({
"on_addchild_ok_clicked" : self.on_addchild_ok_clicked,
"on_edit_new_child" : self.on_edit_new_child,
"on_male_toggled" : self.on_male_toggled,
"on_female_toggled" : self.on_female_toggled,
"on_gender_toggled" : self.on_gender_toggled,
"destroy_passed_object" : Utils.destroy_passed_object
})
import QuickAdd
QuickAdd.QuickAdd(self.db,"male",self.add_new_parent)
if autoname == 0:
self.update_surname = self.north_american
elif autoname == 2:
self.update_surname = self.latin_american
elif autoname == 3:
self.update_surname = self.icelandic
else:
self.update_surname = self.no_name
self.mrel = self.xml.get_widget("mrel")
self.frel = self.xml.get_widget("frel")
self.top = self.xml.get_widget("addChild")
self.surname = self.xml.get_widget("surname")
self.given = self.xml.get_widget("childGiven")
if GrampsCfg.autocomp:
self.comp = AutoComp.AutoEntry(self.surname,self.db.getSurnames())
self.surname.set_text(self.update_surname(2))
if self.family:
father = self.family.getFather()
mother = self.family.getMother()
if father != None:
fname = father.getPrimaryName().getName()
label = _("Relationship to %s") % fname
self.xml.get_widget("flabel").set_text(label)
if mother != None:
mname = mother.getPrimaryName().getName()
label = _("Relationship to %s") % mname
self.xml.get_widget("mlabel").set_text(label)
else:
fname = self.person.getPrimaryName().getName()
label = _("Relationship to %s") % fname
if self.person.getGender() == Person.male:
self.xml.get_widget("flabel").set_text(label)
self.xml.get_widget("mcombo").set_sensitive(0)
else:
self.xml.get_widget("mlabel").set_text(label)
self.xml.get_widget("fcombo").set_sensitive(0)
self.mrel.set_text(_("Birth"))
self.frel.set_text(_("Birth"))
# Typing CR selects OK button
self.top.editable_enters(self.given)
self.top.editable_enters(self.surname)
self.top.editable_enters(self.mrel)
self.top.editable_enters(self.frel)
self.top.show()
def on_male_toggled(self,obj):
if obj.get_active():
txt = self.surname.get_text()
if txt == "" or txt == self.update_surname(1):
self.surname.set_text(self.update_surname(0))
def on_female_toggled(self,obj):
if obj.get_active():
txt = self.surname.get_text()
if txt == "" or txt == self.update_surname(0):
self.surname.set_text(self.update_surname(1))
def on_gender_toggled(self,obj):
pass
def combo_insert_text(self,combo,new_text,new_text_len,i_dont_care):
Utils.combo_insert_text(combo,new_text,new_text_len,i_dont_care)
def north_american(self,val):
if self.person.getGender() == Person.male:
return self.person.getPrimaryName().getSurname()
elif self.family:
f = self.family.getFather()
if f:
return f.getPrimaryName().getSurname()
return ""
def no_name(self,val):
return ""
def latin_american(self,val):
if self.family:
father = self.family.getFather()
mother = self.family.getMother()
if not father or not mother:
return ""
fsn = father.getPrimaryName().getSurname()
msn = mother.getPrimaryName().getSurname()
if not father or not mother:
return ""
return "%s %s" % (string.split(fsn)[0],string.split(msn)[0])
else:
return ""
def icelandic(self,val):
fname = ""
if self.person.getGender() == Person.male:
fname = self.person.getPrimaryName().getFirstName()
elif self.family:
f = self.family.getFather()
if f:
fname = f.getPrimaryName().getFirstName()
if fname:
fname = string.split(fname)[0]
if val == 0:
return "%ssson" % fname
elif val == 1:
return "%sdóttir" % fname
else:
return ""
def on_addchild_ok_clicked(self,obj):
surname = self.surname.get_text()
given = self.given.get_text()
person = Person()
self.db.addPerson(person)
name = Name()
name.setSurname(surname)
name.setFirstName(given)
person.setPrimaryName(name)
if self.xml.get_widget("childMale").get_active():
person.setGender(Person.male)
elif self.xml.get_widget("childFemale").get_active():
person.setGender(Person.female)
else:
person.setGender(Person.unknown)
if not self.family:
self.family = self.db.newFamily()
if self.person.getGender() == Person.male:
self.family.setFather(self.person)
else:
self.family.setMother(self.person)
self.person.addFamily(self.family)
mrel = const.childRelations[self.mrel.get_text()]
frel = const.childRelations[self.frel.get_text()]
person.addAltFamily(self.family,mrel,frel)
self.family.addChild(person)
# must do an apply filter here to make sure the main window gets updated
self.update(self.family,person,[])
Utils.modified()
Utils.destroy_passed_object(obj)
self.new_child = person
def on_edit_new_child(self,obj):
import EditPerson
self.on_addchild_ok_clicked(obj)
EditPerson.EditPerson(self.new_child,self.db,self.edit_update)
def add_new_parent(self,person):
"""Adds a new person to either the father list or the mother list,
depending on the gender of the person."""
id = person.getId()
dinfo = self.db.getPersonDisplay(id)
rdata = [dinfo[0],dinfo[1],dinfo[3],dinfo[5],dinfo[6]]
self.refmodel.add(rdata)

View File

@ -264,24 +264,13 @@ def add_menuitem(menu,msg,obj,func):
#-------------------------------------------------------------------------
def view_photo(photo):
type = photo.getMimeType()
prog = grampslib.gnome_vfs_mime_get_value(type,'view')
open = grampslib.gnome_vfs_mime_get_value(type,'open')
edit = grampslib.gnome_vfs_mime_get_value(type,'edit')
if prog == "" and open == "" and edit == "":
#GnomeWarningDialog("Sorry, I cannot find a viewer for %s type" % type)
return
prog = grampslib.default_application_command(type)
if not prog and not open :
prog = edit
else:
prog = open
if not prog:
return
args = []
for val in prog:
if val == "%f":
args.append(photo.getPath())
else:
args.append(val)
args = string.split(prog)
args.append(photo.getPath())
if os.fork() == 0:
os.execvp(args[0],args)

View File

@ -2856,8 +2856,8 @@
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Add new person</property>
<property name="use_underline">True</property>
<property name="label">gtk-add</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_new_spouse_clicked" object="spouseDialog"/>
</widget>
@ -3849,6 +3849,8 @@
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property>
<property name="default_width">450</property>
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">True</property>
@ -3932,7 +3934,7 @@
</widget>
<packing>
<property name="padding">10</property>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
@ -3941,17 +3943,17 @@
<widget class="GtkScrolledWindow" id="scrolledwindow37">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="treeview9">
<widget class="GtkTreeView" id="childlist">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
@ -3963,6 +3965,31 @@
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox31">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="button155">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-add</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_add_person_clicked" last_modification_time="Wed, 30 Oct 2002 15:31:58 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
@ -4051,7 +4078,6 @@
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
<signal name="insert_text" handler="on_combo_insert_text" object="mrel_combo"/>
</widget>
</child>
@ -4258,7 +4284,6 @@
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
<signal name="insert_text" handler="on_combo_insert_text" object="frel_combo"/>
</widget>
</child>
@ -4414,7 +4439,7 @@
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
@ -5082,739 +5107,6 @@
</child>
</widget>
<widget class="GtkDialog" id="addChild">
<property name="visible">True</property>
<property name="title" translatable="yes">Add New Child - GRAMPS</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox12">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area12">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="button98">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Creates the new child and adds him or her as a child of the family</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_addchild_ok_clicked" object="addChild"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button99">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Adds the new person as a child of the family and displays the standard person dialog to allow for more data to be entered</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Add Data</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_edit_new_child" object="addChild"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button147">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="destroy_passed_object" object="addChild"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox32">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="newTitle">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Add New Child&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">5</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHSeparator" id="hseparator16">
<property name="visible">True</property>
</widget>
<packing>
<property name="padding">10</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table20">
<property name="visible">True</property>
<property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
<property name="column_spacing">0</property>
<child>
<widget class="GtkLabel" id="flabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Relationship to Father</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">5</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_padding">5</property>
<property name="y_padding">5</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="childGiven">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_padding">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="surname">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_padding">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCombo" id="mcombo">
<property name="visible">True</property>
<property name="value_in_list">True</property>
<property name="allow_empty">False</property>
<property name="case_sensitive">True</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="frel">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
<signal name="insert_text" handler="on_combo_insert_text" object="fcombo"/>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget84">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget85">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget86">
<property name="visible">True</property>
<property name="label" translatable="yes">Birth</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget87">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget88">
<property name="visible">True</property>
<property name="label" translatable="yes">Adopted</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget89">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget90">
<property name="visible">True</property>
<property name="label" translatable="yes">Stepchild</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget91">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget92">
<property name="visible">True</property>
<property name="label" translatable="yes">None</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget93">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget94">
<property name="visible">True</property>
<property name="label" translatable="yes">Unknown</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget95">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget96">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_padding">5</property>
<property name="y_padding">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCombo" id="fcombo">
<property name="visible">True</property>
<property name="value_in_list">True</property>
<property name="allow_empty">False</property>
<property name="case_sensitive">True</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="mrel">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
<signal name="insert_text" handler="on_combo_insert_text" object="mcombo"/>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget97">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget98">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget99">
<property name="visible">True</property>
<property name="label" translatable="yes">Birth</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget100">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget101">
<property name="visible">True</property>
<property name="label" translatable="yes">Adopted</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget102">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget103">
<property name="visible">True</property>
<property name="label" translatable="yes">Stepchild</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget104">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget105">
<property name="visible">True</property>
<property name="label" translatable="yes">None</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget106">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget107">
<property name="visible">True</property>
<property name="label" translatable="yes">Unknown</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkListItem" id="convertwidget108">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget109">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_padding">5</property>
<property name="y_padding">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox18">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="spacing">0</property>
<child>
<widget class="GtkRadioButton" id="childMale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">male</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_male_toggled"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="childFemale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">female</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">childMale</property>
<signal name="toggled" handler="on_female_toggled"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="childUnknown">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">unknown</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">childMale</property>
<signal name="toggled" handler="on_gender_toggled"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_padding">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label189">
<property name="visible">True</property>
<property name="label" translatable="yes">Given Name</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">5</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_padding">5</property>
<property name="y_padding">5</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label190">
<property name="visible">True</property>
<property name="label" translatable="yes">Surname</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">5</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_padding">5</property>
<property name="y_padding">5</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label191">
<property name="visible">True</property>
<property name="label" translatable="yes">Gender</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">5</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_padding">5</property>
<property name="y_padding">5</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="mlabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Relationship to Mother</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">5</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_padding">5</property>
<property name="y_padding">5</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="addperson">
<property name="visible">True</property>
<property name="title" translatable="yes">Add Person - GRAMPS</property>

View File

@ -259,8 +259,6 @@ class Gramps:
"on_spouse_list_changed" : self.spouse_list_changed,
"on_about_activate" : self.on_about_activate,
"on_add_bookmark_activate" : self.on_add_bookmark_activate,
"on_add_child_clicked" : self.on_add_child_clicked,
"on_add_new_child_clicked" : self.on_add_new_child_clicked,
"on_add_place_clicked" : self.place_view.on_add_place_clicked,
"on_add_source_clicked" : self.source_view.on_add_clicked,
"on_addperson_clicked" : self.load_new_person,
@ -561,28 +559,6 @@ class Gramps:
def add_new_cancel(self,obj):
Utils.destroy_passed_object(self.addornew)
def on_add_child_clicked(self,obj):
"""Select an existing child to add to the active family"""
import SelectChild
if self.active_person:
SelectChild.SelectChild(self.db,self.active_family,
self.active_person,
self.family_view.load_family)
def on_add_new_child_clicked(self,obj):
"""Create a new child to add to the existing family"""
import SelectChild
if self.active_person:
try:
SelectChild.NewChild(self.db,self.active_family,
self.active_person,
self.update_after_newchild,
self.update_after_edit,
GrampsCfg.lastnamegen)
except:
DisplayTrace.DisplayTrace()
def on_new_clicked(self,obj):
"""Prompt for permission to close the current database"""

View File

@ -9,6 +9,8 @@
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">475</property>
<property name="default_height">350</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">True</property>
@ -87,6 +89,7 @@
<child>
<widget class="GtkTreeView" id="tree">
<property name="width_request">175</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>