From 1e2d017c92d35b59071f691ce0d5f5b6d03d48ba Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 3 Jan 2008 14:50:15 +0000 Subject: [PATCH] 2008-01-03 Benny Malengier * src/plugins/RelCalc.py: managed window error, bug 1499 svn: r9699 --- ChangeLog | 3 +++ src/plugins/RelCalc.py | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb7341869..7b752daf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2008-01-03 Benny Malengier + * src/plugins/RelCalc.py: managed window error, bug 1499 + 2008-01-03 Gary Burton * 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 diff --git a/src/plugins/RelCalc.py b/src/plugins/RelCalc.py index 87a6c201d..1b93f45ce 100644 --- a/src/plugins/RelCalc.py +++ b/src/plugins/RelCalc.py @@ -79,12 +79,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,7 +87,9 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow): glade_file = "%s/relcalc.glade" % base self.glade = gtk.glade.XML(glade_file,"relcalc","gramps") - name = NameDisplay.displayer.display(self.person) + name = '' + if self.person: + name = NameDisplay.displayer.display(self.person) self.title = _('Relationship calculator: %(person_name)s' ) % {'person_name' : name} window = self.glade.get_widget('relcalc') @@ -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):