diff --git a/gramps/src/EditPerson.glade b/gramps/src/EditPerson.glade
index 0d549ad0c..a4c5738d3 100644
--- a/gramps/src/EditPerson.glade
+++ b/gramps/src/EditPerson.glade
@@ -1199,7 +1199,7 @@
GtkTable
table7
4
- 2
+ 3
False
0
0
@@ -1320,7 +1320,7 @@
15
1
- 2
+ 3
2
3
3
@@ -1352,7 +1352,7 @@
15
1
- 2
+ 3
3
4
3
@@ -1378,78 +1378,13 @@
- GtkHBox
- hbox13
- False
- 0
-
- 1
- 2
- 0
- 1
- 3
- 3
- False
- False
- False
- False
- True
- True
-
-
-
- GtkCombo
- personalEvents
- False
- True
- False
- True
- False
-
-
- 0
- True
- True
-
-
-
- GtkEntry
- GtkCombo:entry
- eventName
- True
- True
- True
- 0
-
-
-
-
-
- GtkButton
- button86
- Choose source information
- True
-
- clicked
- on_showsource_clicked
-
- Thu, 11 Jan 2001 04:08:33 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 4
- False
- False
-
-
-
-
-
- GtkHBox
- hbox19
- False
- 0
+ GtkEntry
+ eventDate
+ True
+ True
+ True
+ 0
+
1
2
@@ -1457,47 +1392,106 @@
2
3
3
- False
+ True
False
False
False
True
- True
+ False
+
+
+
+
+ GtkCombo
+ personalEvents
+ False
+ True
+ False
+ True
+ False
+
+
+ 1
+ 2
+ 0
+ 1
+ 3
+ 3
+ True
+ False
+ False
+ False
+ True
+ False
GtkEntry
- eventDate
+ GtkCombo:entry
+ eventName
True
True
True
0
-
- 0
- True
- True
-
+
-
- GtkButton
- edit_note
- True
-
- clicked
- on_event_note_clicked
-
- Tue, 29 May 2001 15:07:23 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 4
- False
- False
-
-
+
+ GtkButton
+ button86
+ Choose source information
+ True
+
+ clicked
+ on_showsource_clicked
+
+ Thu, 11 Jan 2001 04:08:33 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 2
+ 3
+ 0
+ 1
+ 5
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkButton
+ edit_note
+ True
+
+ clicked
+ on_event_note_clicked
+
+ Tue, 29 May 2001 15:07:23 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 2
+ 3
+ 1
+ 2
+ 5
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
@@ -1671,7 +1665,7 @@
GtkTable
table12
2
- 2
+ 3
False
0
0
@@ -1734,10 +1728,14 @@
- GtkHBox
- hbox14
- False
- 0
+ GtkCombo
+ attribute
+ False
+ True
+ False
+ True
+ False
+
1
2
@@ -1745,67 +1743,34 @@
1
3
3
- False
+ True
False
False
False
True
- True
+ False
- GtkCombo
- attribute
- False
- True
- False
- True
- False
-
-
- 0
- True
- True
-
-
-
- GtkEntry
- GtkCombo:entry
- attr_type
- True
- True
- True
- 0
-
-
-
-
-
- GtkButton
- button95
- Choose source information
+ GtkEntry
+ GtkCombo:entry
+ attr_type
True
-
- clicked
- on_showsource_clicked
-
- Thu, 11 Jan 2001 04:08:33 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
+ True
+ True
+ 0
+
- GtkHBox
- hbox20
- False
- 0
+ GtkEntry
+ attr_value
+ True
+ True
+ True
+ 0
+
1
2
@@ -1818,42 +1783,65 @@
False
False
True
- True
+ False
+
-
- GtkEntry
- attr_value
- True
- True
- True
- 0
-
-
- 0
- True
- True
-
-
+
+ GtkButton
+ button95
+ Choose source information
+ True
+
+ clicked
+ on_showsource_clicked
+
+ Thu, 11 Jan 2001 04:08:33 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 2
+ 3
+ 0
+ 1
+ 5
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
-
- GtkButton
- button97
- True
-
- clicked
- on_event_note_clicked
-
- Tue, 29 May 2001 15:26:54 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
+
+ GtkButton
+ button97
+ True
+
+ clicked
+ on_event_note_clicked
+
+ Tue, 29 May 2001 15:26:54 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 2
+ 3
+ 1
+ 2
+ 5
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
@@ -1998,6 +1986,378 @@
False
0
+
+ GtkTable
+ table20
+ 4
+ 5
+ False
+ 0
+ 0
+
+ 0
+ False
+ True
+
+
+
+ GtkLabel
+ label142
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 8
+
+ 0
+ 1
+ 3
+ 4
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ label143
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 8
+
+ 0
+ 1
+ 2
+ 3
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ label141
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 8
+
+ 0
+ 1
+ 1
+ 2
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ label140
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 8
+
+ 0
+ 1
+ 0
+ 1
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkEntry
+ country
+ True
+ True
+ True
+ 0
+
+
+ 1
+ 2
+ 3
+ 4
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkEntry
+ city
+ True
+ True
+ True
+ 0
+
+
+ 1
+ 2
+ 2
+ 3
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ label148
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 2
+ 3
+ 2
+ 3
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ label149
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 2
+ 3
+ 3
+ 4
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkEntry
+ address_start
+ True
+ True
+ True
+ 0
+
+
+ 1
+ 4
+ 0
+ 1
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkEntry
+ street
+ True
+ True
+ True
+ 0
+
+
+ 1
+ 4
+ 1
+ 2
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkEntry
+ state
+ True
+ True
+ True
+ 0
+
+
+ 3
+ 4
+ 2
+ 3
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkEntry
+ postal
+ True
+ True
+ True
+ 0
+
+
+ 3
+ 4
+ 3
+ 4
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkButton
+ button91
+ Choose source information
+ True
+
+ clicked
+ on_showsource_clicked
+
+ Thu, 11 Jan 2001 04:08:33 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 4
+ 5
+ 0
+ 1
+ 5
+ 0
+ False
+ False
+ True
+ False
+ False
+ False
+
+
+
+
+ GtkButton
+ button98
+ True
+
+ clicked
+ on_event_note_clicked
+
+ Tue, 29 May 2001 15:27:27 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 4
+ 5
+ 1
+ 2
+ 5
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
GtkVBox
vbox27
@@ -2009,372 +2369,6 @@
True
-
- GtkTable
- table13
- 4
- 2
- False
- 0
- 0
-
- 0
- False
- True
-
-
-
- GtkLabel
- label140
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 8
-
- 0
- 1
- 0
- 1
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label141
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 8
-
- 0
- 1
- 1
- 2
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label142
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 8
-
- 0
- 1
- 3
- 4
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label143
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 8
-
- 0
- 1
- 2
- 3
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkHBox
- hbox15
- False
- 0
-
- 1
- 2
- 0
- 1
- 3
- 3
- False
- False
- False
- False
- True
- True
-
-
-
- GtkEntry
- address_start
- True
- True
- True
- 0
-
-
- 0
- True
- True
-
-
-
-
- GtkButton
- button91
- Choose source information
- True
-
- clicked
- on_showsource_clicked
-
- Thu, 11 Jan 2001 04:08:33 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
-
-
-
- GtkHBox
- hbox16
- False
- 0
-
- 1
- 2
- 2
- 3
- 0
- 0
- False
- False
- False
- False
- True
- True
-
-
-
- GtkEntry
- city
- True
- True
- True
- 0
-
-
- 3
- True
- True
-
-
-
-
- GtkLabel
- label148
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 5
- False
- False
-
-
-
-
- GtkEntry
- state
- True
- True
- True
- 0
-
-
- 3
- True
- True
-
-
-
-
-
- GtkHBox
- hbox17
- False
- 0
-
- 1
- 2
- 3
- 4
- 0
- 0
- False
- False
- False
- False
- True
- True
-
-
-
- GtkEntry
- country
- True
- True
- True
- 0
-
-
- 3
- True
- True
-
-
-
-
- GtkLabel
- label149
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 5
- False
- False
-
-
-
-
- GtkEntry
- postal
- True
- True
- True
- 0
-
-
- 3
- True
- True
-
-
-
-
-
- GtkHBox
- hbox21
- False
- 0
-
- 1
- 2
- 1
- 2
- 3
- 3
- True
- False
- False
- False
- True
- True
-
-
-
- GtkEntry
- street
- True
- True
- True
- 0
-
-
- 0
- True
- True
-
-
-
-
- GtkButton
- button98
- True
-
- clicked
- on_event_note_clicked
-
- Tue, 29 May 2001 15:27:27 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
-
-
-
GtkScrolledWindow
scrolledwindow20
@@ -3023,148 +3017,4 @@
-
- GtkDialog
- editnote
- Gramps - Edit Note
- 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
- button99
- True
- True
-
- clicked
- on_save_note_clicked
-
- Tue, 29 May 2001 15:06:53 GMT
-
- GNOME_STOCK_BUTTON_OK
- GTK_RELIEF_NORMAL
-
-
-
- GtkButton
- button100
- True
- True
-
- clicked
- destroy_passed_object
-
- Tue, 29 May 2001 15:06:38 GMT
-
- GNOME_STOCK_BUTTON_CANCEL
- GTK_RELIEF_NORMAL
-
-
-
-
-
- GtkVBox
- vbox29
- False
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- label153
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 10
- False
- False
-
-
-
-
- GtkHSeparator
- hseparator1
-
- 5
- False
- True
-
-
-
-
- GtkScrolledWindow
- scrolledwindow21
- 450
- 300
- GTK_POLICY_NEVER
- GTK_POLICY_ALWAYS
- GTK_UPDATE_CONTINUOUS
- GTK_UPDATE_CONTINUOUS
-
- 0
- True
- True
-
-
-
- GtkText
- notetext
- True
- True
-
-
-
-
-
-
-
diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py
index 8158ff3cc..8f3f99370 100644
--- a/gramps/src/EditPerson.py
+++ b/gramps/src/EditPerson.py
@@ -1086,7 +1086,11 @@ def on_savephoto_clicked(obj):
utils.modified()
utils.destroy_passed_object(obj)
-
+#-------------------------------------------------------------------------
+#
+#
+#
+#-------------------------------------------------------------------------
def on_save_note_clicked(obj):
textbox = obj.get_data("w")
data = obj.get_data("n")
@@ -1098,12 +1102,17 @@ def on_save_note_clicked(obj):
utils.destroy_passed_object(obj)
+#-------------------------------------------------------------------------
+#
+#
+#
+#-------------------------------------------------------------------------
def on_event_note_clicked(obj):
row = obj.get_data(INDEX)
data = obj.get_row_data(row)
edit_person_obj = obj.get_data(EDITPERSON)
if row >= 0:
- editnote = libglade.GladeXML(const.editPersonFile,"editnote")
+ editnote = libglade.GladeXML(const.editnoteFile,"editnote")
textobj = editnote.get_widget("notetext")
en_obj = editnote.get_widget("editnote")
en_obj.set_data("n",data)
diff --git a/gramps/src/GrampsParser.py b/gramps/src/GrampsParser.py
index 0dcd3b61e..865798d6f 100644
--- a/gramps/src/GrampsParser.py
+++ b/gramps/src/GrampsParser.py
@@ -162,7 +162,10 @@ class GrampsParser(handler.ContentHandler):
self.attribute.setType(string.capwords(attrs["type"]))
else:
self.in_old_attr = 0
- self.person.addAttribute(self.attribute)
+ if self.in_people:
+ self.person.addAttribute(self.attribute)
+ elif self.in_family:
+ self.family.addAttribute(self.attribute)
#---------------------------------------------------------------------
#
diff --git a/gramps/src/Makefile.in b/gramps/src/Makefile.in
index 7aa40b591..ac7838719 100644
--- a/gramps/src/Makefile.in
+++ b/gramps/src/Makefile.in
@@ -19,7 +19,7 @@ intl.so: intl.c
install:
${INSTALL} -d ${datadir}
- ${INSTALL} *.pyc *.py *.jpg *.pyo *.glade *.xpm *.so ${datadir}
+ ${INSTALL} *.py *.jpg *.pyo *.glade *.xpm *.so ${datadir}
${INSTALL} -d ${prefix}/share/pixmaps
${INSTALL} gramps.png ${prefix}/share/pixmaps
${INSTALL} -d ${prefix}/share/gnome/apps/Applications
diff --git a/gramps/src/Marriage.py b/gramps/src/Marriage.py
index 542a2e1bb..e0959444b 100644
--- a/gramps/src/Marriage.py
+++ b/gramps/src/Marriage.py
@@ -77,12 +77,16 @@ class Marriage:
"on_marriageUpdateBtn_clicked" : on_update_clicked,
"on_marriageDeleteBtn_clicked" : on_delete_clicked,
"on_marriageEventList_select_row" : on_select_row,
+ "on_attr_list_select_row" : on_attr_list_select_row,
+ "on_add_attr_clicked" : on_add_attr_clicked,
+ "on_update_attr_clicked" : on_update_attr_clicked,
+ "on_delete_attr_clicked" : on_delete_attr_clicked,
"on_showsource_clicked" : on_showsource_clicked,
- "on_makeprimary_clicked" : on_primary_photo_clicked,
"on_photolist_select_icon" : on_photo_select_icon,
"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
})
@@ -102,6 +106,9 @@ class Marriage:
self.descr_field = self.get_widget("marriageDescription")
self.type_field = self.get_widget("marriage_type")
self.notes_field = self.get_widget("marriageNotes")
+ self.attr_list = self.get_widget("attr_list")
+ self.attr_type = self.get_widget("attr_type")
+ self.attr_value = self.get_widget("attr_value")
# set initial data
mevent_list = self.get_widget("marriageEvent")
@@ -116,6 +123,12 @@ class Marriage:
top_window.set_data(MARRIAGE,self)
self.event_list.set_data(MARRIAGE,self)
self.event_list.set_data(INDEX,-1)
+ 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)
@@ -123,8 +136,36 @@ class Marriage:
self.notes_field.set_word_wrap(1)
self.redraw_events()
+ self.redraw_attr_list()
top_window.show()
+ #---------------------------------------------------------------------
+ #
+ # redraw_attr_list - redraws the attribute list for the person
+ #
+ #---------------------------------------------------------------------
+ def redraw_attr_list(self):
+ self.attr_list.freeze()
+ self.attr_list.clear()
+
+ self.attr_index = 0
+ for attr in self.family.getAttributeList():
+ self.attr_list.append([attr.getType(),attr.getValue()])
+ self.attr_list.set_row_data(self.attr_index,attr)
+ self.attr_index = self.attr_index + 1
+
+ current_row = self.attr_list.get_data(INDEX)
+
+ if self.attr_index > 0:
+ if current_row <= 0:
+ current_row = 0
+ elif self.attr_index <= current_row:
+ current_row = current_row - 1
+ self.attr_list.select_row(current_row,0)
+ self.attr_list.moveto(current_row,0)
+ self.attr_list.set_data(INDEX,current_row)
+ self.attr_list.thaw()
+
#-------------------------------------------------------------------------
#
# add_event - adds the event to the window, attaching the event structure
@@ -380,25 +421,6 @@ def on_showsource_clicked(obj):
if row >= 0:
Sources.SourceEditor(obj.get_row_data(row),family_obj.db)
-#-------------------------------------------------------------------------
-#
-#
-#
-#-------------------------------------------------------------------------
-def on_primary_photo_clicked(obj):
- marriage_obj = obj.get_data(MARRIAGE)
- if marriage_obj.selectedIcon == None or \
- marriage_obj.selectedIcon == 0:
- return
-
- photolist = marriage.family.getPhotoList()
- savePhoto = photolist[selectedIcon]
- for i in range(0,selectedIcon):
- photolist[selectedIcon-i] = photolist[selectedIcon-i-1]
- photolist[0] = savePhoto
- marriage_obj.load_images()
- utils.modified()
-
#-------------------------------------------------------------------------
#
#
@@ -435,7 +457,7 @@ def on_photolist_button_press_event(obj,event):
#-------------------------------------------------------------------------
def on_view_photo(obj):
myobj = obj.get_data("m")
- photo = myobj.person.getPhotoList()[myobj.selectedIcon]
+ photo = myobj.family.getPhotoList()[myobj.selectedIcon]
type = gnome.mime.type(photo.getPath())
prog = string.split(gnome.mime.get_value(type,'view'))
@@ -456,7 +478,7 @@ def on_view_photo(obj):
#-------------------------------------------------------------------------
def on_edit_photo(obj):
myobj = obj.get_data("m")
- photo = myobj.person.getPhotoList()[myobj.selectedIcon]
+ photo = myobj.family.getPhotoList()[myobj.selectedIcon]
if os.fork() == 0:
os.execvp(const.editor,[const.editor, photo.getPath()])
@@ -538,7 +560,7 @@ def on_savephoto_clicked(obj):
def on_change_description(obj):
myobj = obj.get_data("m")
- photo = myobj.person.getPhotoList()[myobj.selectedIcon]
+ photo = myobj.family.getPhotoList()[myobj.selectedIcon]
window = libglade.GladeXML(const.imageselFile,"dialog1")
text = window.get_widget("text")
text.set_text(photo.getDescription())
@@ -577,3 +599,121 @@ def on_apply_clicked(obj):
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
+# object, and then updates the display with the data corresponding to
+# the row.
+#
+#-------------------------------------------------------------------------
+def on_attr_list_select_row(obj,row,b,c):
+ obj.set_data(INDEX,row)
+
+ family_obj = obj.get_data(MARRIAGE)
+ attr = obj.get_row_data(row)
+
+ family_obj.attr_type.set_text(attr.getType())
+ family_obj.attr_value.set_text(attr.getValue())
+
+#-------------------------------------------------------------------------
+#
+#
+#
+#-------------------------------------------------------------------------
+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(family_obj.attr_type.get_text())
+ attr.setValue(family_obj.attr_value.get_text())
+
+ family_obj.redraw_attr_list()
+
+#-------------------------------------------------------------------------
+#
+#
+#
+#-------------------------------------------------------------------------
+def on_delete_attr_clicked(obj):
+ row = obj.get_data(INDEX)
+ if row < 0:
+ return
+
+ family_obj = obj.get_data(MARRIAGE)
+ list = family_obj.family.getAttributeList()
+ del list[row]
+
+ if row > len(list)-1:
+ obj.set_data(INDEX,row-1)
+
+ family_obj.redraw_attr_list()
+ utils.modified()
+
+#-------------------------------------------------------------------------
+#
+#
+#
+#-------------------------------------------------------------------------
+def on_add_attr_clicked(obj):
+ family_obj = obj.get_data(MARRIAGE)
+
+ attr = Attribute()
+ name = family_obj.attr_type.get_text()
+ attr.setType(name)
+ attr.setValue(family_obj.attr_value.get_text())
+
+ if name not in const.familyAttributes:
+ const.familyAttributes.append(name)
+ menu = family_obj.get_widget("attr_combo")
+ menu.set_popdown_strings(const.familyAttributes)
+
+ family_obj.family.addAttribute(attr)
+ family_obj.redraw_attr_list()
+ utils.modified()
diff --git a/gramps/src/RelLib.py b/gramps/src/RelLib.py
index bb01b30d4..5cfa18f40 100644
--- a/gramps/src/RelLib.py
+++ b/gramps/src/RelLib.py
@@ -532,6 +532,21 @@ class Family:
self.id = -1
self.photoList = []
self.note = Note()
+ self.attributeList = []
+
+ def addAttribute(self,attribute) :
+ self.attributeList.append(attribute)
+
+ def removeAttribute(self,attribute):
+ index = 0
+ for attr in self.attributeList:
+ if attr == attribute:
+ del self.attributeList[index]
+ return
+ index = index + 1
+
+ def getAttributeList(self) :
+ return self.attributeList
def getNote(self):
return self.note.get()
@@ -807,6 +822,13 @@ class RelDataBase:
map[attr.getType()] = 1
return map.keys()
+ def getFamilyAttributeTypes(self):
+ map = {}
+ for family in self.familyMap.values():
+ for attr in family.getAttributeList():
+ map[attr.getType()] = 1
+ return map.keys()
+
def getFamilyRelationTypes(self):
map = {}
for family in self.familyMap.values():
diff --git a/gramps/src/Sources.py b/gramps/src/Sources.py
index 41a42b82d..53e49b910 100644
--- a/gramps/src/Sources.py
+++ b/gramps/src/Sources.py
@@ -105,6 +105,7 @@ class SourceEditor:
menuitem.show()
typeMenu.append(menuitem)
index = 1
+ active = 0
save = 0
if self.source_ref:
self.base = self.source_ref.getBase()
@@ -113,6 +114,7 @@ class SourceEditor:
for src in self.db.getSourceMap().values():
if src == self.base:
+ active = 1
save = index
menuitem = GtkMenuItem(src.getTitle())
menuitem.set_data("s",src)
@@ -123,7 +125,12 @@ class SourceEditor:
index = index + 1
typeMenu.set_active(save)
self.title_menu.set_menu(typeMenu)
-
+
+ self.get_widget("spage").set_sensitive(active)
+ self.get_widget("sdate").set_sensitive(active)
+ self.get_widget("stext").set_sensitive(active)
+ self.get_widget("scomment").set_sensitive(active)
+
if self.source_ref:
self.get_widget("spage").set_text(self.source_ref.getPage())
date = self.source_ref.getDate()
@@ -189,10 +196,17 @@ def on_source_changed(obj):
src_entry.active_source = obj.get_data("s")
if src_entry.active_source == None:
+ active = 0
src_entry.author_field.set_text("")
src_entry.pub_field.set_text("")
else:
+ active = 1
src_entry.author_field.set_text(src_entry.active_source.getAuthor())
src_entry.pub_field.set_text(src_entry.active_source.getPubInfo())
+
+ src_entry.get_widget("spage").set_sensitive(active)
+ src_entry.get_widget("sdate").set_sensitive(active)
+ src_entry.get_widget("stext").set_sensitive(active)
+ src_entry.get_widget("scomment").set_sensitive(active)
diff --git a/gramps/src/WriteXML.py b/gramps/src/WriteXML.py
index 659e980a2..f102a1651 100644
--- a/gramps/src/WriteXML.py
+++ b/gramps/src/WriteXML.py
@@ -341,6 +341,16 @@ def exportData(database, filename, callback):
for person in family.getChildList():
write_ref(g,"child",person)
g.write("\n")
+ if len(family.getAttributeList()) > 0:
+ g.write("\n")
+ for attr in family.getAttributeList():
+ g.write('\n')
+ write_line(g,"attr_type",attr.getType())
+ write_line(g,"attr_value",attr.getValue())
+ dump_source_ref(g,attr.getSourceRef())
+ writeNote(g,"note",attr.getNote())
+ g.write('\n')
+ g.write('\n')
writeNote(g,"note",family.getNote())
g.write("\n")
g.write("\n")
diff --git a/gramps/src/const.py b/gramps/src/const.py
index 8237f22f3..3787d953d 100644
--- a/gramps/src/const.py
+++ b/gramps/src/const.py
@@ -54,8 +54,7 @@ marriageFile = rootDir + os.sep + "marriage.glade"
editPersonFile = rootDir + os.sep + "EditPerson.glade"
bookFile = rootDir + os.sep + "bookmarks.glade"
pluginsFile = rootDir + os.sep + "plugins.glade"
-notesFile = rootDir + os.sep + "editnote.glade"
-
+editnoteFile = rootDir + os.sep + "editnote.glade"
configFile = rootDir + os.sep + "config.glade"
pluginsDir = rootDir + os.sep + "plugins"
filtersDir = rootDir + os.sep + "filters"
@@ -155,6 +154,9 @@ personalConstantAttributes = {
"Social Security Number": "SSN"
}
+familyConstantAttributes = {
+ }
+
familyConstantRelations = [
"Married",
"Common Law",
@@ -168,6 +170,9 @@ personalEvents.sort()
personalAttributes = personalConstantAttributes.keys()
personalAttributes.sort()
+familyAttributes = familyConstantAttributes.keys()
+familyAttributes.sort()
+
marriageEvents = familyConstantEvents.keys()
marriageEvents.sort()
diff --git a/gramps/src/editnote.glade b/gramps/src/editnote.glade
new file mode 100644
index 000000000..cd96baa61
--- /dev/null
+++ b/gramps/src/editnote.glade
@@ -0,0 +1,159 @@
+
+
+
+
+ Gramps
+ gramps
+
+ src
+ pixmaps
+ C
+ True
+ True
+
+
+
+ GtkDialog
+ editnote
+ Gramps - Edit Note
+ 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
+ button99
+ True
+ True
+
+ clicked
+ on_save_note_clicked
+
+ Tue, 29 May 2001 15:06:53 GMT
+
+ GNOME_STOCK_BUTTON_OK
+ GTK_RELIEF_NORMAL
+
+
+
+ GtkButton
+ button100
+ True
+ True
+
+ clicked
+ destroy_passed_object
+
+ Tue, 29 May 2001 15:06:38 GMT
+
+ GNOME_STOCK_BUTTON_CANCEL
+ GTK_RELIEF_NORMAL
+
+
+
+
+
+ GtkVBox
+ vbox29
+ False
+ 0
+
+ 0
+ True
+ True
+
+
+
+ GtkLabel
+ label153
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 10
+ False
+ False
+
+
+
+
+ GtkHSeparator
+ hseparator1
+
+ 5
+ False
+ True
+
+
+
+
+ GtkScrolledWindow
+ scrolledwindow21
+ 450
+ 300
+ GTK_POLICY_NEVER
+ GTK_POLICY_ALWAYS
+ GTK_UPDATE_CONTINUOUS
+ GTK_UPDATE_CONTINUOUS
+
+ 0
+ True
+ True
+
+
+
+ GtkText
+ notetext
+ True
+ True
+
+
+
+
+
+
+
+
diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py
index dc9857b5c..2bb60d5dc 100755
--- a/gramps/src/gramps_main.py
+++ b/gramps/src/gramps_main.py
@@ -558,6 +558,8 @@ def new_database_response(val):
const.personalEvents.sort()
const.personalAttributes = const.personalConstantAttributes.keys()
const.personalAttributes.sort()
+ const.familyAttributes = const.familyConstantAttributes.keys()
+ const.familyAttributes.sort()
const.familyRelations = const.familyConstantRelations
database.new()
topWindow.set_title("Gramps")
@@ -1351,6 +1353,9 @@ def revert_query(value):
const.personalAttributes = const.personalConstantAttributes.keys()
const.personalAttributes.sort()
+ const.familyAttributes = const.familyConstantAttributes.keys()
+ const.familyAttributes.sort()
+
const.marriageEvents = const.familyConstantEvents.keys()
const.marriageEvents.sort()
@@ -1906,6 +1911,11 @@ def load_database(name):
if type not in const.personalAttributes:
const.personalAttributes.append(type)
+ mylist = database.getFamilyAttributeTypes()
+ for type in mylist:
+ if type not in const.familyAttributes:
+ const.familyAttributes.append(type)
+
mylist = database.getFamilyRelationTypes()
for type in mylist:
if type not in const.familyRelations:
diff --git a/gramps/src/marriage.glade b/gramps/src/marriage.glade
index 993d5be76..22257e395 100644
--- a/gramps/src/marriage.glade
+++ b/gramps/src/marriage.glade
@@ -184,7 +184,7 @@
True
GTK_POS_TOP
False
- 2
+ 5
2
False
@@ -203,7 +203,7 @@
GtkTable
table6
4
- 2
+ 3
False
0
0
@@ -315,6 +315,125 @@
+
+ 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
+
+
+
+ GtkEntry
+ GtkCombo:entry
+ marriageEventName
+ True
+ True
+ True
+ 0
+
+
+
+
+
+ GtkButton
+ marriageSource
+ Select the source of the information
+ True
+
+ clicked
+ on_showsource_clicked
+
+ Sun, 11 Feb 2001 22:58:04 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 2
+ 3
+ 0
+ 1
+ 3
+ 3
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkButton
+ button107
+ True
+
+ clicked
+ on_event_note_clicked
+
+ Sat, 02 Jun 2001 18:53:55 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 2
+ 3
+ 1
+ 2
+ 3
+ 3
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
GtkEntry
marriagePlace
@@ -325,7 +444,7 @@
1
- 2
+ 3
2
3
3
@@ -349,7 +468,7 @@
1
- 2
+ 3
3
4
3
@@ -362,100 +481,6 @@
False
-
-
- GtkHBox
- hbox14
- False
- 0
-
- 1
- 2
- 0
- 1
- 3
- 3
- False
- False
- False
- False
- True
- True
-
-
-
- GtkCombo
- marriageEvent
- False
- True
- False
- True
- False
-
-
- 0
- True
- True
-
-
-
- GtkEntry
- GtkCombo:entry
- marriageEventName
- True
- True
- True
- 0
-
-
-
-
-
- GtkButton
- marriageSource
- Select the source of the information
- True
-
- clicked
- on_showsource_clicked
-
- Sun, 11 Feb 2001 22:58:04 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 3
- False
- False
-
-
-
-
-
- GtkLabel
- label98
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 8
-
- 0
- 1
- 0
- 1
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
@@ -594,6 +619,327 @@
0
+
+ GtkVBox
+ vbox34
+ False
+ 0
+
+
+ GtkTable
+ table7
+ 2
+ 3
+ False
+ 0
+ 0
+
+ 0
+ False
+ True
+
+
+
+ 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
+
+
+
+ GtkEntry
+ GtkCombo:entry
+ attr_type
+ True
+ True
+ True
+ 0
+
+
+
+
+
+ GtkButton
+ button102
+ Select the source of the information
+ True
+
+ clicked
+ on_showsource_clicked
+
+ Sun, 11 Feb 2001 22:58:04 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 2
+ 3
+ 0
+ 1
+ 3
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkButton
+ button106
+ True
+
+ clicked
+ on_event_note_clicked
+
+ Sat, 02 Jun 2001 18:54:33 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 2
+ 3
+ 1
+ 2
+ 3
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+
+ GtkScrolledWindow
+ scrolledwindow23
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+ GTK_UPDATE_CONTINUOUS
+ GTK_UPDATE_CONTINUOUS
+
+ 0
+ True
+ True
+
+
+
+ GtkCList
+ attr_list
+ True
+
+ select_row
+ on_attr_list_select_row
+ Sat, 02 Jun 2001 18:58:35 GMT
+
+ 2
+ 189,80
+ GTK_SELECTION_SINGLE
+ True
+ GTK_SHADOW_IN
+
+
+ GtkLabel
+ CList:title
+ label210
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+ GtkLabel
+ CList:title
+ label211
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+
+
+ GtkHButtonBox
+ hbuttonbox21
+ GTK_BUTTONBOX_SPREAD
+ 30
+ 85
+ 27
+ 2
+ 2
+
+ 4
+ False
+ True
+
+
+
+ GtkButton
+ button103
+ True
+ True
+
+ clicked
+ on_add_attr_clicked
+
+ Sat, 02 Jun 2001 18:59:32 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+
+
+ GtkButton
+ button104
+ True
+ True
+
+ clicked
+ on_update_attr_clicked
+
+ Sat, 02 Jun 2001 18:59:40 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+
+
+ GtkButton
+ button105
+ True
+ True
+
+ clicked
+ on_delete_attr_clicked
+
+ Sat, 02 Jun 2001 18:59:50 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+
+
+
+
+ GtkLabel
+ Notebook:tab
+ label203
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
GtkScrolledWindow
scrolledwindow15
@@ -674,7 +1020,7 @@
GtkHButtonBox
hbuttonbox20
- GTK_BUTTONBOX_DEFAULT_STYLE
+ GTK_BUTTONBOX_SPREAD
30
85
27
@@ -715,21 +1061,6 @@
GTK_RELIEF_NORMAL
-
-
- GtkButton
- button102
- True
- True
-
- clicked
- on_makeprimary_clicked
-
- Thu, 29 Mar 2001 13:44:47 GMT
-
-
- GTK_RELIEF_NORMAL
-