From e2526f32f3042001b4e6dda35e0ca1d99ff93c99 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 4 Aug 2004 04:53:29 +0000 Subject: [PATCH] * src/WriteXML.py: always write the default location for a place * src/EditPerson.py: don't for write of multimedia objects if not edited * src/ImageSelect.py: don't for write of multimedia objects if not edited * src/AutoComp.py: build ListStore for ComboBox and Entry * src/AddSpouse.py: use ComboBox * src/Marriage.py: use ComboBox * src/gramps.glade: Switch from gtk.Combo to gtk.ComboBox and gtk.ComboxEntry * src/EventEdit.py: handle autocompletion * src/RelLib.py: remove cPickle import * src/GrampsDbBase.py: fix has_handle functions svn: r3325 --- gramps2/ChangeLog | 15 + gramps2/example/gramps/data.gramps | Bin 5599 -> 24343 bytes gramps2/src/AddSpouse.py | 12 +- gramps2/src/AutoComp.py | 25 + gramps2/src/EditPerson.py | 32 +- gramps2/src/EventEdit.py | 21 +- gramps2/src/GrampsDbBase.py | 5 +- gramps2/src/ImageSelect.py | 10 +- gramps2/src/Marriage.py | 14 +- gramps2/src/ReadXML.py | 9 +- gramps2/src/RelLib.py | 1 - gramps2/src/WriteXML.py | 9 +- gramps2/src/gramps.glade | 782 ++++++++++------------------- 13 files changed, 355 insertions(+), 580 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 2c7126ce4..2586c8301 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,18 @@ +2004-08-03 Don Allingham + * src/WriteXML.py: always write the default location for a place + * src/EditPerson.py: don't for write of multimedia objects if + not edited + * src/ImageSelect.py: don't for write of multimedia objects if + not edited + * src/AutoComp.py: build ListStore for ComboBox and Entry + * src/AddSpouse.py: use ComboBox + * src/Marriage.py: use ComboBox + * src/gramps.glade: Switch from gtk.Combo to gtk.ComboBox and + gtk.ComboxEntry + * src/EventEdit.py: handle autocompletion + * src/RelLib.py: remove cPickle import + * src/GrampsDbBase.py: fix has_handle functions + 2004-08-01 Don Allingham * src/WriteGedcom.py: move up from plugins directory * src/ReadGedcom.py: move up from plugins directory diff --git a/gramps2/example/gramps/data.gramps b/gramps2/example/gramps/data.gramps index ee302713f8b98c2c6368c9d6ee5509ddff6ac8e5..65d86ea43ee668d9aaf4f0c843626ae0f43b6669 100644 GIT binary patch literal 24343 zcmcg!-E!Nw6~50?pt|U^GnTC%+Y+a;x3=TN$tJPK%64a`(+gOFEG87GAt`(PP<@KN zSU-RycmSF(r7)i4!Xm)~;5+{ZKa*enTm|ew#EBn;C!PL&uk*|4o5^3^USE9uDSB8taBgp)jHXqr}GZ`_kYl|XmR?6vB^^KxrpVT_%VwGPsLo)5GS1h zJG;4MgI;ggDf{c~d;9(FIu`v7TZ?ENpyA=5!xnty2fj!!qN5H=qD?%LKMv6<;Ofu8 zQRg7j+;3r~Se3 z@JO}EAJ8VtC={o|;jnvjbky}mgF)6%JtpnMiu=LoU38box&JdMhQA+*RDF>(P+w%f zOZ+AWB@-tZPuN^6_$EkCIv<9kPLBE-G82W&pX2FZoIeGw_ac-c@NROD|5c1jGK8g1 zYq0p-kJBalf(QCLe7W%BBt1O~Lq0jk{?0$eyMW`>G>wJ7Scn*tP!9^y2a4InFYzG4 zl=ehBk;3@EA@V$caE*_9-JaJS3=3gWf~#bV#bR;Nx#=I4uOeBPBM7cuwm*^Nj= zT*sMA$J$|vcYNH**~b^?vzTp#Hv~)@GRm3@5hj~N!vWkM{WKIw!lc-obUsGQkiCr{ zi(i+1!tkH7#9zS}u~a1K{^THUuNiO2!EEUV^JtN?XIzZe!JT1?-1*F7$i~lOOw7Z3 z!C;$W7=ZrBgAq>BXs!M}F6LV0&8U3kVopVGs7{oU4yHLl*D4{k%2bzLF%Sno`o~&4 z3T@fhfPEBU=)*|WaO6yyM_A6bOqkajb^HBpPy53PD;$=Es!4?trm6JCN9d$G@CrC9 z{W#RoVo7OKT|8+~M=oQ3#y$nn)4YZ&d63YS0ULIE<1V~n9-?dmm2FJeDi&~6XY*){ zU<#p;@l$tTOMSnQ*jN4b&Q3yE(W`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$T-ansf z&mB`?1Ezs2!f>P`?cBg4pGQza7No@EUIZ1GXPbY>yCpC@G?!3?J2&7DA@l$DzivPu zGL$rUnd(N8hd!D}!|HlL7paf=iF6$@JTmn;Qnhn4Ao8I}9fV{R8_yf2i_~*MjDE&< z;~8O;{UpH#z{<;YVNh;SYmOyhb>&-;KNT&AC?!Yn)|Heuctwq`|OEtdWde z05y!ChVK*#+cYa&i{CAbS%}dT3X?(~h8G6JPmV6FA=mGai=6%)XvTjt`&-HBPV-@K z$B1K|5XU?r{(S%A38Ya^NTWX(?S7;E1kQ*joDpw0vH!DYaGo5RpPs0}J~x{|}~k3I<)0007f*@1g(z diff --git a/gramps2/src/AddSpouse.py b/gramps2/src/AddSpouse.py index db57c2a50..49a4e857c 100644 --- a/gramps2/src/AddSpouse.py +++ b/gramps2/src/AddSpouse.py @@ -109,7 +109,6 @@ class AddSpouse: self.relation_def = self.glade.get_widget("reldef") self.rel_combo = self.glade.get_widget("rel_combo") - self.relation_type = self.glade.get_widget("rel_type") self.spouse_list = self.glade.get_widget("spouse_list") self.showall = self.glade.get_widget('showall') @@ -126,7 +125,6 @@ class AddSpouse: self.ok = self.glade.get_widget('spouse_ok') self.ok.set_sensitive(0) - self.rel_combo.set_popdown_strings(const.familyRelations) title = _("Choose Spouse/Partner of %s") % GrampsCfg.get_nameof()(person) Utils.set_titles(self.glade.get_widget('spouseDialog'), @@ -143,7 +141,7 @@ class AddSpouse: "destroy_passed_object" : Utils.destroy_passed_object }) - self.relation_type.set_text(const.family_relations[const.FREL_MARRIED][0]) + self.rel_combo.set_active(const.FAMILY_MARRIED) self.update_data() def add_columns(self,tree): @@ -192,8 +190,8 @@ class AddSpouse: """ import EditPerson - relation = const.save_frel(unicode(self.relation_type.get_text())) - if relation == "Partners": + relation = self.rel_combo.get_active() + if relation == const.FAMILY_CIVIL_UNION: if self.person.get_gender() == RelLib.Person.male: gen = RelLib.Person.male else: @@ -275,7 +273,7 @@ class AddSpouse: self.active_family.set_father_handle(spouse.get_handle()) self.active_family.set_mother_handle(self.person.get_handle()) - rtype = const.save_frel(unicode(self.relation_type.get_text())) + rtype = self.rel_combo.get_active() self.active_family.set_relationship(rtype) self.db.commit_family(self.active_family,trans) self.db.add_transaction(trans,_("Add Spouse")) @@ -342,7 +340,7 @@ class AddSpouse: return 1 def set_gender(self): - if self.rel_type.get_active() == const.FAMILY_CIVIL_UNION: + if self.rel_combo.get_active() == const.FAMILY_CIVIL_UNION: if self.gender == RelLib.Person.male: self.sgender = RelLib.Person.female else: diff --git a/gramps2/src/AutoComp.py b/gramps2/src/AutoComp.py index cdabf8863..387533bd2 100644 --- a/gramps2/src/AutoComp.py +++ b/gramps2/src/AutoComp.py @@ -290,4 +290,29 @@ class AutoEntry(AutoCompBase): gtk.Editable.select_region(entry,self.l, -1) return +def fill_combo(combo,data_list): + store = gtk.ListStore(gobject.TYPE_STRING) + + for data in data_list: + store.append(row=[data]) + + combo.set_model(store) + combo.set_text_column(0) + completion = gtk.EntryCompletion() + completion.set_model(store) + completion.set_minimum_key_length(1) + completion.set_text_column(0) + combo.child.set_completion(completion) + +def fill_entry(entry,data_list): + store = gtk.ListStore(gobject.TYPE_STRING) + + for data in data_list: + store.append(row=[data]) + + completion = gtk.EntryCompletion() + completion.set_model(store) + completion.set_minimum_key_length(1) + completion.set_text_column(0) + entry.set_completion(completion) diff --git a/gramps2/src/EditPerson.py b/gramps2/src/EditPerson.py index d1b1f2656..3c27cece4 100644 --- a/gramps2/src/EditPerson.py +++ b/gramps2/src/EditPerson.py @@ -308,7 +308,7 @@ class EditPerson: types = const.NameTypesMap.get_values() types.sort() - self.autotype = AutoComp.AutoCombo(self.ntype_field,types) + AutoComp.fill_combo(self.ntype_field,types) self.write_primary_name() if person.get_gender() == RelLib.Person.male: @@ -435,13 +435,13 @@ class EditPerson: child_window.close(None) self.child_windows = {} - def close(self,ok=0): + def close(self): event_list = [] for col in self.event_list.get_columns(): event_list.append(self.event_trans.find_key(col.get_title())) self.db.metadata['event_order'] = event_list - self.gallery.close(ok) + self.gallery.close() self.close_child_windows() self.remove_itself_from_winsmenu() self.window.destroy() @@ -484,7 +484,7 @@ class EditPerson: tree.append_column(column) def lds_field(self,ord,combo,date,place): - combo.set_popdown_strings(_temple_names) + AutoComp.fill_combo(combo,_temple_names) if not ord.is_empty(): stat = ord.get_status() date.set_text(ord.get_date()) @@ -492,10 +492,10 @@ class EditPerson: name = const.lds_temple_to_abrev[ord.get_temple()] else: name = "" - combo.entry.set_text(name) + combo.child.set_text(name) else: stat = 0 - combo.entry.set_text("") + combo.child.set_text("") build_dropdown(place,self.place_list) if ord and ord.get_place_handle(): @@ -1042,7 +1042,7 @@ class EditPerson: self.cancel_callback, self.save) else: - self.close(0) + self.close() def save(self): self.on_apply_person_clicked(None) @@ -1059,12 +1059,12 @@ class EditPerson: self.save) return 1 else: - self.close(0) + self.close() return 0 def cancel_callback(self): """If the user answered yes to abandoning changes, close the window""" - self.close(0) + self.close() def did_data_change(self): """Check to see if any of the data has changed from the @@ -1074,7 +1074,7 @@ class EditPerson: self.birth.set_date(unicode(self.bdate.get_text())) self.death.set_date(unicode(self.ddate.get_text())) - ntype = unicode(self.ntype_field.entry.get_text()) + ntype = unicode(self.ntype_field.child.get_text()) suffix = unicode(self.suffix.get_text()) prefix = unicode(self.prefix.get_text()) given = unicode(self.given.get_text()) @@ -1163,7 +1163,7 @@ class EditPerson: def check_lds(self): self.lds_baptism.set_date(unicode(self.ldsbap_date.get_text())) - temple = unicode(self.ldsbap_temple.entry.get_text()) + temple = unicode(self.ldsbap_temple.child.get_text()) if const.lds_temple_codes.has_key(temple): self.lds_baptism.set_temple(const.lds_temple_codes[temple]) else: @@ -1171,7 +1171,7 @@ class EditPerson: self.lds_baptism.set_place_handle(self.get_place(self.ldsbapplace,1)) self.lds_endowment.set_date(unicode(self.ldsend_date.get_text())) - temple = unicode(self.ldsend_temple.entry.get_text()) + temple = unicode(self.ldsend_temple.child.get_text()) if const.lds_temple_codes.has_key(temple): self.lds_endowment.set_temple(const.lds_temple_codes[temple]) else: @@ -1179,7 +1179,7 @@ class EditPerson: self.lds_endowment.set_place_handle(self.get_place(self.ldsendowplace,1)) self.lds_sealing.set_date(unicode(self.ldsseal_date.get_text())) - temple = unicode(self.ldsseal_temple.entry.get_text()) + temple = unicode(self.ldsseal_temple.child.get_text()) if const.lds_temple_codes.has_key(temple): self.lds_sealing.set_temple(const.lds_temple_codes[temple]) else: @@ -1438,7 +1438,7 @@ class EditPerson: surname = unicode(self.surname.get_text()) suffix = unicode(self.suffix.get_text()) prefix = unicode(self.prefix.get_text()) - ntype = unicode(self.ntype_field.entry.get_text()) + ntype = unicode(self.ntype_field.child.get_text()) given = unicode(self.given.get_text()) nick = unicode(self.nick.get_text()) title = unicode(self.title.get_text()) @@ -1607,7 +1607,7 @@ class EditPerson: self.db.commit_person(self.person, trans) n = self.person.get_primary_name().get_regular_name() self.db.add_transaction(trans,_("Edit Person (%s)") % n) - self.close(1) + self.close() def get_place(self,field,makenew=0): text = unicode(string.strip(field.get_text())) @@ -1747,7 +1747,7 @@ class EditPerson: self.surname.set_text(self.pname.get_surname()) self.given.set_text(self.pname.get_first_name()) - self.ntype_field.entry.set_text(_(self.pname.get_type())) + self.ntype_field.child.set_text(_(self.pname.get_type())) self.title.set_text(self.pname.get_title()) def birth_dates_in_order(self,list): diff --git a/gramps2/src/EventEdit.py b/gramps2/src/EventEdit.py index 0c55174e7..519a86204 100644 --- a/gramps2/src/EventEdit.py +++ b/gramps2/src/EventEdit.py @@ -121,7 +121,6 @@ class EventEditor: Utils.set_titles(self.window,title_label, etitle, _('Event Editor')) - self.name_field = self.top.get_widget("eventName") self.place_field = self.top.get_widget("eventPlace") self.cause_field = self.top.get_widget("eventCause") self.slist = self.top.get_widget("slist") @@ -131,7 +130,7 @@ class EventEditor: self.cause_field = self.top.get_widget("eventCause") self.descr_field = self.top.get_widget("event_description") self.note_field = self.top.get_widget("eventNote") - self.event_menu = self.top.get_widget("personalEvents") + self.event_menu = self.top.get_widget("personal_events") self.priv = self.top.get_widget("priv") self.calendar = self.top.get_widget("calendar") self.sources_label = self.top.get_widget("sourcesEvent") @@ -162,11 +161,11 @@ class EventEditor: self.top.get_widget('edit_witness'), self.top.get_widget('del_witness')) - AutoComp.AutoCombo(self.event_menu,self.elist) - AutoComp.AutoEntry(self.place_field,self.pmap.keys()) + AutoComp.fill_combo(self.event_menu,self.elist) + AutoComp.fill_entry(self.place_field,self.pmap.keys()) if event != None: - self.name_field.set_text(transname) + self.event_menu.child.set_text(transname) if (def_placename): self.place_field.set_text(def_placename) else: @@ -194,7 +193,7 @@ class EventEditor: Utils.bold_label(self.gallery_label) else: if def_event: - self.name_field.set_text(def_event) + self.event_menu.child.set_text(def_event) if def_placename: self.place_field.set_text(def_placename) self.date_check = DateEdit(self.date_field,self.top.get_widget("date_stat")) @@ -237,12 +236,12 @@ class EventEditor: self.window.show() def on_delete_event(self,obj,b): - self.gallery.close(0) + self.gallery.close() self.close_child_windows() self.remove_itself_from_menu() - def close(self,obj,ok=0): - self.gallery.close(ok) + def close(self,obj): + self.gallery.close() self.close_child_windows() self.remove_itself_from_menu() self.window.destroy() @@ -305,7 +304,7 @@ class EventEditor: trans = self.db.start_transaction() - ename = unicode(self.name_field.get_text()) + ename = unicode(self.event_menu.child.get_text()) self.date.set(unicode(self.date_field.get_text())) ecause = unicode(self.cause_field.get_text()) eplace_obj = self.get_place(self.place_field,trans) @@ -333,7 +332,7 @@ class EventEditor: self.update_event(ename,self.date,eplace_obj,edesc,enote,eformat, epriv,ecause,trans) self.db.add_transaction(trans,_("Edit Event")) - self.close(obj,1) + self.close(obj) self.parent.redraw_event_list() self.callback(self.event) diff --git a/gramps2/src/GrampsDbBase.py b/gramps2/src/GrampsDbBase.py index 9cc2eae7f..53d251897 100644 --- a/gramps2/src/GrampsDbBase.py +++ b/gramps2/src/GrampsDbBase.py @@ -488,10 +488,10 @@ class GrampsDbBase: return person.get_handle() def has_person_handle(self,val): - return self.person_map.get(val) + return self.person_map.has_key(str(val)) def has_family_handle(self,val): - return self.family_map.get(str(val)) + return self.family_map.has_key(str(val)) def try_to_find_person_from_handle(self,val): """finds a Person in the database from the passed gramps' ID. @@ -1123,7 +1123,6 @@ class GrampsDbBase: class Transaction: def __init__(self,msg,db): - print db self.db = db self.first = None self.last = None diff --git a/gramps2/src/ImageSelect.py b/gramps2/src/ImageSelect.py index d671611a8..3dbf28030 100644 --- a/gramps2/src/ImageSelect.py +++ b/gramps2/src/ImageSelect.py @@ -250,7 +250,7 @@ class Gallery(ImageSelect): self.sel = None self.photo = None - def close(self,ok=0): + def close(self): self.iconlist.hide() if self.canvas_list: for a in self.canvas_list.values(): @@ -259,14 +259,6 @@ class Gallery(ImageSelect): a[2].destroy() self.p_map = None self.canvas_list = None - # restore old photo list, in case we removed some and then - # hit cancel button or closed the window - if not ok: - if self.old_media_list is not None: - self.dataobj.set_media_list(self.old_media_list) - trans = self.db.start_transaction() - self.commit(self.dataobj,trans) - self.db.add_transaction(trans,_("Edit Media Object")) def on_canvas1_event(self,obj,event): """ diff --git a/gramps2/src/Marriage.py b/gramps2/src/Marriage.py index cfc97a961..5ac67bd78 100644 --- a/gramps2/src/Marriage.py +++ b/gramps2/src/Marriage.py @@ -204,11 +204,11 @@ class Marriage: self.gid.set_text(family.get_handle()) self.gid.set_editable(1) - self.lds_temple.set_popdown_strings(_temple_names) + AutoComp.fill_combo(self.lds_temple,_temple_names) place_list = self.pmap.keys() place_list.sort() - self.autoplace = AutoComp.AutoCombo(self.lds_place, place_list) + self.autoplace = AutoComp.fill_combo(self.lds_place, place_list) ord = self.family.get_lds_sealing() if ord: @@ -219,10 +219,10 @@ class Marriage: name = const.lds_temple_to_abrev[ord.get_temple()] else: name = "" - self.lds_temple.entry.set_text(name) + self.lds_temple.child.set_text(name) self.seal_stat = ord.get_status() else: - self.lds_temple.entry.set_text("") + self.lds_temple.child.set_text("") self.lds_place.entry.set_text("") self.seal_stat = 0 @@ -511,7 +511,7 @@ class Marriage: changed = 1 date = unicode(self.lds_date.get_text()) - temple = unicode(self.lds_temple.entry.get_text()) + temple = unicode(self.lds_temple.child.get_text()) if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: @@ -588,7 +588,7 @@ class Marriage: self.family.set_complete(self.complete.get_active()) date = unicode(self.lds_date.get_text()) - temple = unicode(self.lds_temple.entry.get_text()) + temple = unicode(self.lds_temple.child.get_text()) if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: @@ -760,7 +760,7 @@ class Marriage: Utils.unbold_label(self.notes_label) date = unicode(self.lds_date.get_text()) - temple = unicode(self.lds_temple.entry.get_text()) + temple = unicode(self.lds_temple.child.get_text()) if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: diff --git a/gramps2/src/ReadXML.py b/gramps2/src/ReadXML.py index f239bc27e..89cf6bec2 100644 --- a/gramps2/src/ReadXML.py +++ b/gramps2/src/ReadXML.py @@ -427,14 +427,12 @@ class GrampsParser: return person def map_gid(self,id): - if self.idswap.get(id): - return self.idswap[id] - else: + if not self.idswap.get(id): if self.db.id_trans.get(str(id)): self.idswap[id] = self.db.find_next_gramps_id() else: self.idswap[id] = id - return self.idswap[id] + return self.idswap[id] def parse(self,file): self.trans = self.db.start_transaction() @@ -590,7 +588,8 @@ class GrampsParser: self.callback(float(self.count)/float(self.entries)) self.count = self.count + 1 - self.person = self.find_person_by_gramps_id(self.map_gid(attrs['id'])) + new_id = self.map_gid(attrs['id']) + self.person = self.find_person_by_gramps_id(new_id) if attrs.has_key("complete"): self.person.set_complete(int(attrs['complete'])) diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index cec9bbbbd..510f0e98b 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -35,7 +35,6 @@ import os import os.path import types from gettext import gettext as _ -import cPickle #------------------------------------------------------------------------- # diff --git a/gramps2/src/WriteXML.py b/gramps2/src/WriteXML.py index 182e05b1b..841966c33 100644 --- a/gramps2/src/WriteXML.py +++ b/gramps2/src/WriteXML.py @@ -211,7 +211,8 @@ class XmlWriter: self.g.write('\n') self.g.write("\n") self.g.write("
\n") - self.g.write(" \n' % (sp2,ord.get_status())) if ord.get_family_handle(): - self.g.write('%s\n' % (sp2,self.fix(ord.get_family_handle().get_gramps_id()))) + self.g.write('%s\n' % \ + (sp2,self.fix(ord.get_family_handle().get_gramps_id()))) if ord.get_note() != "": self.write_note("note",ord.get_note_object(),index+1) for s in ord.get_source_references(): @@ -657,9 +659,6 @@ class XmlWriter: zip = self.fix(loc.get_postal_code()) phone = self.fix(loc.get_phone()) - if not city and not state and not parish and not county and not country: - return - self.g.write(' GTK_ORIENTATION_HORIZONTAL GTK_TOOLBAR_BOTH True + True - + True Open database Open True - gtk-open + gtk-open + True + True + False + + False + True + - + True Save database Save As... True - gtk-save-as + gtk-save-as + True + True + False + + False + True + - + + True + True + True + True + + + False + False + + + + + True Go back in history Back True - gtk-go-back - True + gtk-go-back + True + True + False - True + False + True - + True Go forward in history Forward True - gtk-go-forward + gtk-go-forward + True + True + False - - - - - True - Make the Home Person the active person - Home - True - gtk-home - - - - - - - True - Generate reports - Reports - True - gtk-dnd-multiple - True - - - True + False + True - + + True + Make the Home Person the active person + Home + True + gtk-home + True + True + False + + + + False + True + + + + + + True + True + True + True + + + False + False + + + + + + True + Generate reports + Reports + True + gtk-dnd-multiple + True + True + False + + + + False + True + + + + + True Run tools Tools True tools.png + True + True + False - - - - - True - Add a new item - Add - True - gtk-add - True - - - True + False + True - + + True + True + True + True + + + False + False + + + + + + True + Add a new item + Add + True + gtk-add + True + True + False + + + + False + True + + + + + True Remove the currently selected item Remove True - gtk-remove + gtk-remove + True + True + False + + False + True + - + True Edit the selected item Edit True edit.png + True + True + False + + False + True + @@ -3654,10 +3752,6 @@ 0.5 0 0 - rel_type - - - 0 @@ -3669,68 +3763,6 @@ - - - True - True - True - False - True - False - - - - True - True - False - True - 0 - - True - * - False - - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 1 - 2 - 0 - 1 - - - - True @@ -3755,6 +3787,25 @@ + + + + True + Married +Unmarried +Civil Union +Unknown +Other + + + 1 + 2 + 0 + 1 + fill + fill + + 0 @@ -8108,7 +8159,6 @@ Other 0.5 0 0 - combo-entry3 1 @@ -8363,89 +8413,6 @@ Other - - - True - False - False - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 2 - 5 - 7 - 8 - - - - True @@ -8937,6 +8904,20 @@ Other + + + + True + + + 2 + 5 + 7 + 8 + fill + fill + + 0 @@ -12193,10 +12174,8 @@ Other 0.5 0 0 - combo-entry7 Temple: - @@ -12209,45 +12188,6 @@ Other - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - - 2 - 3 - 2 - 3 - - - - True @@ -12403,10 +12343,6 @@ Other 0.5 0 0 - combo-entry8 - - - 1 @@ -12467,45 +12403,6 @@ Other - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - - 2 - 3 - 7 - 8 - - - - True @@ -12673,10 +12570,6 @@ Other 0.5 0 0 - combo-entry9 - - - 1 @@ -12688,45 +12581,6 @@ Other - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - - 2 - 3 - 12 - 13 - - - - True @@ -12889,6 +12743,48 @@ Other + + + + True + + + 2 + 3 + 2 + 3 + fill + fill + + + + + + True + + + 2 + 3 + 7 + 8 + fill + fill + + + + + + True + + + 2 + 3 + 12 + 13 + fill + fill + + False @@ -14704,128 +14600,6 @@ Other - - - True - True - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 2 - 3 - 2 - 3 - - - - - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 2 - 3 - 3 - 4 - - - - True @@ -14887,6 +14661,34 @@ Other + + + + True + + + 2 + 3 + 3 + 4 + fill + fill + + + + + + True + + + 2 + 3 + 2 + 3 + fill + fill + + 0 @@ -26321,10 +26123,6 @@ Other 0.5 0 0 - eventName - - - 0 @@ -26586,68 +26384,6 @@ Other - - - True - False - True - False - True - False - - - - True - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - - - - - - - 1 - 4 - 0 - 1 - - - - True @@ -26687,6 +26423,20 @@ Other fill + + + + True + + + 1 + 4 + 0 + 1 + fill + fill + + False