svn: r7002
This commit is contained in:
Alex Roitman 2006-07-06 21:27:29 +00:00
parent 323dd9033b
commit b3226a908b
3 changed files with 22 additions and 17 deletions

View File

@ -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]

View File

@ -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)

View File

@ -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"),''),