diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ce450721b..c185f2f5b 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,9 @@ +2006-07-06 Alex Roitman + * data/gramps.schemas.in: Remove unused key. + * src/Config/_GrampsConfigKeys.py: Regenerate file. + * src/NameDisplay.py (NameDisplay._format_str_base): Document the + format string interface. + 2006-07-06 Don Allingham * src/GrampsCfg.py: add cell renderer to combobox * help/C/gramps-manual.xml: update doc diff --git a/gramps2/data/gramps.schemas.in b/gramps2/data/gramps.schemas.in index c76a0b580..8db8f3f54 100644 --- a/gramps2/data/gramps.schemas.in +++ b/gramps2/data/gramps.schemas.in @@ -405,33 +405,18 @@ /apps/gramps/preferences/name-format gramps int - 0 + 1 Name display format This key determines the name display format. Use - 0 for "Surname, Firstname", - 1 for "Firstname Surname", - 2 for "Patronymic Firstname", and - 3 for "Firstname" style. - For custom styles, use -1 and set the name-format-str key. - - - - - /schemas/apps/gramps/preferences/name-format-str - /apps/gramps/preferences/name-format-str - gramps - string - - - Name display format string - This key determines the custom name display format. - Its value is unimportant unless the name-format keyis set to -1. - When used, the following substitutions are made: - %t -> title, %f -> given name, %p -> prefix, %s -> suffix, - %l -> family name, %y -> patronymic, %c -> call name. - The capital letters are substituted for capitalized name components. - The %% is substituted with the single % character. + 1 for "Surname, Firstname", + 2 for "Firstname Surname", + 3 for "Patronymic Firstname", and + 4 for "Firstname" style. + For custom styles, use negative integers, whose meaning + is database-specific. Zero is reserved for internal purposes + and should not be used. If used, it will be changed to 1 + by GRAMPS. diff --git a/gramps2/src/Config/_GrampsConfigKeys.py b/gramps2/src/Config/_GrampsConfigKeys.py index e159badbf..86a8c15a8 100644 --- a/gramps2/src/Config/_GrampsConfigKeys.py +++ b/gramps2/src/Config/_GrampsConfigKeys.py @@ -53,7 +53,6 @@ RECENT_FILE = ('paths','recent-file', 2) RECENT_IMPORT_DIR = ('paths','recent-import-dir', 2) RECENT_EXPORT_DIR = ('paths','recent-export-dir', 2) NAME_FORMAT = ('preferences','name-format', 1) -NAME_FORMAT_STR = ('preferences','name-format-str', 2) REPORT_DIRECTORY = ('paths','report-directory', 2) RESEARCHER_ADDR = ('researcher','researcher-addr', 2) RESEARCHER_CITY = ('researcher','researcher-city', 2) @@ -110,7 +109,6 @@ default_value = { RECENT_IMPORT_DIR : '', RECENT_EXPORT_DIR : '', NAME_FORMAT : 0, - NAME_FORMAT_STR : '', REPORT_DIRECTORY : './', RESEARCHER_ADDR : '', RESEARCHER_CITY : '', diff --git a/gramps2/src/NameDisplay.py b/gramps2/src/NameDisplay.py index 1c2fff7e4..2a6689be2 100644 --- a/gramps2/src/NameDisplay.py +++ b/gramps2/src/NameDisplay.py @@ -283,7 +283,20 @@ class NameDisplay: def _format_str_base(self,first,surname,prefix,suffix,patronymic, title,call,format_str): """ - Generates name from a format string, e.g. '%T. %p %F %L (%p)' . + Generates name from a format string. + + The following substitutions are made: + %t -> title + %f -> given name (first name) + %p -> prefix + %s -> suffix + %l -> family name (last name, surname) + %y -> patronymic + %c -> call name + 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. + """ output = format_str @@ -295,6 +308,7 @@ class NameDisplay: output = output.replace("%s",suffix) output = output.replace("%y",patronymic) output = output.replace("%c",call) + output = output.replace("%T",title.upper()) output = output.replace("%F",first.upper()) output = output.replace("%P",prefix.upper())