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
This commit is contained in:
parent
9d086224f1
commit
33fd3137f3
@ -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()
|
||||
|
||||
|
@ -6745,30 +6745,6 @@ Unknown
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>surname</name>
|
||||
<can_focus>True</can_focus>
|
||||
<editable>True</editable>
|
||||
<text_visible>True</text_visible>
|
||||
<text_max_length>0</text_max_length>
|
||||
<text></text>
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
<right_attach>2</right_attach>
|
||||
<top_attach>1</top_attach>
|
||||
<bottom_attach>2</bottom_attach>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>True</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
<xshrink>False</xshrink>
|
||||
<yshrink>False</yshrink>
|
||||
<xfill>True</xfill>
|
||||
<yfill>False</yfill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox32</name>
|
||||
@ -6845,6 +6821,48 @@ Unknown
|
||||
<yfill>False</yfill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkCombo</class>
|
||||
<name>surnameCombo</name>
|
||||
<value_in_list>False</value_in_list>
|
||||
<ok_if_empty>True</ok_if_empty>
|
||||
<case_sensitive>False</case_sensitive>
|
||||
<use_arrows>True</use_arrows>
|
||||
<use_arrows_always>False</use_arrows_always>
|
||||
<items></items>
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
<right_attach>2</right_attach>
|
||||
<top_attach>1</top_attach>
|
||||
<bottom_attach>2</bottom_attach>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>True</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
<xshrink>False</xshrink>
|
||||
<yshrink>False</yshrink>
|
||||
<xfill>True</xfill>
|
||||
<yfill>False</yfill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<child_name>GtkCombo:entry</child_name>
|
||||
<name>surname</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>insert_text</name>
|
||||
<handler>on_combo_insert_text</handler>
|
||||
<object>surnameCombo</object>
|
||||
<last_modification_time>Sat, 27 Oct 2001 21:43:29 GMT</last_modification_time>
|
||||
</signal>
|
||||
<editable>True</editable>
|
||||
<text_visible>True</text_visible>
|
||||
<text_max_length>0</text_max_length>
|
||||
<text></text>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -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)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user