diff --git a/gramps/src/EditPerson.glade b/gramps/src/EditPerson.glade index afc9c2f7f..35dd145e0 100644 --- a/gramps/src/EditPerson.glade +++ b/gramps/src/EditPerson.glade @@ -2946,7 +2946,7 @@ GtkLabel url_des - GTK_JUSTIFY_CENTER + GTK_JUSTIFY_LEFT False 0 0.5 @@ -2992,9 +2992,9 @@ GtkLabel url_addr - GTK_JUSTIFY_CENTER + GTK_JUSTIFY_LEFT False - 0.5 + 0 0.5 0 0 @@ -3012,7 +3012,7 @@ clicked on_browse_clicked - web_url + url_addr Tue, 24 Apr 2001 14:16:09 GMT @@ -3241,1062 +3241,6 @@ - - GtkDialog - event_edit - Gramps - Event Editor - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - True - False - - - GtkVBox - Dialog:vbox - dialog-vbox1 - False - 0 - - - GtkHBox - Dialog:action_area - dialog-action_area1 - 10 - True - 5 - - 0 - False - True - GTK_PACK_END - - - - GtkHButtonBox - hbuttonbox18 - GTK_BUTTONBOX_END - 30 - 85 - 27 - 7 - 0 - - 0 - True - True - - - - GtkButton - button111 - True - True - - clicked - on_event_edit_ok_clicked - event_edit - Thu, 26 Jul 2001 20:29:11 GMT - - GNOME_STOCK_BUTTON_OK - GTK_RELIEF_NORMAL - - - - GtkButton - button113 - True - True - - clicked - destroy_passed_object - event_edit - Thu, 26 Jul 2001 19:16:49 GMT - - GNOME_STOCK_BUTTON_CANCEL - GTK_RELIEF_NORMAL - - - - - - GtkVBox - vbox29 - False - 0 - - 0 - True - True - - - - GtkLabel - eventTitle - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 10 - - 0 - False - False - - - - - GtkHSeparator - hseparator1 - - 0 - False - True - - - - - GtkTable - table21 - 7 - 2 - False - 0 - 0 - - 0 - True - True - - - - GtkLabel - label154 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label155 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label156 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 3 - 4 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label157 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GnomeEntry - eDescBox - event_description - 15 - - 1 - 2 - 3 - 4 - 3 - 3 - True - False - False - False - True - False - - - - GtkEntry - GnomeEntry:entry - eventDescription - True - True - True - 0 - - - - - - GtkCombo - eventPlace_combo - False - True - False - True - False - - - 1 - 2 - 2 - 3 - 3 - 3 - True - False - False - False - True - False - - - - GtkEntry - GtkCombo:entry - eventPlace - True - True - True - 0 - - - - - - GtkLabel - label158 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 4 - 5 - 0 - 0 - False - False - False - False - True - False - - - - - GtkCombo - personalEvents - False - True - False - True - False - - - 1 - 2 - 0 - 1 - 3 - 3 - True - False - False - False - True - False - - - - GtkEntry - GtkCombo:entry - eventName - True - True - True - 0 - - - - - - GtkEntry - eventDate - True - True - True - 0 - - - 1 - 2 - 1 - 2 - 3 - 3 - True - False - False - False - True - False - - - - - GtkScrolledWindow - scrolledwindow21 - 400 - 150 - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 1 - 2 - 6 - 7 - 3 - 3 - False - True - False - False - True - True - - - - GtkText - eventNote - True - True - - - - - - GtkLabel - label159 - - GTK_JUSTIFY_CENTER - False - 1 - 0 - 5 - 8 - - 0 - 1 - 6 - 7 - 0 - 0 - False - False - False - False - True - True - - - - - GtkHBox - hbox21 - False - 0 - - 1 - 2 - 4 - 5 - 0 - 0 - False - False - False - False - True - True - - - - GtkEntry - event_source - True - False - True - 0 - - - 3 - True - True - - - - - GtkButton - button114 - 3 - Edit source information for the highlighted event - True - - clicked - on_source_clicked - event_edit - Fri, 27 Jul 2001 01:05:33 GMT - - - GTK_RELIEF_NORMAL - - 3 - False - False - - - - - - GtkLabel - label178 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 5 - 6 - 0 - 0 - False - False - False - False - True - False - - - - - GtkHBox - hbox24 - False - 0 - - 1 - 2 - 5 - 6 - 0 - 0 - False - False - False - False - True - True - - - - GtkOptionMenu - conf - True - Very Low -Low -Normal -High -Very High - - 0 - - 3 - True - True - - - - - GtkCheckButton - priv - True - - False - True - - 5 - False - False - - - - - - - - - - GtkDialog - attr_edit - Gramps - Attribute Editor - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - True - False - - - GtkVBox - Dialog:vbox - vbox30 - False - 0 - - - GtkHBox - Dialog:action_area - hbox22 - 10 - True - 5 - - 0 - False - True - GTK_PACK_END - - - - GtkHButtonBox - hbuttonbox19 - GTK_BUTTONBOX_END - 30 - 85 - 27 - 7 - 0 - - 0 - True - True - - - - GtkButton - button115 - True - True - - clicked - on_attr_edit_ok_clicked - attr_edit - Sat, 28 Jul 2001 16:26:27 GMT - - GNOME_STOCK_BUTTON_OK - GTK_RELIEF_NORMAL - - - - GtkButton - button116 - True - True - - clicked - destroy_passed_object - attr_edit - Thu, 26 Jul 2001 19:16:49 GMT - - GNOME_STOCK_BUTTON_CANCEL - GTK_RELIEF_NORMAL - - - - - - GtkVBox - vbox31 - False - 0 - - 0 - True - True - - - - GtkLabel - attrTitle - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 10 - - 0 - False - False - - - - - GtkHSeparator - hseparator2 - - 0 - False - True - - - - - GtkTable - table22 - 5 - 2 - False - 0 - 0 - - 0 - True - True - - - - GtkLabel - label171 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label172 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label175 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GtkCombo - attr_menu - False - True - False - True - False - - - 1 - 2 - 0 - 1 - 3 - 3 - True - False - False - False - True - False - - - - GtkEntry - GtkCombo:entry - attr_type - True - True - True - 0 - - - - - - GtkEntry - attr_value - True - True - True - 0 - - - 1 - 2 - 1 - 2 - 3 - 3 - True - False - False - False - True - False - - - - - GtkScrolledWindow - scrolledwindow22 - 400 - 150 - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 1 - 2 - 4 - 5 - 3 - 3 - False - True - False - False - True - True - - - - GtkText - attr_note - True - True - - - - - - GtkLabel - label176 - - GTK_JUSTIFY_CENTER - False - 1 - 0 - 5 - 8 - - 0 - 1 - 4 - 5 - 0 - 0 - False - False - False - False - True - True - - - - - GtkHBox - hbox23 - False - 0 - - 1 - 2 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - - - - GtkEntry - attr_source - True - False - True - 0 - - - 3 - True - True - - - - - GtkButton - button117 - 3 - Edit source information for the highlighted event - True - - clicked - on_source_clicked - attr_edit - Fri, 27 Jul 2001 01:05:33 GMT - - - GTK_RELIEF_NORMAL - - 3 - False - False - - - - - - GtkLabel - label177 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 3 - 4 - 0 - 0 - False - False - False - False - True - False - - - - - GtkHBox - hbox25 - False - 0 - - 1 - 2 - 3 - 4 - 0 - 0 - False - False - False - False - True - True - - - - GtkOptionMenu - conf - True - Very Low -Low -Normal -High -Very High - - 0 - - 3 - True - True - - - - - GtkCheckButton - priv - True - - False - True - - 5 - False - False - - - - - - - - GtkDialog name_edit diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index d59fbb24c..62c100e4d 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -519,7 +519,6 @@ def on_name_list_select_row(obj,row,b,c): epo.alt_given_field.set_text(name.getFirstName()) epo.alt_last_field.set_text(name.getSurname()) epo.alt_suffix_field.set_text(name.getSuffix()) - epo.name_details_field.set_text(get_detail_text(name)) #------------------------------------------------------------------------- @@ -766,7 +765,6 @@ def on_event_add_clicked(obj): def on_event_delete_clicked(obj): epo = obj.get_data(EDITPERSON) row = obj.get_data(INDEX) - if row < 0: return @@ -1523,8 +1521,8 @@ def on_ok_clicked(obj): #------------------------------------------------------------------------- def on_browse_clicked(obj): import gnome.url - - path = obj.get_text() + + path = obj.get() if path != "": gnome.url.show(path) @@ -1539,7 +1537,7 @@ class EventEditor: def __init__(self,parent,event): self.parent = parent self.event = event - self.top = libglade.GladeXML(const.editPersonFile, "event_edit") + self.top = libglade.GladeXML(const.dialogFile, "event_edit") self.window = self.top.get_widget("event_edit") self.name_field = self.top.get_widget("eventName") self.place_field = self.top.get_widget("eventPlace") @@ -1642,7 +1640,7 @@ class AttributeEditor: def __init__(self,parent,attrib): self.parent = parent self.attrib = attrib - self.top = libglade.GladeXML(const.editPersonFile, "attr_edit") + self.top = libglade.GladeXML(const.dialogFile, "attr_edit") self.window = self.top.get_widget("attr_edit") self.type_field = self.top.get_widget("attr_type") self.value_field = self.top.get_widget("attr_value") diff --git a/gramps/src/GrampsParser.py b/gramps/src/GrampsParser.py index 75090f337..b7433f1af 100644 --- a/gramps/src/GrampsParser.py +++ b/gramps/src/GrampsParser.py @@ -434,10 +434,6 @@ class GrampsParser(handler.ContentHandler): self.person.setBirth(self.event) elif self.event_type == "Death": self.person.setDeath(self.event) - elif self.event_type == "Marriage": - self.family.setMarriage(self.event) - elif self.event_type == "Divorce": - self.family.setDivorce(self.event) elif self.person: self.person.EventList.append(self.event) else: @@ -798,7 +794,6 @@ class GrampsParser(handler.ContentHandler): "bookmarks" : (None, None), "child" : (start_child,None), "childof" : (start_childof,None), - "childlist" : (None,None), "city" : (None, stop_city), "country" : (None, stop_country), "created" : (start_created, None), diff --git a/gramps/src/Marriage.py b/gramps/src/Marriage.py index 410138592..4982102ec 100644 --- a/gramps/src/Marriage.py +++ b/gramps/src/Marriage.py @@ -30,6 +30,7 @@ import gnome.mime import libglade import os import intl +import Sources _ = intl.gettext @@ -87,7 +88,6 @@ class Marriage: "on_photolist_button_press_event" : on_photolist_button_press_event, "on_addphoto_clicked" : on_add_photo_clicked, "on_deletephoto_clicked" : on_delete_photo_clicked, - "on_event_note_clicked" : on_event_note_clicked, "on_close_marriage_editor" : on_close_marriage_editor, "destroy_passed_object" : utils.destroy_passed_object }) @@ -110,14 +110,19 @@ class Marriage: self.attr_list = self.get_widget("attr_list") self.attr_type = self.get_widget("attr_type") self.attr_value = self.get_widget("attr_value") + self.event_details = self.get_widget("event_details") + self.attr_details_field = self.get_widget("attr_details") self.event_list.set_column_visibility(3,Config.show_detail) self.attr_list.set_column_visibility(2,Config.show_detail) + self.elist = family.getEventList()[:] + self.alist = family.getAttributeList()[:] + self.events_changed = 0 + self.attr_changed = 0 + # set initial data mevent_list = self.get_widget("marriageEvent") - mevent_list.set_popdown_strings(const.marriageEvents) - self.name_field.set_text("") self.load_images() self.type_field.set_popdown_strings(const.familyRelations) @@ -130,10 +135,6 @@ class Marriage: self.attr_list.set_data(MARRIAGE,self) self.attr_list.set_data(INDEX,-1) - attr_names = self.get_widget("attr_combo") - attr_names.set_popdown_strings(const.personalAttributes) - attr_names.entry.set_text("") - # set notes data self.notes_field.set_point(0) self.notes_field.insert_defaults(family.getNote()) @@ -143,6 +144,22 @@ class Marriage: self.redraw_attr_list() top_window.show() + #------------------------------------------------------------------------- + # + # + # + #------------------------------------------------------------------------- + def update_events(self): + self.family.setEventList(self.elist) + + #------------------------------------------------------------------------- + # + # + # + #------------------------------------------------------------------------- + def update_attributes(self): + self.family.setAttributeList(self.alist) + #--------------------------------------------------------------------- # # redraw_attr_list - redraws the attribute list for the person @@ -153,13 +170,8 @@ class Marriage: self.attr_list.clear() self.attr_index = 0 - details = "" - for attr in self.family.getAttributeList(): - if Config.show_detail: - if attr.getNote() != "": - detail = "N" - if attr.getSourceRef(): - detail = detail + "S" + for attr in self.alist: + details = get_detail_flags(attr) self.attr_list.append([const.display_fattr(attr.getType()),\ attr.getValue(),details]) self.attr_list.set_row_data(self.attr_index,attr) @@ -186,12 +198,7 @@ class Marriage: def add_event(self,text,event): if not event: return - detail = "" - if Config.show_detail: - if event.getNote() != "": - detail = "N" - if event.getSourceRef(): - detail = detail + "S" + detail = get_detail_flags(event) self.event_list.append([text,event.getQuoteDate(),event.getPlace(),detail]) self.event_list.set_row_data(self.lines,event) self.lines = self.lines + 1 @@ -242,9 +249,7 @@ class Marriage: self.event_list.freeze() self.event_list.clear() - self.add_event(const.display_fevent("Marriage"),self.family.getMarriage()) - self.add_event(const.display_fevent("Divorce"),self.family.getDivorce()) - for event in self.family.getEventList(): + for event in self.elist: self.add_event(const.display_fevent(event.getName()),event) current_row = self.event_list.get_data(INDEX) @@ -297,6 +302,14 @@ def on_close_marriage_editor(obj): utils.destroy_passed_object(family_obj.get_widget("marriageEditor")) + family_obj.update_events() + if family_obj.events_changed: + utils.modified() + + family_obj.update_events() + if family_obj.events_changed: + utils.modified() + #------------------------------------------------------------------------- # # on_add_clicked - creates a new event from the data displayed in the @@ -305,34 +318,7 @@ def on_close_marriage_editor(obj): # #------------------------------------------------------------------------- def on_add_clicked(obj): - - family_obj = obj.get_data(MARRIAGE) - - date = family_obj.date_field.get_text() - place= family_obj.place_field.get_text() - name = family_obj.name_field.get_text() - desc = family_obj.descr_field.get_text() - - if name == "Marriage": - if family_obj.family.getMarriage() == None: - event = Event() - family_obj.family.setMarriage(event) - else: - event = family_obj.family.getMarriage() - elif name == "Divorce": - if family_obj.family.getDivorce() == None: - event = Event() - family_obj.family.setDivorce(event) - else: - event = family_obj.family.getDivorce() - else: - event = Event() - family_obj.family.addEvent(event) - - event.set(name,date,place,desc) - - family_obj.redraw_events() - utils.modified() + editor = EventEditor(obj.get_data(MARRIAGE),None) #------------------------------------------------------------------------- # @@ -347,14 +333,7 @@ def on_update_clicked(obj): family_obj = obj.get_data(MARRIAGE) event = obj.get_row_data(row) - - date = family_obj.date_field.get_text() - place= family_obj.place_field.get_text() - name = family_obj.name_field.get_text() - desc = family_obj.descr_field.get_text() - - update_event(event,name,date,place,desc) - family_obj.redraw_events() + editor = EventEditor(family_obj,event) #------------------------------------------------------------------------- # @@ -369,27 +348,13 @@ def on_delete_clicked(obj): if row < 0: return - active_event = obj.get_row_data(row) + del family_obj.elist[row] - if active_event == family_obj.family.getMarriage(): - family_obj.family.setMarriage(None) - elif active_event == family_obj.family.getDivorce(): - family_obj.family.setDivorce(None) - else: - count = 0 - list = family_obj.family.getEventList() - for event in list: - if event == active_event: - del list[count] - break - count = count + 1 - - if family_obj.lines == 1: - obj.set_data(INDEX,None) - elif row > family_obj.lines-1: + if row > len(family_obj.elist)-1: obj.set_data(INDEX,row-1) family_obj.redraw_events() + family_obj.events_changed = 1 utils.modified() #------------------------------------------------------------------------- @@ -405,9 +370,44 @@ def on_select_row(obj,row,b,c): family_obj.date_field.set_text(event.getDate()) family_obj.place_field.set_text(event.getPlace()) - family_obj.name_field.set_text(const.display_fevent(event.getName())) + family_obj.name_field.set_label(const.display_fevent(event.getName())) + family_obj.event_details.set_text(get_detail_text(event)) family_obj.descr_field.set_text(event.getDescription()) +#------------------------------------------------------------------------- +# +# 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_attrib(attr,type,value,note,priv,conf): + changed = 0 + + if attr.getType() != const.save_pattr(type): + attr.setType(const.save_pattr(type)) + changed = 1 + + if attr.getValue() != value: + attr.setValue(value) + changed = 1 + + if attr.getNote() != note: + attr.setNote(note) + changed = 1 + + if attr.getPrivacy() != priv: + attr.setPrivacy(priv) + changed = 1 + + if attr.getConfidence() != conf: + attr.setConfidence(conf) + changed = 1 + + return changed + #------------------------------------------------------------------------- # # update_event @@ -417,22 +417,37 @@ def on_select_row(obj,row,b,c): # actually changed. # #------------------------------------------------------------------------- -def update_event(event,name,date,place,desc): +def update_event(event,name,date,place,desc,note,priv,conf): + changed = 0 if event.getPlace() != place: event.setPlace(place) - utils.modified() + changed = 1 - if event.getName() != const.save_fevent(name): - event.setName(const.save_fevent(name)) - utils.modified() + if event.getName() != const.save_pevent(name): + event.setName(const.save_pevent(name)) + changed = 1 if event.getDescription() != desc: event.setDescription(desc) - utils.modified() + changed = 1 + + if event.getNote() != note: + event.setNote(note) + changed = 1 if event.getDate() != date: event.setDate(date) - utils.modified() + changed = 1 + + if event.getPrivacy() != priv: + event.setPrivacy(priv) + changed = 1 + + if event.getConfidence() != conf: + event.setConfidence(conf) + changed = 1 + + return changed #------------------------------------------------------------------------- # # @@ -625,49 +640,6 @@ def on_ok_clicked(obj): on_apply_clicked(obj) utils.destroy_passed_object(obj) -#------------------------------------------------------------------------- -# -# -# -#------------------------------------------------------------------------- -def on_event_note_clicked(obj): - row = obj.get_data(INDEX) - data = obj.get_row_data(row) - family_obj = obj.get_data(MARRIAGE) - - if row >= 0: - editnote = libglade.GladeXML(const.editnoteFile,"editnote") - textobj = editnote.get_widget("notetext") - en_obj = editnote.get_widget("editnote") - en_obj.set_data("n",data) - en_obj.set_data("w",textobj) - - textobj.set_point(0) - textobj.insert_defaults(data.getNote()) - textobj.set_word_wrap(1) - - editnote.signal_autoconnect({ - "on_save_note_clicked" : on_save_note_clicked, - "destroy_passed_object" : utils.destroy_passed_object - }) - -#------------------------------------------------------------------------- -# -# -# -#------------------------------------------------------------------------- -def on_save_note_clicked(obj): - textbox = obj.get_data("w") - data = obj.get_data("n") - - text = textbox.get_chars(0,-1) - if text != data.getNote(): - data.setNote(text) - utils.modified() - - utils.destroy_passed_object(obj) - - #------------------------------------------------------------------------- # # on_attr_list_select_row - sets the row object attached to the passed @@ -681,8 +653,9 @@ def on_attr_list_select_row(obj,row,b,c): family_obj = obj.get_data(MARRIAGE) attr = obj.get_row_data(row) - family_obj.attr_type.set_text(const.display_fattr(attr.getType())) + family_obj.attr_type.set_label(const.display_fattr(attr.getType())) family_obj.attr_value.set_text(attr.getValue()) + family_obj.attr_details_field.set_text(get_detail_text(attr)) #------------------------------------------------------------------------- # @@ -693,13 +666,7 @@ def on_update_attr_clicked(obj): row = obj.get_data(INDEX) if row < 0: return - - family_obj = obj.get_data(MARRIAGE) - attr = obj.get_row_data(row) - attr.setType(const.save_fattr(family_obj.attr_type.get_text())) - attr.setValue(family_obj.attr_value.get_text()) - - family_obj.redraw_attr_list() + AttributeEditor(obj.get_data(MARRIAGE),obj.get_row_data(row)) #------------------------------------------------------------------------- # @@ -712,10 +679,9 @@ def on_delete_attr_clicked(obj): return family_obj = obj.get_data(MARRIAGE) - list = family_obj.family.getAttributeList() - del list[row] + del family_obj.alist[row] - if row > len(list)-1: + if row > len(family_obj.alist)-1: obj.set_data(INDEX,row-1) family_obj.redraw_attr_list() @@ -727,18 +693,256 @@ def on_delete_attr_clicked(obj): # #------------------------------------------------------------------------- def on_add_attr_clicked(obj): - family_obj = obj.get_data(MARRIAGE) + AttributeEditor(obj.get_data(MARRIAGE),None) - attr = Attribute() - name = family_obj.attr_type.get_text() - attr.setType(const.save_fattr(name)) - attr.setValue(family_obj.attr_value.get_text()) +#------------------------------------------------------------------------- +# +# EventEditor class +# +#------------------------------------------------------------------------- +class EventEditor: - if name not in const.familyAttributes: - const.familyAttributes.append(name) - menu = family_obj.get_widget("attr_combo") - menu.set_popdown_strings(const.familyAttributes) + def __init__(self,parent,event): + self.parent = parent + self.event = event + self.top = libglade.GladeXML(const.dialogFile, "event_edit") + self.window = self.top.get_widget("event_edit") + self.name_field = self.top.get_widget("eventName") + self.place_field = self.top.get_widget("eventPlace") + self.date_field = self.top.get_widget("eventDate") + self.descr_field = self.top.get_widget("eventDescription") + self.note_field = self.top.get_widget("eventNote") + self.event_menu = self.top.get_widget("personalEvents") + self.source_field = self.top.get_widget("event_source") + self.conf_menu = self.top.get_widget("conf") + self.priv = self.top.get_widget("priv") - family_obj.family.addAttribute(attr) - family_obj.redraw_attr_list() - utils.modified() + father = parent.family.getFather() + mother = parent.family.getMother() + if father and mother: + name = _("%s and %s") % (father.getPrimaryName().getName(), + mother.getPrimaryName().getName()) + elif father: + name = father.getPrimaryName().getName() + else: + name = mother.getPrimaryName().getName() + + self.top.get_widget("eventTitle").set_text(name) + self.event_menu.set_popdown_strings(const.marriageEvents) + + myMenu = GtkMenu() + index = 0 + for name in const.confidence: + item = GtkMenuItem(name) + item.set_data("a",index) + item.show() + myMenu.append(item) + index = index + 1 + + self.conf_menu.set_menu(myMenu) + + if event != None: + self.name_field.set_text(event.getName()) + self.place_field.set_text(event.getPlace()) + self.date_field.set_text(event.getDate()) + self.descr_field.set_text(event.getDescription()) + self.conf_menu.set_history(event.getConfidence()) + + self.priv.set_active(event.getPrivacy()) + + srcref_base = self.event.getSourceRef().getBase() + if srcref_base: + self.source_field.set_text(srcref_base.getTitle()) + else: + self.source_field.set_text("") + + self.note_field.set_point(0) + self.note_field.insert_defaults(event.getNote()) + self.note_field.set_word_wrap(1) + else: + self.conf_menu.set_history(2) + + self.window.set_data("o",self) + self.top.signal_autoconnect({ + "destroy_passed_object" : utils.destroy_passed_object, + "on_event_edit_ok_clicked" : on_event_edit_ok_clicked, + "on_source_clicked" : on_edit_source_clicked + }) + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def on_edit_source_clicked(obj): + ee = obj.get_data("o") + Sources.SourceEditor(ee.event,ee.parent.db,ee.source_field) + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def on_event_edit_ok_clicked(obj): + ee = obj.get_data("o") + event = ee.event + + ename = ee.name_field.get_text() + edate = ee.date_field.get_text() + eplace = ee.place_field.get_text() + enote = ee.note_field.get_chars(0,-1) + edesc = ee.descr_field.get_text() + epriv = ee.priv.get_active() + econf = ee.conf_menu.get_menu().get_active().get_data("a") + + if event == None: + event = Event() + ee.parent.elist.append(event) + + if update_event(event,ename,edate,eplace,edesc,enote,epriv,econf): + ee.parent.events_changed = 1 + + ee.parent.redraw_events() + utils.destroy_passed_object(obj) + + +#------------------------------------------------------------------------- +# +# AttributeEditor class +# +#------------------------------------------------------------------------- +class AttributeEditor: + + def __init__(self,parent,attrib): + self.parent = parent + self.attrib = attrib + self.top = libglade.GladeXML(const.dialogFile, "attr_edit") + self.window = self.top.get_widget("attr_edit") + self.type_field = self.top.get_widget("attr_type") + self.value_field = self.top.get_widget("attr_value") + self.note_field = self.top.get_widget("attr_note") + self.attrib_menu = self.top.get_widget("attr_menu") + self.source_field = self.top.get_widget("attr_source") + self.conf_menu = self.top.get_widget("conf") + self.priv = self.top.get_widget("priv") + + father = parent.family.getFather() + mother = parent.family.getMother() + if father and mother: + name = _("%s and %s") % (father.getPrimaryName().getName(), + mother.getPrimaryName().getName()) + elif father: + name = father.getPrimaryName().getName() + else: + name = mother.getPrimaryName().getName() + + self.top.get_widget("attrTitle").set_text(_("Attribute Editor for %s") % name) + if len(const.familyAttributes) > 0: + self.attrib_menu.set_popdown_strings(const.familyAttributes) + + myMenu = GtkMenu() + index = 0 + for name in const.confidence: + item = GtkMenuItem(name) + item.set_data("a",index) + item.show() + myMenu.append(item) + index = index + 1 + self.conf_menu.set_menu(myMenu) + + if attrib != None: + self.type_field.set_text(attrib.getType()) + self.value_field.set_text(attrib.getValue()) + srcref_base = self.attrib.getSourceRef().getBase() + if srcref_base: + self.source_field.set_text(srcref_base.getTitle()) + else: + self.source_field.set_text("") + + self.conf_menu.set_history(attrib.getConfidence()) + + self.priv.set_active(attrib.getPrivacy()) + + self.note_field.set_point(0) + self.note_field.insert_defaults(attrib.getNote()) + self.note_field.set_word_wrap(1) + else: + self.conf_menu.set_history(2) + + self.window.set_data("o",self) + self.top.signal_autoconnect({ + "destroy_passed_object" : utils.destroy_passed_object, + "on_attr_edit_ok_clicked" : on_attrib_edit_ok_clicked, + "on_source_clicked" : on_attrib_source_clicked + }) + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def on_attrib_source_clicked(obj): + ee = obj.get_data("o") + Sources.SourceEditor(ee.attrib,ee.parent.db,ee.source_field) + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def on_attrib_edit_ok_clicked(obj): + ee = obj.get_data("o") + attrib = ee.attrib + + type = ee.type_field.get_text() + value = ee.value_field.get_text() + note = ee.note_field.get_chars(0,-1) + priv = ee.priv.get_active() + conf = ee.conf_menu.get_menu().get_active().get_data("a") + + if attrib == None: + attrib = Attribute() + ee.parent.alist.append(attrib) + + if update_attrib(attrib,type,value,note,priv,conf): + ee.parent.attr_changed = 1 + + ee.parent.redraw_attr_list() + utils.destroy_passed_object(obj) + +# +# +# +#------------------------------------------------------------------------- +def get_detail_flags(obj): + detail = "" + if Config.show_detail: + if obj.getNote() != "": + detail = "N" + if obj.getSourceRef().getBase(): + detail = detail + "S" + if obj.getPrivacy(): + detail = detail + "P" + return detail + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def get_detail_text(obj): + if obj.getNote() != "": + details = _("Note") + else: + details = "" + if obj.getSourceRef().getBase() != None: + if details == "": + details = _("Source") + else: + details = "%s, %s" % (details,_("Source")) + if obj.getPrivacy() == 1: + if details == "": + details = _("Private") + else: + details = "%s, %s" % (details,_("Private")) + return details diff --git a/gramps/src/RelLib.py b/gramps/src/RelLib.py index 4a7b2a27b..a0c1577cb 100644 --- a/gramps/src/RelLib.py +++ b/gramps/src/RelLib.py @@ -766,6 +766,9 @@ class Family: def getAttributeList(self) : return self.attributeList + def setAttributeList(self,list) : + self.attributeList = list + def getNote(self): return self.note.get() @@ -817,17 +820,17 @@ class Family: def getChildList(self): return self.Children - def setMarriage(self,event): - self.Marriage = event - def getMarriage(self): - return self.Marriage - - def setDivorce(self,event): - self.Divorce = event + for e in self.EventList: + if e.getType == "Marriage": + return e + return None def getDivorce(self): - return self.Divorce + for e in self.EventList: + if e.getType == "Divorce": + return e + return None def addEvent(self,event) : self.EventList.append(event) @@ -835,6 +838,9 @@ class Family: def getEventList(self) : return self.EventList + def setEventList(self,list) : + self.EventList = list + def addPhoto(self,photo): self.photoList.append(photo) diff --git a/gramps/src/WriteXML.py b/gramps/src/WriteXML.py index 5a7dcb5e6..5e87d5e16 100644 --- a/gramps/src/WriteXML.py +++ b/gramps/src/WriteXML.py @@ -264,103 +264,98 @@ def exportData(database, filename, callback): g.write(" \n") g.write(" \n") - g.write(" \n") + if len(personList) > 0: + g.write(" \n") - total = len(personList) + len(familyList) - delta = max(int(total/50),1) + total = len(personList) + len(familyList) + delta = max(int(total/50),1) - count = 0 - for person in personList: - if count % delta == 0: - callback(float(count)/float(total)) - count = count + 1 + count = 0 + for person in personList: + if count % delta == 0: + callback(float(count)/float(total)) + count = count + 1 - write_id(g,"person",person,2) - if person.getGender() == Person.male: - write_line(g,"gender","M",3) - else: - write_line(g,"gender","F",3) - dump_name(g,"name",person.getPrimaryName(),3) - for name in person.getAlternateNames(): - dump_name(g,"aka",name,3) + write_id(g,"person",person,2) + if person.getGender() == Person.male: + write_line(g,"gender","M",3) + else: + write_line(g,"gender","F",3) + dump_name(g,"name",person.getPrimaryName(),3) + for name in person.getAlternateNames(): + dump_name(g,"aka",name,3) - write_line(g,"uid",person.getPafUid(),3) - write_line(g,"nick",person.getNickName(),3) - dump_my_event(g,"Birth",person.getBirth(),3) - dump_my_event(g,"Death",person.getDeath(),3) - for event in person.getEventList(): - dump_event(g,event,3) + write_line(g,"uid",person.getPafUid(),3) + write_line(g,"nick",person.getNickName(),3) + dump_my_event(g,"Birth",person.getBirth(),3) + dump_my_event(g,"Death",person.getDeath(),3) + for event in person.getEventList(): + dump_event(g,event,3) - for photo in person.getPhotoList(): - path = photo.getPath() - if os.path.dirname(path) == fileroot: - path = os.path.basename(path) - g.write(' \n") + for photo in person.getPhotoList(): + path = photo.getPath() + if os.path.dirname(path) == fileroot: + path = os.path.basename(path) + g.write(' \n") - if len(person.getAddressList()) > 0: - g.write(" \n") - for address in person.getAddressList(): - g.write(' \n' % conf_priv(address)) - write_line(g,"date",address.getDateObj().getSaveDate(),5) - write_line(g,"street",address.getStreet(),5) - write_line(g,"city",address.getCity(),5) - write_line(g,"state",address.getState(),5) - write_line(g,"country",address.getCountry(),5) - write_line(g,"postal",address.getPostal(),5) - if address.getNote() != "": - writeNote(g,"note",address.getNote(),5) - dump_source_ref(g,address.getSourceRef(),5) - g.write(' \n') - g.write(' \n') + if len(person.getAddressList()) > 0: + for address in person.getAddressList(): + g.write(' \n' % conf_priv(address)) + write_line(g,"date",address.getDateObj().getSaveDate(),5) + write_line(g,"street",address.getStreet(),5) + write_line(g,"city",address.getCity(),5) + write_line(g,"state",address.getState(),5) + write_line(g,"country",address.getCountry(),5) + write_line(g,"postal",address.getPostal(),5) + if address.getNote() != "": + writeNote(g,"note",address.getNote(),5) + dump_source_ref(g,address.getSourceRef(),5) + g.write(' \n') - if len(person.getAttributeList()) > 0: - g.write(" \n") - for attr in person.getAttributeList(): - if attr.getSourceRef() or attr.getNote(): - g.write(' \n' % conf_priv(attr)) - write_line(g,"attr_type",attr.getType(),5) - write_line(g,"attr_value",attr.getValue(),5) - dump_source_ref(g,attr.getSourceRef(),5) - writeNote(g,"note",attr.getNote(),5) - g.write(' \n') - else: - g.write(' ' % attr.getType()) - g.write(fix(attr.getValue())) - g.write('\n') - g.write(' \n') + if len(person.getAttributeList()) > 0: + for attr in person.getAttributeList(): + if attr.getSourceRef() or attr.getNote(): + g.write(' \n' % conf_priv(attr)) + write_line(g,"attr_type",attr.getType(),5) + write_line(g,"attr_value",attr.getValue(),5) + dump_source_ref(g,attr.getSourceRef(),5) + writeNote(g,"note",attr.getNote(),5) + g.write(' \n') + else: + g.write(' ' % attr.getType()) + g.write(fix(attr.getValue())) + g.write('\n') - if len(person.getUrlList()) > 0: - g.write(" \n") - for url in person.getUrlList(): - g.write(' \n') - g.write(' \n') + if len(person.getUrlList()) > 0: + for url in person.getUrlList(): + g.write(' \n') - write_ref(g,"childof",person.getMainFamily(),3) - for alt in person.getAltFamilyList(): - g.write(" \n" % \ - (alt[0].getId(), alt[1], alt[2])) + write_ref(g,"childof",person.getMainFamily(),3) + for alt in person.getAltFamilyList(): + g.write(" \n" % \ + (alt[0].getId(), alt[1], alt[2])) - for family in person.getFamilyList(): - write_ref(g,"parentin",family,3) + for family in person.getFamilyList(): + write_ref(g,"parentin",family,3) - writeNote(g,"note",person.getNote(),3) + writeNote(g,"note",person.getNote(),3) - g.write(" \n") - g.write(" \n") + g.write(" \n") + g.write(" \n") if len(familyList) > 0: g.write(" \n") @@ -374,8 +369,6 @@ def exportData(database, filename, callback): write_ref(g,"father",family.getFather(),3) write_ref(g,"mother",family.getMother(),3) - dump_event(g,family.getMarriage(),3) - dump_event(g,family.getDivorce(),3) for event in family.getEventList(): dump_event(g,event,3) @@ -397,15 +390,13 @@ def exportData(database, filename, callback): write_ref(g,"child",person,4) g.write(" \n") if len(family.getAttributeList()) > 0: - g.write(" \n") for attr in family.getAttributeList(): - g.write(' \n') + g.write(' \n') write_line(g,"attr_type",attr.getType(),5) write_line(g,"attr_value",attr.getValue(),5) dump_source_ref(g,attr.getSourceRef(),5) writeNote(g,"note",attr.getNote(),5) - g.write(' \n') - g.write(' \n') + g.write(' \n') writeNote(g,"note",family.getNote(),3) g.write(" \n") g.write(" \n") diff --git a/gramps/src/const.py b/gramps/src/const.py index bd06c6d0c..5c8065eb9 100644 --- a/gramps/src/const.py +++ b/gramps/src/const.py @@ -63,6 +63,7 @@ pluginsFile = rootDir + os.sep + "plugins.glade" editnoteFile = rootDir + os.sep + "editnote.glade" configFile = rootDir + os.sep + "config.glade" stylesFile = rootDir + os.sep + "styles.glade" +dialogFile = rootDir + os.sep + "dialog.glade" pluginsDir = rootDir + os.sep + "plugins" filtersDir = rootDir + os.sep + "filters" dataDir = rootDir + os.sep + "data" @@ -110,6 +111,7 @@ childRelations = { _("Adopted") : "Adopted", _("Stepchild") : "Stepchild", _("Unknown") : "Unknown", + _("Other") : "Other", } #------------------------------------------------------------------------- @@ -370,7 +372,8 @@ _fr_e2l = { "Married" : _("Married"), "Unmarried" : _("Unmarried"), "Partners" : _("Partners"), - "Unknown" : _("Unknown") + "Unknown" : _("Unknown"), + "Other" : _("Other") } _fr_l2e = {} diff --git a/gramps/src/dialog.glade b/gramps/src/dialog.glade new file mode 100644 index 000000000..8e8146b8e --- /dev/null +++ b/gramps/src/dialog.glade @@ -0,0 +1,1071 @@ + + + + + Gramps + gramps + + src + pixmaps + C + True + True + + + + GtkDialog + event_edit + Gramps - Event Editor + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + True + False + + + GtkVBox + Dialog:vbox + dialog-vbox1 + False + 0 + + + GtkHBox + Dialog:action_area + dialog-action_area1 + 10 + True + 5 + + 0 + False + True + GTK_PACK_END + + + + GtkHButtonBox + hbuttonbox18 + GTK_BUTTONBOX_END + 30 + 85 + 27 + 7 + 0 + + 0 + True + True + + + + GtkButton + button111 + True + True + + clicked + on_event_edit_ok_clicked + event_edit + Thu, 26 Jul 2001 20:29:11 GMT + + GNOME_STOCK_BUTTON_OK + GTK_RELIEF_NORMAL + + + + GtkButton + button113 + True + True + + clicked + destroy_passed_object + event_edit + Thu, 26 Jul 2001 19:16:49 GMT + + GNOME_STOCK_BUTTON_CANCEL + GTK_RELIEF_NORMAL + + + + + + GtkVBox + vbox29 + False + 0 + + 0 + True + True + + + + GtkLabel + eventTitle + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 10 + + 0 + False + False + + + + + GtkHSeparator + hseparator1 + + 0 + False + True + + + + + GtkTable + table21 + 7 + 2 + False + 0 + 0 + + 0 + True + True + + + + GtkLabel + label154 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label155 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label156 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label157 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GnomeEntry + eDescBox + event_description + 15 + + 1 + 2 + 3 + 4 + 3 + 3 + True + False + False + False + True + False + + + + GtkEntry + GnomeEntry:entry + eventDescription + True + True + True + 0 + + + + + + GtkCombo + eventPlace_combo + False + True + False + True + False + + + 1 + 2 + 2 + 3 + 3 + 3 + True + False + False + False + True + False + + + + GtkEntry + GtkCombo:entry + eventPlace + True + True + True + 0 + + + + + + GtkLabel + label158 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 4 + 5 + 0 + 0 + False + False + False + False + True + False + + + + + GtkCombo + personalEvents + False + True + False + True + False + + + 1 + 2 + 0 + 1 + 3 + 3 + True + False + False + False + True + False + + + + GtkEntry + GtkCombo:entry + eventName + True + True + True + 0 + + + + + + GtkEntry + eventDate + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 3 + 3 + True + False + False + False + True + False + + + + + GtkScrolledWindow + scrolledwindow21 + 400 + 150 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 1 + 2 + 6 + 7 + 3 + 3 + False + True + False + False + True + True + + + + GtkText + eventNote + True + True + + + + + + GtkLabel + label159 + + GTK_JUSTIFY_CENTER + False + 1 + 0 + 5 + 8 + + 0 + 1 + 6 + 7 + 0 + 0 + False + False + False + False + True + True + + + + + GtkHBox + hbox21 + False + 0 + + 1 + 2 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + + + GtkEntry + event_source + True + False + True + 0 + + + 3 + True + True + + + + + GtkButton + button114 + 3 + Edit source information for the highlighted event + True + + clicked + on_source_clicked + event_edit + Fri, 27 Jul 2001 01:05:33 GMT + + + GTK_RELIEF_NORMAL + + 3 + False + False + + + + + + GtkLabel + label178 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 5 + 6 + 0 + 0 + False + False + False + False + True + False + + + + + GtkHBox + hbox24 + False + 0 + + 1 + 2 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + + + GtkOptionMenu + conf + True + Very Low +Low +Normal +High +Very High + + 0 + + 3 + True + True + + + + + GtkCheckButton + priv + True + + False + True + + 5 + False + False + + + + + + + + + + GtkDialog + attr_edit + Gramps - Attribute Editor + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + True + False + + + GtkVBox + Dialog:vbox + vbox30 + False + 0 + + + GtkHBox + Dialog:action_area + hbox22 + 10 + True + 5 + + 0 + False + True + GTK_PACK_END + + + + GtkHButtonBox + hbuttonbox19 + GTK_BUTTONBOX_END + 30 + 85 + 27 + 7 + 0 + + 0 + True + True + + + + GtkButton + button115 + True + True + + clicked + on_attr_edit_ok_clicked + attr_edit + Sat, 28 Jul 2001 16:26:27 GMT + + GNOME_STOCK_BUTTON_OK + GTK_RELIEF_NORMAL + + + + GtkButton + button116 + True + True + + clicked + destroy_passed_object + attr_edit + Thu, 26 Jul 2001 19:16:49 GMT + + GNOME_STOCK_BUTTON_CANCEL + GTK_RELIEF_NORMAL + + + + + + GtkVBox + vbox31 + False + 0 + + 0 + True + True + + + + GtkLabel + attrTitle + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 10 + + 0 + False + False + + + + + GtkHSeparator + hseparator2 + + 0 + False + True + + + + + GtkTable + table22 + 5 + 2 + False + 0 + 0 + + 0 + True + True + + + + GtkLabel + label171 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label172 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label175 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkCombo + attr_menu + False + True + False + True + False + + + 1 + 2 + 0 + 1 + 3 + 3 + True + False + False + False + True + False + + + + GtkEntry + GtkCombo:entry + attr_type + True + True + True + 0 + + + + + + GtkEntry + attr_value + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 3 + 3 + True + False + False + False + True + False + + + + + GtkScrolledWindow + scrolledwindow22 + 400 + 150 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 1 + 2 + 4 + 5 + 3 + 3 + False + True + False + False + True + True + + + + GtkText + attr_note + True + True + + + + + + GtkLabel + label176 + + GTK_JUSTIFY_CENTER + False + 1 + 0 + 5 + 8 + + 0 + 1 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + + + + GtkHBox + hbox23 + False + 0 + + 1 + 2 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + + + GtkEntry + attr_source + True + False + True + 0 + + + 3 + True + True + + + + + GtkButton + button117 + 3 + Edit source information for the highlighted event + True + + clicked + on_source_clicked + attr_edit + Fri, 27 Jul 2001 01:05:33 GMT + + + GTK_RELIEF_NORMAL + + 3 + False + False + + + + + + GtkLabel + label177 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 8 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkHBox + hbox25 + False + 0 + + 1 + 2 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + + GtkOptionMenu + conf + True + Very Low +Low +Normal +High +Very High + + 0 + + 3 + True + True + + + + + GtkCheckButton + priv + True + + False + True + + 5 + False + False + + + + + + + + + diff --git a/gramps/src/gramps.glade b/gramps/src/gramps.glade index 12c49d432..127b4a725 100644 --- a/gramps/src/gramps.glade +++ b/gramps/src/gramps.glade @@ -1743,7 +1743,7 @@ Thu, 21 Dec 2000 20:47:47 GMT 6 - 210,60,50,150,75,50 + 210,60,85,150,75,50 GTK_SELECTION_SINGLE True GTK_SHADOW_IN diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py index 69e94266a..5e2dbb4e9 100755 --- a/gramps/src/gramps_main.py +++ b/gramps/src/gramps_main.py @@ -279,6 +279,9 @@ def on_add_child_clicked(obj): mname = mother.getPrimaryName().getName() childWindow.get_widget("mlabel").set_text(_("Relationship to %s") % mname) + childWindow.get_widget("mrel").set_text(_("Birth")) + childWindow.get_widget("frel").set_text(_("Birth")) + redraw_child_list(2) selectChild.show() @@ -344,6 +347,8 @@ def on_add_new_child_clicked(obj): newChildWindow.get_widget("childSurname").set_text(surname) newChildWindow.get_widget("addChild").show() + newChildWindow.get_widget("mrel").set_text(_("Birth")) + newChildWindow.get_widget("frel").set_text(_("Birth")) #------------------------------------------------------------------------- # @@ -531,11 +536,11 @@ def on_prel_changed(obj): fatherList.clear() motherList.clear() - fatherList.append(["unknown",""]) + fatherList.append(["Unknown",""]) fatherList.set_row_data(0,None) fatherList.set_data("father_text",fatherName) - motherList.append(["unknown",""]) + motherList.append(["Unknown",""]) motherList.set_row_data(0,None) motherList.set_data("mother_text",motherName) @@ -1995,7 +2000,7 @@ def display_marriage(family): child_list.sort(sort.by_birthdate) attr = "" for child in child_list: - status = _("unknown") + status = _("Unknown") if child.getGender(): gender = const.male else: @@ -2006,9 +2011,9 @@ def display_marriage(family): for fam in child.getAltFamilyList(): if fam[0] == family: if active_person == family.getFather(): - status = "%s/%s" % (fam[2],fam[1]) + status = "%s/%s" % (_(fam[2]),_(fam[1])) else: - status = "%s/%s" % (fam[1],fam[2]) + status = "%s/%s" % (_(fam[1]),_(fam[2])) if Config.show_detail: attr = "" diff --git a/gramps/src/marriage.glade b/gramps/src/marriage.glade index d64f2c352..1aa96d7ca 100644 --- a/gramps/src/marriage.glade +++ b/gramps/src/marriage.glade @@ -13,42 +13,30 @@ - GnomeDialog + GtkDialog marriageEditor - Gramps - Marriage Editor + Gramps - Marriage/Relationship Editor GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER + GTK_WIN_POS_NONE False - False - False + True + True False - False - False GtkVBox - GnomeDialog:vbox - dialog-vbox5 - 550 + Dialog:vbox + dialog-vbox6 False - 8 - - 0 - True - True - + 0 - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area5 - 400 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 + GtkHBox + Dialog:action_area + dialog-action_area6 + 10 + True + 5 0 False @@ -57,17 +45,49 @@ - GtkButton - button57 - True - True - - clicked - on_close_marriage_editor - marriageEditor - Thu, 24 May 2001 22:53:21 GMT - - GNOME_STOCK_BUTTON_CLOSE + GtkHButtonBox + hbuttonbox22 + GTK_BUTTONBOX_END + 30 + 85 + 27 + 7 + 0 + + 0 + True + True + + + + GtkButton + button107 + True + True + + clicked + on_close_marriage_editor + marriageEditor + Tue, 31 Jul 2001 15:50:12 GMT + + GNOME_STOCK_BUTTON_OK + GTK_RELIEF_NORMAL + + + + GtkButton + button108 + True + True + + clicked + destroy_passed_object + marriageEditor + Tue, 31 Jul 2001 15:49:42 GMT + + GNOME_STOCK_BUTTON_CANCEL + GTK_RELIEF_NORMAL + @@ -200,13 +220,12 @@ 0 - GtkTable - table6 - 4 - 3 - False - 0 - 0 + GtkFrame + marriageEventName + 5 + + 0 + GTK_SHADOW_ETCHED_IN 0 True @@ -214,272 +233,221 @@ - GtkLabel - label99 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - marriageDate - True - True - True - 0 - - - 1 - 2 - 1 - 2 - 3 - 3 - True - False - False - False - True - False - - - - - GtkLabel - label100 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 3 - 4 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label101 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label98 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkCombo - marriageEvent - False - True - False - True - False - - - 1 - 2 - 0 - 1 - 3 - 3 - True - False - False - False - True - False - + GtkTable + table8 + 4 + 2 + False + 0 + 0 - GtkEntry - GtkCombo:entry - marriageEventName - True - True - True - 0 - + GtkLabel + label212 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 3 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + - - - GtkButton - event_source - Select the source of the information - True - - clicked - on_showsource_clicked - marriageEventList - Sun, 11 Feb 2001 22:58:04 GMT - - - GTK_RELIEF_NORMAL - - 2 - 3 - 0 - 1 - 3 + + GtkLabel + label213 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 3 - False - False - False - False - True - False - - + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + - - GtkButton - event_note - True - - clicked - on_event_note_clicked - marriageEventList - Sat, 02 Jun 2001 18:53:55 GMT - - - GTK_RELIEF_NORMAL - - 2 - 3 - 1 - 2 - 3 + + GtkLabel + label214 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 3 - False - False - False - False - True - False - - + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + - - GtkEntry - marriagePlace - True - True - True - 0 - - - 1 - 3 - 2 - 3 - 3 - 3 - True - False - False - False - True - False - - + + GtkLabel + marriageDate + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 0 + 1 + 3 + 3 + True + False + False + False + True + False + + - - GtkEntry - marriageDescription - True - True - True - 0 - - - 1 - 3 - 3 - 4 - 3 + + GtkLabel + marriagePlace + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 1 + 2 + 3 + 3 + True + False + False + False + True + False + + + + + GtkLabel + marriageDescription + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 2 + 3 + 3 + 3 + True + False + False + False + True + False + + + + + GtkLabel + label218 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 3 - True - False - False - False - True - False - + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + event_details + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 3 + 4 + 3 + 3 + True + False + False + False + True + False + + @@ -564,8 +532,8 @@ 30 85 27 - 2 - 2 + 7 + 0 4 True @@ -598,7 +566,7 @@ marriageEventList Sat, 25 Nov 2000 16:52:46 GMT - + GTK_RELIEF_NORMAL @@ -639,186 +607,130 @@ 0 - GtkTable - table7 - 2 - 3 - False - 0 - 0 + GtkFrame + attr_type + 5 + + 0 + GTK_SHADOW_ETCHED_IN 0 False - True + False - GtkLabel - label204 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - attr_value - True - True - True - 0 - - - 1 - 2 - 1 - 2 - 3 - 3 - True - False - False - False - True - False - - - - - GtkLabel - label207 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 8 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkCombo - attr_combo - False - True - False - True - False - - - 1 - 2 - 0 - 1 - 3 - 3 - True - False - False - False - True - False - + GtkTable + table9 + 2 + 2 + False + 0 + 0 - GtkEntry - GtkCombo:entry - attr_type - True - True - True - 0 - + GtkLabel + label220 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 3 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + - - - GtkButton - attr_source - Select the source of the information - True - - clicked - on_showsource_clicked - attr_list - Sun, 11 Feb 2001 22:58:04 GMT - - - GTK_RELIEF_NORMAL - - 2 - 3 - 0 - 1 - 3 + + GtkLabel + attr_value + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 0 - False - False - False - False - True - False - - + + 1 + 2 + 0 + 1 + 3 + 3 + True + False + False + False + True + False + + - - GtkButton - attr_note - True - - clicked - on_event_note_clicked - attr_list - Sat, 02 Jun 2001 18:54:33 GMT - - - GTK_RELIEF_NORMAL - - 2 - 3 - 1 - 2 - 3 + + GtkLabel + label222 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 3 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + attr_details + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 0 - False - False - False - False - True - False - + + 1 + 2 + 1 + 2 + 3 + 3 + False + False + False + False + True + False + + @@ -898,8 +810,8 @@ 30 85 27 - 2 - 2 + 7 + 0 4 False @@ -932,7 +844,7 @@ attr_list Sat, 02 Jun 2001 18:59:40 GMT - + GTK_RELIEF_NORMAL @@ -1094,7 +1006,7 @@ GtkLabel Notebook:tab label201 - + GTK_JUSTIFY_CENTER False 0.5 diff --git a/gramps/src/plugins/Merge.py b/gramps/src/plugins/Merge.py index 4f4eeb7b0..ec088b3a9 100644 --- a/gramps/src/plugins/Merge.py +++ b/gramps/src/plugins/Merge.py @@ -401,30 +401,6 @@ class Merge: for event in src_family.getEventList(): tgt_family.addEvent(event) - # add mariage information - marriage = src_family.getMarriage() - if marriage: - other_marriage = tgt_family.getMarriage() - if other_marriage != None: - if other_marriage.getPlace() == "": - other_marriage.setPlace(marriage.getPlace()) - if other_marriage.getDate() == "": - other_marriage.setDate(marriage.getDate()) - else: - tgt_family.setMarriage(marriage) - - # add divorce information - divorce = src_family.getDivorce() - if divorce != None: - other_divorce = tgt_family.getDivorce() - if other_divorce != None: - if other_divorce.getPlace() == "": - other_divorce.setPlace(divorce.getPlace()) - if other_divorce.getDate() == "": - other_divorce.setDate(divorce.getDate()) - else: - tgt_family.setDivorce(divorce) - # change parents of the family to point to the new # family diff --git a/gramps/src/plugins/ReadGedcom.py b/gramps/src/plugins/ReadGedcom.py index b13f05475..496174ef0 100644 --- a/gramps/src/plugins/ReadGedcom.py +++ b/gramps/src/plugins/ReadGedcom.py @@ -495,20 +495,9 @@ class GedcomParser: self.ignore_sub_junk(2) elif matches[1] == "SOUR": self.ignore_sub_junk(2) - elif matches[1] == "MARR": - event = Event() - event.setName("Marriage") - self.family.setMarriage(event) - self.parse_family_event(event,2) - elif matches[1] == "DIV": - event = Event() - event.setName("Divorce") - self.family.setDivorce(event) - self.parse_family_event(event,2) elif matches[1] == "OBJE": if matches[2] and matches[2][0] == '@': self.barf(2) -# self.ignore_sub_junk(2) else: self.parse_family_object(2) elif matches[1] == "NOTE":