From 87621141a1ce47ce850dab07510feba0691b967a Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 19 Feb 2004 20:34:58 +0000 Subject: [PATCH] Update svn: r2872 --- src/EditPerson.py | 2 +- src/NameEdit.py | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/EditPerson.py b/src/EditPerson.py index 47257140d..744ebde07 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -425,7 +425,7 @@ class EditPerson: self.parent.wins_dict[self.original_id] = self win_menu_label = GrampsCfg.nameof(self.person) if not win_menu_label.strip(): - win_menu_label = _("NewPerson") + win_menu_label = _("New Person") self.win_menu_item = gtk.MenuItem(win_menu_label) self.win_menu_item.set_submenu(gtk.Menu()) self.win_menu_item.show() diff --git a/src/NameEdit.py b/src/NameEdit.py index b81187719..3b0643d0f 100644 --- a/src/NameEdit.py +++ b/src/NameEdit.py @@ -131,10 +131,12 @@ class NameEditor: def on_delete_event(self,obj,b): self.close_child_windows() + self.parent.child_windows.remove(self) self.remove_itself_from_menu() def close(self,obj): self.close_child_windows() + self.parent.child_windows.remove(self) self.remove_itself_from_menu() Utils.destroy_passed_object(self.window) @@ -143,13 +145,27 @@ class NameEditor: child_window.close() def add_itself_to_menu(self): + if not self.name: + label = _("New Name") + else: + label = self.name.get_name() + if not label.strip(): + label = _("New Name") + label = "%s: %s" % (_('Alternate Name'),label) + self.parent_menu_item = gtk.MenuItem(label) + self.parent_menu_item.set_submenu(gtk.Menu()) + self.parent_menu_item.show() + self.parent.menu.append(self.parent_menu_item) + self.menu = self.parent_menu_item.get_submenu() self.menu_item = gtk.MenuItem(_('Name Editor')) self.menu_item.connect("activate",self.present) self.menu_item.show() - self.parent.menu.append(self.menu_item) + self.menu.append(self.menu_item) def remove_itself_from_menu(self): self.menu_item.destroy() + self.menu.destroy() + self.parent_menu_item.destroy() def present(self,obj): self.window.present()