diff --git a/src/config.py b/src/config.py index 91a7ff85e..49eebec0e 100644 --- a/src/config.py +++ b/src/config.py @@ -211,7 +211,6 @@ register('interface.note-height', 500) register('interface.note-sel-height', 450) register('interface.note-sel-width', 600) register('interface.note-width', 700) -register('interface.patro-title', 0) register('interface.pedview-layout', 0) register('interface.pedview-show-images', True) register('interface.pedview-show-marriage', False) @@ -228,7 +227,6 @@ register('interface.place-height', 450) register('interface.place-sel-height', 450) register('interface.place-sel-width', 600) register('interface.place-width', 650) -register('interface.prefix-suffix', 0) register('interface.repo-height', 450) register('interface.repo-ref-height', 450) register('interface.repo-ref-width', 600) diff --git a/src/gen/db/base.py b/src/gen/db/base.py index 9e407f17b..014853cb1 100644 --- a/src/gen/db/base.py +++ b/src/gen/db/base.py @@ -361,6 +361,13 @@ class DbReadBase(object): """ raise NotImplementedError + def get_origin_types(self): + """ + Return a list of all custom origin types associated with Person/Surname + instances in the database. + """ + raise NotImplementedError + def get_note_bookmarks(self): """ Return the list of Note handles in the bookmarks. diff --git a/src/gen/db/read.py b/src/gen/db/read.py index 63db74f70..09158c587 100644 --- a/src/gen/db/read.py +++ b/src/gen/db/read.py @@ -297,6 +297,7 @@ class DbBsddbRead(DbReadBase, Callback): self.family_rel_types = set() self.event_role_names = set() self.name_types = set() + self.origin_types = set() self.repository_types = set() self.note_types = set() self.source_media_types = set() @@ -1267,6 +1268,13 @@ class DbBsddbRead(DbReadBase, Callback): """ return list(self.name_types) + def get_origin_types(self): + """ + Return a list of all custom origin types assocated with Person/Surname + instances in the database. + """ + return list(self.origin_types) + def get_repository_types(self): """ Return a list of all custom repository types assocated with Repository diff --git a/src/gen/db/write.py b/src/gen/db/write.py index 8966498fe..385475494 100644 --- a/src/gen/db/write.py +++ b/src/gen/db/write.py @@ -555,6 +555,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): self.family_rel_types = set(meta('family_rels')) self.event_role_names = set(meta('event_roles')) self.name_types = set(meta('name_types')) + self.origin_types = set(meta('origin_types')) self.repository_types = set(meta('repo_types')) self.note_types = set(meta('note_types')) self.source_media_types = set(meta('sm_types')) @@ -980,6 +981,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): txn.put('family_rels', list(self.family_rel_types)) txn.put('event_roles', list(self.event_role_names)) txn.put('name_types', list(self.name_types)) + txn.put('origin_types', list(self.origin_types)) txn.put('repo_types', list(self.repository_types)) txn.put('note_types', list(self.note_types)) txn.put('sm_types', list(self.source_media_types)) @@ -1425,7 +1427,13 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): for name in ([person.primary_name] + person.alternate_names) if name.type.is_custom()]) - + + all_surn = person.primary_name.get_surname_list() + for asurname in person.alternate_names: + all_surn += asurname.get_surname_list() + self.origin_types.update([str(surn.origintype) for surn in all_surn + if surn.origintype.is_custom()]) + self.url_types.update([str(url.type) for url in person.urls if url.type.is_custom()]) diff --git a/src/gen/proxy/proxybase.py b/src/gen/proxy/proxybase.py index be358e235..a56ac73d7 100644 --- a/src/gen/proxy/proxybase.py +++ b/src/gen/proxy/proxybase.py @@ -581,6 +581,11 @@ class ProxyDbBase(DbReadBase): instances in the database""" return self.db.get_name_types() + def get_origin_types(self): + """returns a list of all custom origin types associated with Person/Surname + instances in the database""" + return self.db.get_origin_types() + def get_repository_types(self): """returns a list of all custom repository types associated with Repository instances in the database""" diff --git a/src/glade/editperson.glade b/src/glade/editperson.glade index dab9f8f59..3550b211a 100644 --- a/src/glade/editperson.glade +++ b/src/glade/editperson.glade @@ -16,563 +16,762 @@ True - + True - 7 - 6 - 12 - 6 - - True - 0 - _Family: - True - center - surname - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - - True - 0 - Gi_ven: - True - center - given_name - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - - True - 0 - _Gender: - True - gender - - - 1 - 2 - 5 - 6 - GTK_FILL - - - - - + True - + True - 0 - <b>Preferred name</b> - True + + + True + + + True + 0 + <b>Preferred name</b> + True + + + False + False + 0 + + + + + True + 0 + <b> - </b> + True + + + False + False + 1 + + + + + True + True + True + + + + True + gtk-edit + + + + + False + False + 2 + + + + + True + + + 3 + + + + + True + 1 + 4 + _Type: + True + center + ntype + + + False + 8 + 4 + + + + + True + + + 5 + + + + + + + + False + False + 3 + 0 + + + + + True + 0.029999999329447746 + + + True + 12 + + + True + 2 + 6 + 7 + 7 + + + True + 0 + Gi_ven: + True + center + given_name + + + GTK_FILL + + + + + + True + 0 + _Title: + True + title + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Suffi_x: + True + suffix + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + + True + 0 + Call _Name: + True + call + + + 4 + 5 + GTK_FILL + + + + + + True + True + The person's given names + + + + + 1 + 4 + + + + + + True + 0 + N_ick Name: + True + nickname + + + 4 + 5 + 1 + 2 + GTK_FILL + + + + + + True + True + Part of the Given name that is the normally used name. + + + + 5 + 6 + + + + + True + True + A title used to refer to the person, such as 'Dr.' or 'Rev.' + + + + 1 + 2 + 1 + 2 + + + + + True + True + An optional suffix to the name, such as "Jr." or "III" + + + + 3 + 4 + 1 + 2 + + + + + True + True + A descriptive name given in place of or in addition to the official given name. + + + + 5 + 6 + 1 + 2 + + + + + + + + + True + <i>Given Name(s) </i> + True + + + + + False + False + 3 + 1 + + - False - False 0 - + + 124 True - 0 - <b> - </b> - True - - - False - False - 1 - - - - - True - True - False - Edit the preferred name - + 2.2351741291171123e-10 - + True - gtk-edit + + + 120 + 100 + True + + + + + + + True + <b>Image</b> + True - False - False - 2 - - - - - 4 - GTK_FILL - GTK_FILL - - - - - True - 0 - _Type: - True - center - ntype - - - 1 - 2 - 3 - 4 - GTK_FILL - - - - - - True - True - part of a person's name indicating the family to which the person belongs - - - 2 - 3 - 1 - 2 - - - - - - True - True - True - The person's given name - - - - 2 - 3 - 2 - 3 - - - - - - True - - - 2 - 3 - 3 - 4 - GTK_FILL - GTK_FILL - - - - - True - liststore2 - - - - 0 - - - - - 2 - 3 - 5 - 6 - GTK_FILL - GTK_FILL - - - - - True - - - True - - - 0 - - - - - True - : - prefixentry - - - False - False + 5 1 - 3 - 4 - 1 - 2 - GTK_FILL - GTK_FILL + False + 0 - + True - 0 - Call _Name: - True - call + 0.029999999329447746 + none + + + True + 12 + + + True + 5 + + + True + 2 + 4 + 7 + 4 + + + True + _Prefix + True + prefix + + + GTK_FILL + + + + + True + _Surname + True + surname + + + 1 + 2 + GTK_FILL + + + + + True + _Origin + True + cmborigin + + + 2 + 3 + GTK_FILL + + + + + True + True + part of a person's name indicating the family to which the person belongs + + + + 1 + 2 + 1 + 2 + + + + + + True + The origin of the family name of this family, eg 'Inherited' or 'Patronymic'. + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + + Use _Multiple Surnames + True + True + True + True + + + 3 + 4 + 1 + 2 + + + + + + + True + True + An optional prefix for the family that is not used in sorting, such as "de" or "van". + + + + 1 + 2 + GTK_FILL + + + + + True + + + 3 + 4 + + + + + + + False + False + 0 + + + + + + + + + True + <i>Family Name </i> + True + + - 3 - 4 - 2 - 3 - GTK_FILL - + False + False + 2 + 1 - + True + 0.029999999329447746 + none - + True - liststore1 + 12 - + + True + + + + + + + + + + + + + True + <i>Family Names </i> + True + + + + + False + False + 2 + 2 + + + + + True + 3 + 6 + 9 + 4 + + + True + 12 + + + True + 0 + <b>General</b> + True + + + False + False + 0 + + + + + True + True + True + none + + + True + gramps-unlock + + + + + False + False + 1 + + + + + 4 + GTK_FILL + + + + + + True + liststore2 + + 0 - 0 + 2 + 3 + 1 + 2 + GTK_FILL + GTK_FILL - + True - : - patroentry - - - False - False - 1 - - - - - 3 - 4 - 3 - 4 - GTK_FILL - GTK_FILL - - - - - True - 12 - - - True - 0 - <b>General</b> - True - - - False - False - 0 - - - - - True - True - False - Indicates if the record is private - none + 5 - + True - gramps-unlock + 0 + _ID: + True + right + gid + + False + False + 0 + + + + + True + True + A unique ID of the person. + + 6 + + + 1 + + + + + True + 0 + _Marker: + True + marker + + + False + False + 2 + + + + + True + + + 3 + - False - False - 1 + 3 + 6 + 1 + 2 + GTK_FILL + - - - 4 - 4 - 5 - GTK_FILL - GTK_FILL - - - - - True - True - Prefix: An optional prefix for the family name that is not used in sorting, such as "de" or "van" -Suffix: An optional suffix to the name, such as "Jr." or "III" - 6 - - - 4 - 5 - 1 - 2 - - - - - - True - True - Part of the Given name that is the normally used name. - - 8 - - - 4 - 5 - 2 - 3 - - - - - - True - True - Patronimic: component of a personal name based on the name of one's father, grandfather, .... -Title: A title used to refer to the person, such as 'Dr.' or 'Rev.' - 8 - - - 4 - 5 - 3 - 4 - - - - - - True - 5 - + True 0 - _ID: + _Tags: True - right - gid - False - False - 0 + 1 + 2 + 2 + 3 + GTK_FILL + - + True - True - - 6 + + + True + + + 0 + + + + + True + True + True + + + True + + + + + False + False + 1 + + - 1 + 2 + 6 + 2 + 3 + - + True 0 - _Marker: + _Gender: True - marker + gender - False - False - 2 + 1 + 2 + 1 + 2 + GTK_FILL + - + + + + + + + True + 10 - 3 + 1 + 2 + + + + + + + True + 10 + + + 2 + 3 + + - 3 - 6 - 5 - 6 - GTK_FILL - GTK_FILL + False + False + 3 - - - 124 - True - 0 - - - True - - - 120 - 100 - True - - - - - - - True - <b>Image</b> - True - - - - - 5 - 6 - 4 - GTK_FILL - GTK_FILL - - - - - True - 0 - _Tags: - True - - - 1 - 2 - 6 - 7 - - - - - True - - - True - - - 0 - - - - - True - True - True - - - True - gramps-tag - - - - - False - False - 1 - - - - - 2 - 6 - 6 - 7 - - - - - - - - - - - - - - - - - - - - - - - - - - False False - 10 1 diff --git a/src/gui/editors/editperson.py b/src/gui/editors/editperson.py index de08b8da1..55ace943e 100644 --- a/src/gui/editors/editperson.py +++ b/src/gui/editors/editperson.py @@ -142,9 +142,11 @@ class EditPerson(EditPrimary): self.obj_photo = self.top.get_object("personPix") self.eventbox = self.top.get_object("eventbox1") + self.singsurnfr = self.top.get_object("surnamefr") + self.multsurnfr = self.top.get_object("multsurnamefr") + self.singlesurn_active = True self.set_contexteventbox(self.top.get_object("eventboxtop")) - def _post_init(self): """ @@ -157,10 +159,13 @@ class EditPerson(EditPrimary): """ self.load_person_image() - if self.pname.get_surname() and not self.pname.get_first_name(): - self.given.grab_focus() - else: - self.surname_field.grab_focus() + self.given.grab_focus() + + self.multsurnfr.hide_all() + #if self.pname.get_surname() and not self.pname.get_first_name(): + # self.given.grab_focus() + #else: + # self.surname_field.grab_focus() def _connect_signals(self): """ @@ -172,7 +177,7 @@ class EditPerson(EditPrimary): self.define_help_button(self.top.get_object("button134")) self.given.connect("focus_out_event", self._given_focus_out_event) - self.top.get_object("button177").connect("clicked", + self.top.get_object("editnamebtn").connect("clicked", self._edit_name_clicked) self.eventbox.connect('button-press-event', @@ -228,6 +233,11 @@ class EditPerson(EditPrimary): # we just rebuild the view always self.event_list.rebuild_callback() + def _validate_call(self, widget, text): + """ a callname must be a part of the given name, see if this is the + case """ + return text in self.given.obj.get_text().split() + def _setup_fields(self): """ Connect the GrampsWidget objects to field in the interface. @@ -267,44 +277,56 @@ class EditPerson(EditPrimary): self.pname.get_type, self.db.readonly, self.db.get_name_types()) - - self.prefix_suffix = widgets.MonitoredComboSelectedEntry( - self.top.get_object("prefixcmb"), - self.top.get_object("prefixentry"), - [_('Prefix'), _('Suffix')], - [self.pname.set_surname_prefix, self.pname.set_suffix], - [self.pname.get_surname_prefix, self.pname.get_suffix], - default = config.get('interface.prefix-suffix'), - read_only = self.db.readonly) - self.patro_title = widgets.MonitoredComboSelectedEntry( - self.top.get_object("patrocmb"), - self.top.get_object("patroentry"), - [_('Patronymic'), _('Person|Title')], - [self.pname.set_patronymic, self.pname.set_title], - [self.pname.get_patronymic, self.pname.get_title], - default = config.get('interface.patro-title'), - read_only = self.db.readonly) - - self.call = widgets.MonitoredEntry( - self.top.get_object("call"), - self.pname.set_call_name, - self.pname.get_call_name, - self.db.readonly) - + #part of Given Name section self.given = widgets.MonitoredEntry( self.top.get_object("given_name"), self.pname.set_first_name, self.pname.get_first_name, self.db.readonly) + self.call = widgets.MonitoredEntry( + self.top.get_object("call"), + self.pname.set_call_name, + self.pname.get_call_name, + self.db.readonly) + self.call.connect("validate", self._validate_call) + + self.title = widgets.MonitoredEntry( + self.top.get_object("title"), + self.pname.set_title, + self.pname.get_title, + self.db.readonly) + + self.suffix = widgets.MonitoredEntry( + self.top.get_object("suffix"), + self.pname.set_suffix, + self.pname.get_suffix, + self.db.readonly) + + #part of Single Surname section self.surname_field = widgets.MonitoredEntry( self.top.get_object("surname"), - self.pname.set_surname, - self.pname.get_surname, + self.pname.get_primary_surname().set_surname, + self.pname.get_primary_surname().get_surname, self.db.readonly, autolist=self.db.get_surname_list() if not self.db.readonly else []) + self.prefix = widgets.MonitoredEntry( + self.top.get_object("prefix"), + self.pname.get_primary_surname().set_prefix, + self.pname.get_primary_surname().get_prefix, + self.db.readonly) + + self.ortype_field = widgets.MonitoredDataType( + self.top.get_object("cmborigin"), + self.pname.get_primary_surname().set_origintype, + self.pname.get_primary_surname().get_origintype, + self.db.readonly, + self.db.get_origin_types()) + + #other fields + self.tags = widgets.MonitoredTagList( self.top.get_object("tag_label"), self.top.get_object("tag_button"), @@ -321,11 +343,11 @@ class EditPerson(EditPrimary): self.db.readonly) #make sure title updates automatically - for obj in [self.top.get_object("surname"), - self.top.get_object("given_name"), - self.top.get_object("patroentry"), + for obj in [self.top.get_object("given_name"), self.top.get_object("call"), - self.top.get_object("prefixentry"), + self.top.get_object("suffix"), + self.top.get_object("prefix"), + self.top.get_object("surname"), ]: obj.connect('changed', self._changed_name) @@ -894,9 +916,8 @@ class EditPerson(EditPrimary): return child_ref_list def _cleanup_on_exit(self): - config.set('interface.prefix-suffix', self.prefix_suffix.active_key) - config.set('interface.patro-title', self.patro_title.active_key) - config.save() + pass + #config.save() class GenderDialog(gtk.MessageDialog): diff --git a/src/plugins/lib/libgrdb.py b/src/plugins/lib/libgrdb.py index c7f70ee74..e165380de 100644 --- a/src/plugins/lib/libgrdb.py +++ b/src/plugins/lib/libgrdb.py @@ -211,6 +211,7 @@ class DbGrdb(Callback): self.family_rel_types = set() self.event_role_names = set() self.name_types = set() + self.origin_types = set() self.repository_types = set() self.note_types = set() self.source_media_types = set()