Place objects fully functional

svn: r350
This commit is contained in:
Don Allingham 2001-08-20 04:58:38 +00:00
parent f93d633f2c
commit 983376317a
7 changed files with 1033 additions and 113 deletions

View File

@ -1647,7 +1647,6 @@ def on_browse_clicked(obj):
if path != "":
gnome.url.show(path)
#-------------------------------------------------------------------------
#
# EventEditor class
@ -1773,7 +1772,6 @@ def on_event_edit_ok_clicked(obj):
ee.parent.redraw_event_list()
utils.destroy_passed_object(obj)
#-------------------------------------------------------------------------
#
# AttributeEditor class

View File

@ -83,8 +83,17 @@ class EditPlace:
self.web_list = self.top_window.get_widget("web_list")
self.web_url = self.top_window.get_widget("url_addr")
self.web_description = self.top_window.get_widget("url_des")
self.loc_list = self.top_window.get_widget("loc_list")
self.loc_city = self.top_window.get_widget("loc_city")
self.loc_county = self.top_window.get_widget("loc_county")
self.loc_state = self.top_window.get_widget("loc_state")
self.loc_country = self.top_window.get_widget("loc_country")
self.ulist = place.getUrlList()[:]
self.urls_changed = 0
self.llist = place.get_alternate_locations()[:]
self.locations_changed = 0
self.title.set_text(place.get_title())
mloc = place.get_main_location()
@ -112,7 +121,11 @@ class EditPlace:
"on_add_url_clicked" : on_add_url_clicked,
"on_delete_url_clicked" : on_delete_url_clicked,
"on_update_url_clicked" : on_update_url_clicked,
"on_add_loc_clicked" : on_add_loc_clicked,
"on_delete_loc_clicked" : on_delete_loc_clicked,
"on_update_loc_clicked" : on_update_loc_clicked,
"on_web_list_select_row" : on_web_list_select_row,
"on_loc_list_select_row" : on_loc_list_select_row,
"on_apply_clicked" : on_place_apply_clicked
})
@ -127,6 +140,10 @@ class EditPlace:
self.web_list.set_data(INDEX,-1)
self.redraw_url_list()
self.loc_list.set_data(PLACE,self)
self.loc_list.set_data(INDEX,-1)
self.redraw_location_list()
#-------------------------------------------------------------------------
#
#
@ -135,6 +152,14 @@ class EditPlace:
def update_urls(self):
self.place.setUrlList(self.ulist)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def update_locations(self):
self.place.set_alternate_locations(self.ulist)
#---------------------------------------------------------------------
#
# redraw_url_list - redraws the altername name list for the person
@ -162,6 +187,34 @@ class EditPlace:
self.web_list.set_data(INDEX,current_row)
self.web_list.thaw()
#---------------------------------------------------------------------
#
# redraw_location_list
#
#---------------------------------------------------------------------
def redraw_location_list(self):
self.loc_list.freeze()
self.loc_list.clear()
self.loc_index = 0
for loc in self.llist:
self.loc_list.append([loc.get_city(),loc.get_county(),
loc.get_state(),loc.get_country()])
self.loc_list.set_row_data(self.loc_index,loc)
self.loc_index = self.loc_index + 1
current_row = self.loc_list.get_data(INDEX)
if self.loc_index > 0:
if current_row <= 0:
current_row = 0
elif self.loc_index <= current_row:
current_row = current_row - 1
self.loc_list.select_row(current_row,0)
self.loc_list.moveto(current_row,0)
self.loc_list.set_data(INDEX,current_row)
self.loc_list.thaw()
#-------------------------------------------------------------------------
#
# add_thumbnail - Scale the image and add it to the IconList.
@ -246,6 +299,10 @@ def on_place_apply_clicked(obj):
if edit.urls_changed:
utils.modified()
edit.update_locations()
if edit.locations_changed:
utils.modified()
utils.destroy_passed_object(edit.top)
edit.callback(edit.place)
@ -256,7 +313,7 @@ def on_place_apply_clicked(obj):
#-------------------------------------------------------------------------
def on_switch_page(obj,a,page):
src = obj.get_data(PLACE)
if page == 2 and src.not_loaded:
if page == 3 and src.not_loaded:
src.not_loaded = 0
src.load_images()
@ -504,6 +561,18 @@ def on_update_url_clicked(obj):
UrlEditor(obj.get_data(PLACE),obj.get_row_data(row))
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_update_loc_clicked(obj):
row = obj.get_data(INDEX)
if row < 0:
return
LocationEditor(obj.get_data(PLACE),obj.get_row_data(row))
#-------------------------------------------------------------------------
#
#
@ -523,6 +592,25 @@ def on_delete_url_clicked(obj):
epo.redraw_url_list()
utils.modified()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_delete_loc_clicked(obj):
row = obj.get_data(INDEX)
if row < 0:
return
epo = obj.get_data(PLACE)
del epo.llist[row]
if row > len(epo.llist)-1:
obj.set_data(INDEX,row-1)
epo.redraw_location_list()
utils.modified()
#-------------------------------------------------------------------------
#
#
@ -532,6 +620,15 @@ def on_add_url_clicked(obj):
epo = obj.get_data(PLACE)
UrlEditor(obj.get_data(PLACE),None)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_add_loc_clicked(obj):
epo = obj.get_data(PLACE)
LocationEditor(obj.get_data(PLACE),None)
#-------------------------------------------------------------------------
#
# UrlEditor class
@ -589,6 +686,183 @@ def on_url_edit_ok_clicked(obj):
ee.parent.redraw_url_list()
utils.destroy_passed_object(obj)
#-------------------------------------------------------------------------
#
# on_name_list_select_row - sets the row object attached to the passed
# object, and then updates the display with the data corresponding to
# the row.
#
#-------------------------------------------------------------------------
def on_web_list_select_row(obj,row,b,c):
obj.set_data(INDEX,row)
epo = obj.get_data(PLACE)
url = obj.get_row_data(row)
epo.web_url.set_text(": %s " % url.get_path())
epo.web_description.set_text(": %s" % url.get_description())
#-------------------------------------------------------------------------
#
# on_name_list_select_row - sets the row object attached to the passed
# object, and then updates the display with the data corresponding to
# the row.
#
#-------------------------------------------------------------------------
def on_loc_list_select_row(obj,row,b,c):
obj.set_data(INDEX,row)
epo = obj.get_data(PLACE)
loc = obj.get_row_data(row)
epo.loc_city.set_text(": %s " % loc.get_city())
epo.loc_county.set_text(": %s " % loc.get_county())
epo.loc_state.set_text(": %s " % loc.get_state())
epo.loc_country.set_text(": %s " % loc.get_country())
#-------------------------------------------------------------------------
#
# update_attrib
#
# Updates the specified event with the specified date. Compares against
# the previous value, so the that modified flag is not set if nothing has
# actually changed.
#
#-------------------------------------------------------------------------
def update_url(url,des,addr,priv):
changed = 0
if url.get_path() != addr:
url.set_path(addr)
changed = 1
if url.get_description() != des:
url.set_description(des)
changed = 1
if url.getPrivacy() != priv:
url.setPrivacy(priv)
changed = 1
return changed
#-------------------------------------------------------------------------
#
# update_attrib
#
# Updates the specified event with the specified date. Compares against
# the previous value, so the that modified flag is not set if nothing has
# actually changed.
#
#-------------------------------------------------------------------------
def update_location(loc,city,county,state,country):
changed = 0
if loc.get_city() != city:
loc.set_city(city)
changed = 1
if loc.get_county() != county:
loc.set_county(county)
changed = 1
if loc.get_state() != state:
loc.set_state(state)
changed = 1
if loc.get_country() != country:
loc.set_country(country)
changed = 1
return changed
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_browse_clicked(obj):
import gnome.url
path = obj.get()[2:]
if path != "":
gnome.url.show(path)
#-------------------------------------------------------------------------
#
# LocationEditor class
#
#-------------------------------------------------------------------------
class LocationEditor:
def __init__(self,parent,location):
self.parent = parent
self.location = location
self.top = libglade.GladeXML(const.dialogFile, "loc_edit")
self.window = self.top.get_widget("loc_edit")
self.city = self.top.get_widget("city")
self.state = self.top.get_widget("state")
self.county = self.top.get_widget("county")
self.country = self.top.get_widget("country")
if parent.place:
name = _("Location Editor for %s") % parent.place.get_title()
else:
name = _("Location Editor")
self.top.get_widget("locationTitle").set_text(name)
if location != None:
self.city.set_text(location.get_city())
self.county.set_text(location.get_county())
self.country.set_text(location.get_country())
self.state.set_text(location.get_state())
self.window.set_data("o",self)
self.top.signal_autoconnect({
"destroy_passed_object" : utils.destroy_passed_object,
"on_loc_edit_ok_clicked" : on_location_edit_ok_clicked
})
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_location_edit_ok_clicked(obj):
ee = obj.get_data("o")
loc = ee.location
city = ee.city.get_text()
county = ee.county.get_text()
country = ee.country.get_text()
state = ee.state.get_text()
if loc == None:
loc = Location()
ee.parent.llist.append(loc)
if update_location(loc,city,county,state,country):
ee.parent.locations_changed = 1
ee.parent.redraw_location_list()
utils.destroy_passed_object(obj)
#-------------------------------------------------------------------------
#
# on_name_list_select_row - sets the row object attached to the passed
# object, and then updates the display with the data corresponding to
# the row.
#
#-------------------------------------------------------------------------
def on_location_list_select_row(obj,row,b,c):
obj.set_data(INDEX,row)
epo = obj.get_data(PLACE)
loc = obj.get_row_data(row)
# epo.web_url.set_text(": %s " % url.get_path())
# epo.web_description.set_text(": %s" % url.get_description())
#-------------------------------------------------------------------------
#
@ -628,56 +902,4 @@ def get_detail_text(obj):
details = "%s, %s" % (details,_("Private"))
return details
#-------------------------------------------------------------------------
#
# on_name_list_select_row - sets the row object attached to the passed
# object, and then updates the display with the data corresponding to
# the row.
#
#-------------------------------------------------------------------------
def on_web_list_select_row(obj,row,b,c):
obj.set_data(INDEX,row)
epo = obj.get_data(PLACE)
url = obj.get_row_data(row)
epo.web_url.set_text(": %s " % url.get_path())
epo.web_description.set_text(": %s" % url.get_description())
#-------------------------------------------------------------------------
#
# update_attrib
#
# Updates the specified event with the specified date. Compares against
# the previous value, so the that modified flag is not set if nothing has
# actually changed.
#
#-------------------------------------------------------------------------
def update_url(url,des,addr,priv):
changed = 0
if url.get_path() != addr:
url.set_path(addr)
changed = 1
if url.get_description() != des:
url.set_description(des)
changed = 1
if url.getPrivacy() != priv:
url.setPrivacy(priv)
changed = 1
return changed
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_browse_clicked(obj):
import gnome.url
path = obj.get()[2:]
if path != "":
gnome.url.show(path)

View File

@ -108,6 +108,9 @@ class Place:
def get_alternate_locations(self):
return self.alt_loc
def set_alternate_locations(self,list):
self.alt_loc = list
def add_alternate_locations(self,loc):
if loc not in self.alt_loc:
self.alt_loc.append(loc)

View File

@ -1068,4 +1068,340 @@ Very High
</widget>
</widget>
<widget>
<class>GtkDialog</class>
<name>loc_edit</name>
<title>Gramps - Event Editor</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_CENTER</position>
<modal>False</modal>
<allow_shrink>True</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkVBox</class>
<child_name>Dialog:vbox</child_name>
<name>vbox32</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkHBox</class>
<child_name>Dialog:action_area</child_name>
<name>hbox26</name>
<border_width>10</border_width>
<homogeneous>True</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkHButtonBox</class>
<name>hbuttonbox20</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkButton</class>
<name>button118</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_loc_edit_ok_clicked</handler>
<object>loc_edit</object>
<last_modification_time>Mon, 20 Aug 2001 01:50:00 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button119</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>destroy_passed_object</handler>
<object>loc_edit</object>
<last_modification_time>Thu, 26 Jul 2001 19:16:49 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox33</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>locationTitle</name>
<width>450</width>
<label>Location Editor</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>10</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHSeparator</class>
<name>hseparator3</name>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkTable</class>
<name>table23</name>
<rows>4</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label180</name>
<label>City</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</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>
<class>GtkLabel</class>
<name>label181</name>
<label>County</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</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>
<class>GtkLabel</class>
<name>label182</name>
<label>Country</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</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>
<class>GtkLabel</class>
<name>label183</name>
<label>State</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</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>
<class>GtkEntry</class>
<name>county</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>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>
<class>GtkEntry</class>
<name>city</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>0</top_attach>
<bottom_attach>1</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>
<class>GtkEntry</class>
<name>state</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>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>
<class>GtkEntry</class>
<name>country</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>3</top_attach>
<bottom_attach>4</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>
</widget>
</widget>
</GTK-Interface>

View File

@ -2994,7 +2994,7 @@
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label230</name>
<label>label230</label>
<label>Places</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>

View File

@ -105,8 +105,6 @@ source_list = None
place_list = None
database = None
family_window = None
queryTop = None
prefsTop = None
pv = {}
sort_column = 5
sort_direct = SORT_ASCENDING
@ -807,9 +805,9 @@ def update_display(changed):
goto_active_person()
elif page == 1:
load_family()
elif page == 3:
elif page == 2:
load_sources()
elif page == 4:
elif page == 3:
load_tree()
else:
load_places()
@ -823,8 +821,6 @@ def load_sources():
source_list.clear()
source_list.freeze()
color_clist = ListColors.ColorList(source_list,1)
current_row = source_list.get_data("i")
if current_row == None:
current_row = -1
@ -1294,9 +1290,8 @@ def on_select_spouse_clicked(obj):
#
#
#-------------------------------------------------------------------------
def on_edit_active_person(obj):
if active_person:
load_person(active_person)
def load_active_person(obj):
load_person(active_person)
#-------------------------------------------------------------------------
#
@ -1304,8 +1299,7 @@ def on_edit_active_person(obj):
#
#-------------------------------------------------------------------------
def on_edit_spouse_clicked(obj):
if active_spouse:
load_person(active_spouse)
load_person(active_spouse)
#-------------------------------------------------------------------------
#
@ -1313,8 +1307,7 @@ def on_edit_spouse_clicked(obj):
#
#-------------------------------------------------------------------------
def on_edit_mother_clicked(obj):
if active_mother:
load_person(active_mother)
load_person(active_mother)
#-------------------------------------------------------------------------
#
@ -1322,16 +1315,15 @@ def on_edit_mother_clicked(obj):
#
#-------------------------------------------------------------------------
def on_edit_father_clicked(obj):
if active_father:
load_person(active_father)
load_person(active_father)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_addperson_clicked(obj):
load_person(None)
def load_new_person(obj):
EditPerson.EditPerson(Person(),database,new_after_edit)
#-------------------------------------------------------------------------
#
@ -1339,11 +1331,9 @@ def on_addperson_clicked(obj):
#
#-------------------------------------------------------------------------
def on_delete_person_clicked(obj):
if not active_person:
return
topWindow.question(_("Do you really wish to delete %s?") % \
Config.nameof(active_person), delete_person_response)
if active_person:
msg = _("Do you really wish to delete %s?") % Config.nameof(active_person)
topWindow.question( msg, delete_person_response)
#-------------------------------------------------------------------------
#
@ -1399,14 +1389,6 @@ def remove_from_person_list(person):
del alt2col[person]
person_list.thaw()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_editperson_clicked(obj):
load_person(active_person)
#-------------------------------------------------------------------------
#
#
@ -1607,8 +1589,7 @@ def on_motherList_select_row(obj,a,b,c):
#-------------------------------------------------------------------------
def on_child_list_button_press_event(obj,event):
if event.button == 1 and event.type == GDK._2BUTTON_PRESS:
if active_child:
load_person(active_child)
load_person(active_child)
#-------------------------------------------------------------------------
#
@ -1670,14 +1651,6 @@ def on_spouseList_select_row(obj,a,b,c):
global select_spouse
select_spouse = obj.get_row_data(a)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_new_person_activate(obj):
load_person(None)
#-------------------------------------------------------------------------
#
#
@ -1804,8 +1777,6 @@ def load_places():
place_list.freeze()
place_list.clear()
color_clist = ListColors.ColorList(place_list,1)
current_row = place_list.get_data("i")
if current_row == None:
current_row = -1
@ -1839,10 +1810,7 @@ def load_places():
#-------------------------------------------------------------------------
def on_pv_button_press_event(obj,event):
if event.button == 1 and event.type == GDK._2BUTTON_PRESS:
person = obj.get_data("p")
if person == None:
return
load_person(person)
load_person(obj.get_data("p"))
#-------------------------------------------------------------------------
#
@ -1956,10 +1924,9 @@ def on_swap_clicked(obj):
else:
spouse = gtop.get_widget("fv_spouse1").get_data("person")
if not spouse:
return
change_active_person(spouse)
load_family()
if spouse:
change_active_person(spouse)
load_family()
#-------------------------------------------------------------------------
#
@ -2061,9 +2028,7 @@ def redisplay_person_list(person):
#
#-------------------------------------------------------------------------
def load_person(person):
if person == None:
EditPerson.EditPerson(Person(),database,new_after_edit)
else:
if person:
EditPerson.EditPerson(person,database,update_after_edit)
#-------------------------------------------------------------------------
@ -2847,12 +2812,12 @@ def main(arg):
"on_new_clicked" : on_new_clicked,
"on_add_bookmark_activate" : on_add_bookmark_activate,
"on_arrow_left_clicked" : on_arrow_left_clicked,
"on_addperson_clicked" : on_addperson_clicked,
"on_addperson_clicked" : load_new_person,
"on_delete_person_clicked" : on_delete_person_clicked,
"on_preferences_activate" : on_preferences_activate,
"on_pv_button_press_event" : on_pv_button_press_event,
"on_edit_bookmarks_activate" : on_edit_bookmarks_activate,
"on_edit_active_person" : on_edit_active_person,
"on_edit_active_person" : load_active_person,
"on_edit_spouse_clicked" : on_edit_spouse_clicked,
"on_edit_father_clicked" : on_edit_father_clicked,
"on_edit_mother_clicked" : on_edit_mother_clicked,
@ -2864,7 +2829,7 @@ def main(arg):
"on_place_list_button_press_event" : on_place_list_button_press_event,
"on_place_list_select_row": on_place_list_select_row,
"on_delete_source_clicked" : on_delete_source_clicked,
# "on_delete_place_clicked" : on_delete_place_clicked,
"on_delete_place_clicked" : on_delete_place_clicked,
"on_edit_source_clicked" : on_edit_source_clicked,
"on_edit_place_clicked" : on_edit_place_clicked,
"delete_event" : delete_event,

View File

@ -607,6 +607,402 @@
<ypad>0</ypad>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox39</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkFrame</class>
<name>frame3</name>
<border_width>5</border_width>
<label>Other Names</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkTable</class>
<name>table21</name>
<rows>4</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkLabel</class>
<name>label264</name>
<label>County</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</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>
<class>GtkLabel</class>
<name>label265</name>
<label>City</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</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>
<class>GtkLabel</class>
<name>loc_county</name>
<label>:</label>
<justify>GTK_JUSTIFY_LEFT</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>1</top_attach>
<bottom_attach>2</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>GtkLabel</class>
<name>label270</name>
<label>State</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</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>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>
<class>GtkLabel</class>
<name>label271</name>
<label>Country</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</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>
<class>GtkLabel</class>
<name>loc_state</name>
<label>:</label>
<justify>GTK_JUSTIFY_LEFT</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>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>GtkLabel</class>
<name>loc_country</name>
<label>:</label>
<justify>GTK_JUSTIFY_LEFT</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>3</top_attach>
<bottom_attach>4</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>GtkLabel</class>
<name>loc_city</name>
<label>:</label>
<justify>GTK_JUSTIFY_LEFT</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>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</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>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow30</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCList</class>
<name>loc_list</name>
<width>500</width>
<can_focus>True</can_focus>
<signal>
<name>select_row</name>
<handler>on_loc_list_select_row</handler>
<last_modification_time>Tue, 24 Apr 2001 14:12:50 GMT</last_modification_time>
</signal>
<columns>4</columns>
<column_widths>137,80,80,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label268</name>
<label>City</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label269</name>
<label>County</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label269a</name>
<label>State</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label269b</name>
<label>Country</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkHButtonBox</class>
<name>hbuttonbox26</name>
<layout_style>GTK_BUTTONBOX_SPREAD</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkButton</class>
<name>button129</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_add_loc_clicked</handler>
<object>loc_list</object>
<last_modification_time>Mon, 20 Aug 2001 00:11:28 GMT</last_modification_time>
</signal>
<label>Add</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button130</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_update_loc_clicked</handler>
<object>loc_list</object>
<last_modification_time>Mon, 20 Aug 2001 00:11:13 GMT</last_modification_time>
</signal>
<label>Edit/View</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button131</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_delete_loc_clicked</handler>
<object>loc_list</object>
<last_modification_time>Mon, 20 Aug 2001 00:10:56 GMT</last_modification_time>
</signal>
<label>Delete</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label263</name>
<label>Other Names</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow27</name>
@ -1012,7 +1408,7 @@
<object>web_list</object>
<last_modification_time>Tue, 24 Apr 2001 13:49:14 GMT</last_modification_time>
</signal>
<label>Edit</label>
<label>Edit/View</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>