From 33fd3137f3900a460144e03091556587dd0de903 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Tue, 30 Oct 2001 03:48:57 +0000 Subject: [PATCH] Add last name completion to the 'add person' dialog within the 'Choose Parents' dialog. When new people are added this way, make sure the main people list gets updated. svn: r521 --- src/ChooseParents.py | 15 ++++++++-- src/gramps.glade | 66 ++++++++++++++++++++++++++++---------------- src/gramps_main.py | 2 +- 3 files changed, 55 insertions(+), 28 deletions(-) diff --git a/src/ChooseParents.py b/src/ChooseParents.py index 349f7cdb0..3e1524ae0 100644 --- a/src/ChooseParents.py +++ b/src/ChooseParents.py @@ -57,11 +57,12 @@ import Config class ChooseParents: - def __init__(self,db,person,family,update): + def __init__(self,db,person,family,family_update,full_update): self.db = db self.person = person self.family = family - self.update = update + self.family_update = family_update + self.full_update = full_update if self.family: self.father = self.family.getFather() @@ -238,19 +239,26 @@ class ChooseParents: if self.family: self.family.setRelationship(type) self.change_family_type(self.family,mrel,frel) - self.update(self.family) + self.family_update(self.family) def on_addparent_clicked(self,obj,sex): self.xml = libglade.GladeXML(const.gladeFile,"addperson") self.xml.get_widget(sex).set_active(1) self.xml.signal_autoconnect({ "on_addfather_close": self.on_addparent_close, + "on_combo_insert_text" : utils.combo_insert_text, "destroy_passed_object" : utils.destroy_passed_object }) window = self.xml.get_widget("addperson") window.editable_enters(self.xml.get_widget("given")) window.editable_enters(self.xml.get_widget("surname")) + if len(const.surnames) > 0: + const.surnames.sort() + combo = self.xml.get_widget("surnameCombo") + combo.set_popdown_strings(const.surnames) + combo.disable_activate() + self.xml.get_widget("surname").set_text("") def on_addfather_clicked(self,obj): self.on_addparent_clicked(obj,"male") @@ -330,4 +338,5 @@ class ChooseParents: utils.modified() self.on_prel_changed(self.prel) utils.destroy_passed_object(obj) + self.full_update() diff --git a/src/gramps.glade b/src/gramps.glade index b753c7b4b..8a9e83bfe 100644 --- a/src/gramps.glade +++ b/src/gramps.glade @@ -6745,30 +6745,6 @@ Unknown - - GtkEntry - surname - True - True - True - 0 - - - 1 - 2 - 1 - 2 - 5 - 0 - True - False - False - False - True - False - - - GtkHBox hbox32 @@ -6845,6 +6821,48 @@ Unknown False + + + GtkCombo + surnameCombo + False + True + False + True + False + + + 1 + 2 + 1 + 2 + 5 + 0 + True + False + False + False + True + False + + + + GtkEntry + GtkCombo:entry + surname + True + + insert_text + on_combo_insert_text + surnameCombo + Sat, 27 Oct 2001 21:43:29 GMT + + True + True + 0 + + + diff --git a/src/gramps_main.py b/src/gramps_main.py index f782c825a..59ae26ad9 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -361,7 +361,7 @@ def on_add_new_child_clicked(obj): def on_choose_parents_clicked(obj): import ChooseParents if active_person: - ChooseParents.ChooseParents(database,active_person,active_parents,load_family) + ChooseParents.ChooseParents(database,active_person,active_parents,load_family,full_update) #------------------------------------------------------------------------- #