2006-07-29 Zsolt Foldvari <zfoldvar@users.sourceforge.net>

* src/NameDisplay.py (display_given): Cleanup
	* src/Gramps.Cfg.py (NameFormatEditDlg.run): Verification of the
	returned values



svn: r7088
This commit is contained in:
Zsolt Foldvari 2006-07-29 20:56:11 +00:00
parent 7cf2dc0785
commit 5814acc1e3
3 changed files with 23 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2006-07-29 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/NameDisplay.py (display_given): Cleanup
* src/Gramps.Cfg.py (NameFormatEditDlg.run): Verification of the
returned values
2006-07-27 Alex Roitman <shura@gramps-project.org>
* src/GrampsDb/_ReadGrdb.py: Re-map name formats on import.
* src/GrampsDb/_GrampsBSDDB.py (_load_metadata): Upgrade custom

View File

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

View File

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