From b3226a908b96dbf8bb048e5b954cdc33935332cf Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 6 Jul 2006 21:27:29 +0000 Subject: [PATCH] Update svn: r7002 --- gramps2/src/Editors/_EditName.py | 6 ++++-- gramps2/src/GrampsCfg.py | 27 ++++++++++++++------------- gramps2/src/RelLib/_Name.py | 6 ++++-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/gramps2/src/Editors/_EditName.py b/gramps2/src/Editors/_EditName.py index 2e756f518..c387573fa 100644 --- a/gramps2/src/Editors/_EditName.py +++ b/gramps2/src/Editors/_EditName.py @@ -97,8 +97,10 @@ class EditName(EditSecondary): self.group_as.force_value(self.obj.get_surname()) - format_list = [(name,number) for (number,name,fmt_str) - in RelLib.Name.DEFAULT_FORMATS] + (number,name,fmt_str) =RelLib.Name.DEFAULT_FORMAT + format_list = [(name,number)] + format_list += [(name,number) for (number,name,fmt_str) + in RelLib.Name.STANDARD_FORMATS] format_list += [(name,number) for (number,name,fmt_str) in NameDisplay.CUSTOM_FORMATS] diff --git a/gramps2/src/GrampsCfg.py b/gramps2/src/GrampsCfg.py index e966027ea..ecde35160 100644 --- a/gramps2/src/GrampsCfg.py +++ b/gramps2/src/GrampsCfg.py @@ -214,8 +214,9 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): self.name_exp.set_sensitive(False) - format_list = [(name,number) for (number,name,fmt_str) - in Name.DEFAULT_FORMATS] + format_list = [] + format_list += [(name,number) for (number,name,fmt_str) + in Name.STANDARD_FORMATS] format_list += [(name,number) for (number,name,fmt_str) in NameDisplay.CUSTOM_FORMATS] @@ -235,7 +236,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): active = int(Config.get(Config.NAME_FORMAT)) obox.set_active(active) - obox.connect('changed', self.name_changed) +# obox.connect('changed', self.name_changed) lwidget = BasicLabel("%s: " % _('Preset format')) # custom_ui = self.build_custom_name_ui() @@ -283,16 +284,16 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): ## return table - def name_changed(self,obj): - custom_text = NameDisplay.formats[Name.CUSTOM] - if obj.get_active_text() == custom_text: - pass - #self.name_exp.set_sensitive(True) - #self.name_exp.set_expanded(True) - else: - Config.set(Config.NAME_FORMAT,obj.get_active()) - #self.name_exp.set_expanded(False) - #self.name_exp.set_sensitive(False) +## def name_changed(self,obj): +## custom_text = NameDisplay.formats[Name.CUSTOM] +## if obj.get_active_text() == custom_text: +## pass +## #self.name_exp.set_sensitive(True) +## #self.name_exp.set_expanded(True) +## else: +## Config.set(Config.NAME_FORMAT,obj.get_active()) +## #self.name_exp.set_expanded(False) +## #self.name_exp.set_sensitive(False) def add_formats_panel(self): table = gtk.Table(3,8) diff --git a/gramps2/src/RelLib/_Name.py b/gramps2/src/RelLib/_Name.py index 12705f8cf..8be87d0e3 100644 --- a/gramps2/src/RelLib/_Name.py +++ b/gramps2/src/RelLib/_Name.py @@ -61,8 +61,10 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase): PTFN = 3 # patronymic first name FN = 4 # first name - DEFAULT_FORMATS = [ - (DEF, _("Default format (defined by GRAMPS preferences)"),''), + DEFAULT_FORMAT = \ + (DEF,_("Default format (defined by GRAMPS preferences)"),'') + + STANDARD_FORMATS = [ (LNFN, _("Family name, Given name Patronymic"),''), (FNLN, _("Given name Family name"),''), (PTFN, _("Patronymic, Given name"),''),