From af1fd6eb0ac0e8f20d9929d74b0487a19f0db370 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 3 Jan 2008 14:54:26 +0000 Subject: [PATCH] 2008-01-03 Benny Malengier * src/plugins/RelCalc.py: managed window error, bug 1499 svn: r9700 --- ChangeLog | 3 +++ src/plugins/RelCalc.py | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9fbf71b39..0481514bf 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 Douglas S. Blank * src/ReportBase/_Constants.py: added QR_NOTE, QR_DATE * src/gen/lib/date.py: working on date math diff --git a/src/plugins/RelCalc.py b/src/plugins/RelCalc.py index c08acd3e5..d68d081d9 100644 --- a/src/plugins/RelCalc.py +++ b/src/plugins/RelCalc.py @@ -81,12 +81,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.dbstate = dbstate self.relationship = relationship_class() self.relationship.connect_db_signals(dbstate) @@ -95,7 +89,9 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow): glade_file = base + os.sep + "relcalc.glade" self.glade = gtk.glade.XML(glade_file, "relcalc", "gramps") - name = name_displayer.display(self.person) + name = '' + if self.person: + name = name_displayer.display(self.person) self.title = _('Relationship calculator: %(person_name)s' ) % {'person_name' : name} window = self.glade.get_widget('relcalc') @@ -141,6 +137,14 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow): self.closebtn = self.glade.get_widget("button5") self.closebtn.connect('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 close(self, *obj):