Birth/death editable on the main page
svn: r469
This commit is contained in:
parent
f3b46772b9
commit
694886dfa8
@ -175,7 +175,7 @@
|
|||||||
<widget>
|
<widget>
|
||||||
<class>GtkTable</class>
|
<class>GtkTable</class>
|
||||||
<name>table16</name>
|
<name>table16</name>
|
||||||
<rows>4</rows>
|
<rows>3</rows>
|
||||||
<columns>3</columns>
|
<columns>3</columns>
|
||||||
<homogeneous>False</homogeneous>
|
<homogeneous>False</homogeneous>
|
||||||
<row_spacing>0</row_spacing>
|
<row_spacing>0</row_spacing>
|
||||||
@ -233,37 +233,12 @@
|
|||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
<widget>
|
|
||||||
<class>GtkEntry</class>
|
|
||||||
<name>birthPlace</name>
|
|
||||||
<width>275</width>
|
|
||||||
<can_focus>True</can_focus>
|
|
||||||
<editable>False</editable>
|
|
||||||
<text_visible>True</text_visible>
|
|
||||||
<text_max_length>0</text_max_length>
|
|
||||||
<text></text>
|
|
||||||
<child>
|
|
||||||
<left_attach>2</left_attach>
|
|
||||||
<right_attach>3</right_attach>
|
|
||||||
<top_attach>1</top_attach>
|
|
||||||
<bottom_attach>2</bottom_attach>
|
|
||||||
<xpad>3</xpad>
|
|
||||||
<ypad>3</ypad>
|
|
||||||
<xexpand>True</xexpand>
|
|
||||||
<yexpand>False</yexpand>
|
|
||||||
<xshrink>False</xshrink>
|
|
||||||
<yshrink>False</yshrink>
|
|
||||||
<xfill>True</xfill>
|
|
||||||
<yfill>False</yfill>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkEntry</class>
|
<class>GtkEntry</class>
|
||||||
<name>birthDate</name>
|
<name>birthDate</name>
|
||||||
<width>250</width>
|
<width>250</width>
|
||||||
<can_focus>True</can_focus>
|
<can_focus>True</can_focus>
|
||||||
<editable>False</editable>
|
<editable>True</editable>
|
||||||
<text_visible>True</text_visible>
|
<text_visible>True</text_visible>
|
||||||
<text_max_length>0</text_max_length>
|
<text_max_length>0</text_max_length>
|
||||||
<text></text>
|
<text></text>
|
||||||
@ -351,8 +326,8 @@
|
|||||||
<child>
|
<child>
|
||||||
<left_attach>2</left_attach>
|
<left_attach>2</left_attach>
|
||||||
<right_attach>3</right_attach>
|
<right_attach>3</right_attach>
|
||||||
<top_attach>3</top_attach>
|
<top_attach>2</top_attach>
|
||||||
<bottom_attach>4</bottom_attach>
|
<bottom_attach>3</bottom_attach>
|
||||||
<xpad>0</xpad>
|
<xpad>0</xpad>
|
||||||
<ypad>0</ypad>
|
<ypad>0</ypad>
|
||||||
<xexpand>False</xexpand>
|
<xexpand>False</xexpand>
|
||||||
@ -365,29 +340,39 @@
|
|||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkLabel</class>
|
<class>GtkCombo</class>
|
||||||
<name>label250</name>
|
<name>bpcombo</name>
|
||||||
<label></label>
|
<value_in_list>False</value_in_list>
|
||||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
<ok_if_empty>True</ok_if_empty>
|
||||||
<wrap>False</wrap>
|
<case_sensitive>False</case_sensitive>
|
||||||
<xalign>0</xalign>
|
<use_arrows>True</use_arrows>
|
||||||
<yalign>0.5</yalign>
|
<use_arrows_always>False</use_arrows_always>
|
||||||
<xpad>0</xpad>
|
<items></items>
|
||||||
<ypad>0</ypad>
|
|
||||||
<child>
|
<child>
|
||||||
<left_attach>2</left_attach>
|
<left_attach>2</left_attach>
|
||||||
<right_attach>3</right_attach>
|
<right_attach>3</right_attach>
|
||||||
<top_attach>2</top_attach>
|
<top_attach>1</top_attach>
|
||||||
<bottom_attach>3</bottom_attach>
|
<bottom_attach>2</bottom_attach>
|
||||||
<xpad>0</xpad>
|
<xpad>3</xpad>
|
||||||
<ypad>0</ypad>
|
<ypad>3</ypad>
|
||||||
<xexpand>False</xexpand>
|
<xexpand>True</xexpand>
|
||||||
<yexpand>True</yexpand>
|
<yexpand>False</yexpand>
|
||||||
<xshrink>False</xshrink>
|
<xshrink>False</xshrink>
|
||||||
<yshrink>False</yshrink>
|
<yshrink>False</yshrink>
|
||||||
<xfill>True</xfill>
|
<xfill>True</xfill>
|
||||||
<yfill>False</yfill>
|
<yfill>False</yfill>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkEntry</class>
|
||||||
|
<child_name>GtkCombo:entry</child_name>
|
||||||
|
<name>birthPlace</name>
|
||||||
|
<can_focus>True</can_focus>
|
||||||
|
<editable>True</editable>
|
||||||
|
<text_visible>True</text_visible>
|
||||||
|
<text_max_length>0</text_max_length>
|
||||||
|
<text></text>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@ -416,43 +401,18 @@
|
|||||||
<widget>
|
<widget>
|
||||||
<class>GtkTable</class>
|
<class>GtkTable</class>
|
||||||
<name>table17</name>
|
<name>table17</name>
|
||||||
<rows>4</rows>
|
<rows>3</rows>
|
||||||
<columns>3</columns>
|
<columns>3</columns>
|
||||||
<homogeneous>False</homogeneous>
|
<homogeneous>False</homogeneous>
|
||||||
<row_spacing>0</row_spacing>
|
<row_spacing>0</row_spacing>
|
||||||
<column_spacing>0</column_spacing>
|
<column_spacing>0</column_spacing>
|
||||||
|
|
||||||
<widget>
|
|
||||||
<class>GtkEntry</class>
|
|
||||||
<name>deathPlace</name>
|
|
||||||
<width>275</width>
|
|
||||||
<can_focus>True</can_focus>
|
|
||||||
<editable>False</editable>
|
|
||||||
<text_visible>True</text_visible>
|
|
||||||
<text_max_length>0</text_max_length>
|
|
||||||
<text></text>
|
|
||||||
<child>
|
|
||||||
<left_attach>2</left_attach>
|
|
||||||
<right_attach>3</right_attach>
|
|
||||||
<top_attach>1</top_attach>
|
|
||||||
<bottom_attach>2</bottom_attach>
|
|
||||||
<xpad>3</xpad>
|
|
||||||
<ypad>3</ypad>
|
|
||||||
<xexpand>True</xexpand>
|
|
||||||
<yexpand>False</yexpand>
|
|
||||||
<xshrink>False</xshrink>
|
|
||||||
<yshrink>False</yshrink>
|
|
||||||
<xfill>True</xfill>
|
|
||||||
<yfill>False</yfill>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkEntry</class>
|
<class>GtkEntry</class>
|
||||||
<name>deathDate</name>
|
<name>deathDate</name>
|
||||||
<width>250</width>
|
<width>250</width>
|
||||||
<can_focus>True</can_focus>
|
<can_focus>True</can_focus>
|
||||||
<editable>False</editable>
|
<editable>True</editable>
|
||||||
<text_visible>True</text_visible>
|
<text_visible>True</text_visible>
|
||||||
<text_max_length>0</text_max_length>
|
<text_max_length>0</text_max_length>
|
||||||
<text></text>
|
<text></text>
|
||||||
@ -524,32 +484,6 @@
|
|||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
<widget>
|
|
||||||
<class>GtkLabel</class>
|
|
||||||
<name>label249</name>
|
|
||||||
<label>:</label>
|
|
||||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
|
||||||
<wrap>False</wrap>
|
|
||||||
<xalign>0</xalign>
|
|
||||||
<yalign>0.5</yalign>
|
|
||||||
<xpad>0</xpad>
|
|
||||||
<ypad>0</ypad>
|
|
||||||
<child>
|
|
||||||
<left_attach>1</left_attach>
|
|
||||||
<right_attach>2</right_attach>
|
|
||||||
<top_attach>2</top_attach>
|
|
||||||
<bottom_attach>3</bottom_attach>
|
|
||||||
<xpad>0</xpad>
|
|
||||||
<ypad>0</ypad>
|
|
||||||
<xexpand>False</xexpand>
|
|
||||||
<yexpand>False</yexpand>
|
|
||||||
<xshrink>False</xshrink>
|
|
||||||
<yshrink>False</yshrink>
|
|
||||||
<xfill>True</xfill>
|
|
||||||
<yfill>False</yfill>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkLabel</class>
|
<class>GtkLabel</class>
|
||||||
<name>label30</name>
|
<name>label30</name>
|
||||||
@ -602,57 +536,6 @@
|
|||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
<widget>
|
|
||||||
<class>GtkLabel</class>
|
|
||||||
<name>label248</name>
|
|
||||||
<label>Cause</label>
|
|
||||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
|
||||||
<wrap>False</wrap>
|
|
||||||
<xalign>1</xalign>
|
|
||||||
<yalign>0.5</yalign>
|
|
||||||
<xpad>0</xpad>
|
|
||||||
<ypad>0</ypad>
|
|
||||||
<child>
|
|
||||||
<left_attach>0</left_attach>
|
|
||||||
<right_attach>1</right_attach>
|
|
||||||
<top_attach>2</top_attach>
|
|
||||||
<bottom_attach>3</bottom_attach>
|
|
||||||
<xpad>3</xpad>
|
|
||||||
<ypad>3</ypad>
|
|
||||||
<xexpand>False</xexpand>
|
|
||||||
<yexpand>False</yexpand>
|
|
||||||
<xshrink>False</xshrink>
|
|
||||||
<yshrink>False</yshrink>
|
|
||||||
<xfill>True</xfill>
|
|
||||||
<yfill>False</yfill>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
<widget>
|
|
||||||
<class>GtkEntry</class>
|
|
||||||
<name>deathCause</name>
|
|
||||||
<width>250</width>
|
|
||||||
<can_focus>True</can_focus>
|
|
||||||
<editable>False</editable>
|
|
||||||
<text_visible>True</text_visible>
|
|
||||||
<text_max_length>0</text_max_length>
|
|
||||||
<text></text>
|
|
||||||
<child>
|
|
||||||
<left_attach>2</left_attach>
|
|
||||||
<right_attach>3</right_attach>
|
|
||||||
<top_attach>2</top_attach>
|
|
||||||
<bottom_attach>3</bottom_attach>
|
|
||||||
<xpad>3</xpad>
|
|
||||||
<ypad>3</ypad>
|
|
||||||
<xexpand>True</xexpand>
|
|
||||||
<yexpand>False</yexpand>
|
|
||||||
<xshrink>False</xshrink>
|
|
||||||
<yshrink>False</yshrink>
|
|
||||||
<xfill>True</xfill>
|
|
||||||
<yfill>False</yfill>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkButton</class>
|
<class>GtkButton</class>
|
||||||
<name>button126</name>
|
<name>button126</name>
|
||||||
@ -669,8 +552,8 @@
|
|||||||
<child>
|
<child>
|
||||||
<left_attach>2</left_attach>
|
<left_attach>2</left_attach>
|
||||||
<right_attach>3</right_attach>
|
<right_attach>3</right_attach>
|
||||||
<top_attach>3</top_attach>
|
<top_attach>2</top_attach>
|
||||||
<bottom_attach>4</bottom_attach>
|
<bottom_attach>3</bottom_attach>
|
||||||
<xpad>0</xpad>
|
<xpad>0</xpad>
|
||||||
<ypad>0</ypad>
|
<ypad>0</ypad>
|
||||||
<xexpand>False</xexpand>
|
<xexpand>False</xexpand>
|
||||||
@ -681,6 +564,42 @@
|
|||||||
<yfill>False</yfill>
|
<yfill>False</yfill>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkCombo</class>
|
||||||
|
<name>dpcombo</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>2</left_attach>
|
||||||
|
<right_attach>3</right_attach>
|
||||||
|
<top_attach>1</top_attach>
|
||||||
|
<bottom_attach>2</bottom_attach>
|
||||||
|
<xpad>3</xpad>
|
||||||
|
<ypad>3</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>deathPlace</name>
|
||||||
|
<can_focus>True</can_focus>
|
||||||
|
<editable>True</editable>
|
||||||
|
<text_visible>True</text_visible>
|
||||||
|
<text_max_length>0</text_max_length>
|
||||||
|
<text></text>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
|
@ -117,9 +117,10 @@ class EditPerson:
|
|||||||
self.title = self.get_widget("title")
|
self.title = self.get_widget("title")
|
||||||
self.bdate = self.get_widget("birthDate")
|
self.bdate = self.get_widget("birthDate")
|
||||||
self.bplace = self.get_widget("birthPlace")
|
self.bplace = self.get_widget("birthPlace")
|
||||||
self.dcause = self.get_widget("deathCause")
|
self.bpcombo = self.get_widget("bpcombo")
|
||||||
self.ddate = self.get_widget("deathDate")
|
self.ddate = self.get_widget("deathDate")
|
||||||
self.dplace = self.get_widget("deathPlace")
|
self.dplace = self.get_widget("deathPlace")
|
||||||
|
self.dpcombo = self.get_widget("dpcombo")
|
||||||
self.is_male = self.get_widget("genderMale")
|
self.is_male = self.get_widget("genderMale")
|
||||||
self.is_female = self.get_widget("genderFemale")
|
self.is_female = self.get_widget("genderFemale")
|
||||||
self.is_unknown = self.get_widget("genderUnknown")
|
self.is_unknown = self.get_widget("genderUnknown")
|
||||||
@ -152,7 +153,6 @@ class EditPerson:
|
|||||||
self.window.editable_enters(self.bplace);
|
self.window.editable_enters(self.bplace);
|
||||||
self.window.editable_enters(self.ddate);
|
self.window.editable_enters(self.ddate);
|
||||||
self.window.editable_enters(self.dplace);
|
self.window.editable_enters(self.dplace);
|
||||||
self.window.editable_enters(self.dcause);
|
|
||||||
|
|
||||||
self.top.signal_autoconnect({
|
self.top.signal_autoconnect({
|
||||||
"destroy_passed_object" : self.on_cancel_edit,
|
"destroy_passed_object" : self.on_cancel_edit,
|
||||||
@ -203,6 +203,11 @@ class EditPerson:
|
|||||||
self.attr_list.set_column_visibility(2,Config.show_detail)
|
self.attr_list.set_column_visibility(2,Config.show_detail)
|
||||||
self.addr_list.set_column_visibility(2,Config.show_detail)
|
self.addr_list.set_column_visibility(2,Config.show_detail)
|
||||||
|
|
||||||
|
plist = self.db.getPlaceMap().values()
|
||||||
|
if len(plist) > 0:
|
||||||
|
utils.attach_places(plist,self.dpcombo,self.death.getPlace())
|
||||||
|
utils.attach_places(plist,self.bpcombo,self.birth.getPlace())
|
||||||
|
|
||||||
if Config.display_attr:
|
if Config.display_attr:
|
||||||
self.get_widget("user_label").set_text(Config.attr_name)
|
self.get_widget("user_label").set_text(Config.attr_name)
|
||||||
val = ""
|
val = ""
|
||||||
@ -284,6 +289,10 @@ class EditPerson:
|
|||||||
def redraw_event_list(self):
|
def redraw_event_list(self):
|
||||||
"""redraws the event list for the person"""
|
"""redraws the event list for the person"""
|
||||||
utils.redraw_list(self.elist,self.event_list,disp_event)
|
utils.redraw_list(self.elist,self.event_list,disp_event)
|
||||||
|
self.bplace.set_text(self.birth.getPlaceName())
|
||||||
|
self.dplace.set_text(self.death.getPlaceName())
|
||||||
|
self.bdate.set_text(self.birth.getDate())
|
||||||
|
self.ddate.set_text(self.death.getDate())
|
||||||
|
|
||||||
def on_add_addr_clicked(self,obj):
|
def on_add_addr_clicked(self,obj):
|
||||||
"""Invokes the address editor to add a new address"""
|
"""Invokes the address editor to add a new address"""
|
||||||
@ -315,12 +324,21 @@ class EditPerson:
|
|||||||
import EventEdit
|
import EventEdit
|
||||||
pname = self.person.getPrimaryName().getName()
|
pname = self.person.getPrimaryName().getName()
|
||||||
event = self.birth
|
event = self.birth
|
||||||
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,event,1)
|
event.setDate(self.bdate.get_text())
|
||||||
|
p = utils.get_place_from_list(self.bpcombo)
|
||||||
|
if p != None:
|
||||||
|
event.setPlace(p)
|
||||||
|
EventEdit.EventEditor(self,pname,const.personalEvents,\
|
||||||
|
const.save_fevent,event,1)
|
||||||
|
|
||||||
def on_edit_death_clicked(self,obj):
|
def on_edit_death_clicked(self,obj):
|
||||||
import EventEdit
|
import EventEdit
|
||||||
pname = self.person.getPrimaryName().getName()
|
pname = self.person.getPrimaryName().getName()
|
||||||
event = self.death
|
event = self.death
|
||||||
|
event.setDate(self.ddate.get_text())
|
||||||
|
p = utils.get_place_from_list(self.dpcombo)
|
||||||
|
if p != None:
|
||||||
|
event.setPlace(p)
|
||||||
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,event,1)
|
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,event,1)
|
||||||
|
|
||||||
def on_aka_delete_clicked(self,obj):
|
def on_aka_delete_clicked(self,obj):
|
||||||
@ -390,6 +408,19 @@ class EditPerson:
|
|||||||
if self.pname.getNote() != name.getNote():
|
if self.pname.getNote() != name.getNote():
|
||||||
changed = 1
|
changed = 1
|
||||||
|
|
||||||
|
bplace = string.strip(self.bplace.get_text())
|
||||||
|
dplace = string.strip(self.dplace.get_text())
|
||||||
|
|
||||||
|
p1 = utils.get_place_from_list(self.bpcombo)
|
||||||
|
if p1 == None and bplace != "":
|
||||||
|
changed = 1
|
||||||
|
self.birth.setPlace(p1)
|
||||||
|
|
||||||
|
p1 = utils.get_place_from_list(self.dpcombo)
|
||||||
|
if p1 == None and dplace != "":
|
||||||
|
changed = 1
|
||||||
|
self.death.setPlace(p1)
|
||||||
|
|
||||||
if not self.birth.are_equal(self.person.getBirth()):
|
if not self.birth.are_equal(self.person.getBirth()):
|
||||||
changed = 1
|
changed = 1
|
||||||
|
|
||||||
@ -418,12 +449,10 @@ class EditPerson:
|
|||||||
self.ddate.set_text(self.death.getDate())
|
self.ddate.set_text(self.death.getDate())
|
||||||
self.dplace.set_text(self.death.getPlaceName())
|
self.dplace.set_text(self.death.getPlaceName())
|
||||||
self.dplace.set_text(self.death.getPlaceName())
|
self.dplace.set_text(self.death.getPlaceName())
|
||||||
self.dcause.set_text(self.death.getCause())
|
|
||||||
self.bdate.set_position(0)
|
self.bdate.set_position(0)
|
||||||
self.ddate.set_position(0)
|
self.ddate.set_position(0)
|
||||||
self.bplace.set_position(0)
|
self.bplace.set_position(0)
|
||||||
self.dplace.set_position(0)
|
self.dplace.set_position(0)
|
||||||
self.dcause.set_position(0)
|
|
||||||
|
|
||||||
def on_update_attr_clicked(self,obj):
|
def on_update_attr_clicked(self,obj):
|
||||||
import AttrEdit
|
import AttrEdit
|
||||||
@ -579,11 +608,25 @@ class EditPerson:
|
|||||||
utils.modified()
|
utils.modified()
|
||||||
|
|
||||||
self.birth.setDate(self.bdate.get_text())
|
self.birth.setDate(self.bdate.get_text())
|
||||||
|
bplace_obj = utils.get_place_from_list(self.bpcombo)
|
||||||
|
bplace = string.strip(self.bplace.get_text())
|
||||||
|
if bplace_obj == None and bplace != "":
|
||||||
|
p1 = Place()
|
||||||
|
p1.set_title(bplace)
|
||||||
|
self.db.addPlace(p1)
|
||||||
|
self.birth.setPlace(bplace_obj)
|
||||||
|
|
||||||
if not self.person.getBirth().are_equal(self.birth):
|
if not self.person.getBirth().are_equal(self.birth):
|
||||||
self.person.setBirth(self.birth)
|
self.person.setBirth(self.birth)
|
||||||
|
|
||||||
self.death.setDate(self.ddate.get_text())
|
self.death.setDate(self.ddate.get_text())
|
||||||
|
dplace_obj = utils.get_place_from_list(self.dpcombo)
|
||||||
|
dplace = string.strip(self.dplace.get_text())
|
||||||
|
if dplace_obj == None and dplace != "":
|
||||||
|
p1 = Place()
|
||||||
|
p1.set_title(dplace)
|
||||||
|
self.db.addPlace(p1)
|
||||||
|
self.death.setPlace(dplace_obj)
|
||||||
|
|
||||||
if not self.person.getDeath().are_equal(self.death):
|
if not self.person.getDeath().are_equal(self.death):
|
||||||
self.person.setDeath(self.death)
|
self.person.setDeath(self.death)
|
||||||
|
Loading…
Reference in New Issue
Block a user