2007-12-10 Douglas S. Blank <dblank@cs.brynmawr.edu>

* src/GrampsCfg.py: Fixed bug in being able to edit the uneditable
	* src/BasicUtils/_NameDisplay.py: Renamed standard name patterns
	  to match new pattern name keywords



svn: r9484
This commit is contained in:
Doug Blank 2007-12-10 23:09:48 +00:00
parent 13f46f0890
commit 1663cd245b
3 changed files with 18 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2007-12-10 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/GrampsCfg.py: Fixed bug in being able to edit the uneditable
* src/BasicUtils/_NameDisplay.py: Renamed standard name patterns
to match new pattern name keywords
2007-12-10 Benny Malengier <benny.malengier@gramps-project.org>
* src/gen/lib/notebase.py: change comment string
* src/gen/lib/person.py: change comment string

View File

@ -101,10 +101,10 @@ class NameDisplay:
STANDARD_FORMATS = [
(Name.DEF,_("Default format (defined by GRAMPS preferences)"),'',_ACT),
(Name.LNFN,_("Family name, Given name Patronymic"),'%p %l, %f %y %s',_ACT),
(Name.FNLN,_("Given name Family name"),'%f %y %p %l %s',_ACT),
(Name.PTFN,_("Patronymic, Given name"),'%p %y, %s %f',_ACT),
(Name.FN,_("Given name"),'%f',_ACT)
(Name.LNFN,_("Surname, Given Patronymic"),'%p %l, %f %y %s',_ACT),
(Name.FNLN,_("Given Surname"),'%f %y %p %l %s',_ACT),
(Name.PTFN,_("Patronymic, Given"),'%p %y, %s %f',_ACT),
(Name.FN,_("Given"),'%f',_ACT)
]
def __init__(self):
@ -440,23 +440,22 @@ def fn(%s):
The following substitutions are made:
%t -> title
%f -> given name (first name)
%f -> given (first name)
%p -> prefix
%s -> suffix
%l -> family name (last name, surname)
%l -> surname (last name)
%y -> patronymic
%c -> call name
%c -> call
%x -> common
%i -> initials
The capital letters are substituted for capitalized name components.
The %% is substituted with the single % character.
All the other characters in the fmt_str are unaffected.
"""
func = self.__class__.format_funcs.get(format_str)
if func == None:
func = self._gen_cooked_func(format_str)
self.__class__.format_funcs[format_str] = func
try:
s = func(first,surname,prefix,suffix,patronymic,title,call)
except (ValueError,TypeError,):

View File

@ -387,8 +387,9 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
name_column = gtk.TreeViewColumn(_('Format'),
name_renderer,
text=COL_NAME)
name_renderer.set_property('editable', True)
name_renderer.set_property('editable', False)
name_renderer.connect('edited', self.__change_name)
self.name_renderer = name_renderer
format_tree.append_column(name_column)
example_renderer = gtk.CellRendererText()
example_column = gtk.TreeViewColumn(_('Example'),
@ -457,6 +458,8 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
idx = self.selected_fmt[COL_NUM] < 0
self.remove_button.set_sensitive(idx)
self.edit_button.set_sensitive(idx)
self.name_renderer.set_property('editable', idx)
def cb_edit_fmt_str(self, obj):
"""