2008-01-03 Benny Malengier <benny.malengier@gramps-project.org>

* src/plugins/RelCalc.py: managed window error, bug 1499



svn: r9699
This commit is contained in:
Benny Malengier 2008-01-03 14:50:15 +00:00
parent 22b32f3ca3
commit 1e2d017c92
2 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,6 @@
2008-01-03 Benny Malengier <benny.malengier@gramps-project.org>
* src/plugins/RelCalc.py: managed window error, bug 1499
2008-01-03 Gary Burton <gary.burton@zen.co.uk>
* src/GrampsWidgets.py: allow MonitoredEntry widgets to be updated with
empty strings. I fixed this issue in trunk 2 months ago and no ill effects

View File

@ -80,12 +80,6 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow):
Tool.Tool.__init__(self, dbstate, options_class, name)
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
if not self.person:
ErrorDialog(_('Active person has not been set'),
_('You must select an active person for this '
'tool to work properly.'))
return
self.RelClass = relationship_class
self.relationship = self.RelClass(self.db)
@ -93,6 +87,8 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow):
glade_file = "%s/relcalc.glade" % base
self.glade = gtk.glade.XML(glade_file,"relcalc","gramps")
name = ''
if self.person:
name = NameDisplay.displayer.display(self.person)
self.title = _('Relationship calculator: %(person_name)s'
) % {'person_name' : name}
@ -132,6 +128,14 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow):
"on_close_clicked" : self.close,
})
if not self.person:
self.window.hide()
ErrorDialog(_('Active person has not been set'),
_('You must select an active person for this '
'tool to work properly.'))
self.close()
return
self.show()
def build_menu_names(self,obj):