diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 24723536f..312aef2b8 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2006-07-29 Zsolt Foldvari + * src/NameDisplay.py (display_given): Cleanup + * src/Gramps.Cfg.py (NameFormatEditDlg.run): Verification of the + returned values + 2006-07-27 Alex Roitman * src/GrampsDb/_ReadGrdb.py: Re-map name formats on import. * src/GrampsDb/_GrampsBSDDB.py (_load_metadata): Upgrade custom diff --git a/gramps2/src/GrampsCfg.py b/gramps2/src/GrampsCfg.py index 8778bb84b..960e50c29 100644 --- a/gramps2/src/GrampsCfg.py +++ b/gramps2/src/GrampsCfg.py @@ -45,6 +45,7 @@ from NameDisplay import displayer as _nd from RelLib import Name import ManagedWindow from GrampsWidgets import * +import QuestionDialog #------------------------------------------------------------------------- # @@ -600,9 +601,22 @@ class NameFormatEditDlg: self.formatentry.set_text(self.fmt_str) def run(self): - self.response = self.dlg.run() - self.fmt_name = self.nameentry.get_text() - self.fmt_str = self.formatentry.get_text() + running = True + while running: + self.response = self.dlg.run() + + running = False + self.fmt_name = self.nameentry.get_text() + self.fmt_str = self.formatentry.get_text() + + if self.response == gtk.RESPONSE_OK: + if self.fmt_name == '' and self.fmt_str == '': + self.response = gtk.RESPONSE_CANCEL + elif (self.fmt_name == '') ^ (self.fmt_str == ''): + QuestionDialog.ErrorDialog( + _('Both Format name and definition have to be defined'), + parent=self.dlg) + running = True self.dlg.destroy() return (self.response, self.fmt_name, self.fmt_str) diff --git a/gramps2/src/NameDisplay.py b/gramps2/src/NameDisplay.py index 6142fb0d0..20a5f3ac0 100644 --- a/gramps2/src/NameDisplay.py +++ b/gramps2/src/NameDisplay.py @@ -450,10 +450,7 @@ class NameDisplay: def display_given(self,person): name = person.get_primary_name() - if name.patronymic: - return "%s %s" % (name.first_name, name.patronymic) - else: - return name.first_name + return self.format_str(person.get_primary_name(),'%f %y') def name_grouping(self,db,person): return self.name_grouping_name(db,person.primary_name)