diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index 6ec48df66..796ae9992 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -320,8 +320,8 @@ class EditFamily(EditPrimary): # family if self.added and self.obj.get_father_handle() == None and \ - self.obj.get_mother_handle() == None and \ - len(self.obj.get_child_ref_list()) == 1: + self.obj.get_mother_handle() == None and \ + len(self.obj.get_child_ref_list()) == 1: self.add_parent = True if not Config.get_family_warn(): for i in self.hidden: @@ -369,8 +369,11 @@ class EditFamily(EditPrimary): self.update_mother(mhandle) self.child_list.rebuild() - def build_menu_names(self,obj): - return ('Edit Family','Undefined Submenu') + def build_menu_names(self,family): + win_menu_label = Utils.family_name(family,self.db,_("New Family")) + if not win_menu_label.strip(): + win_menu_label = _("New Family") + return (_('Edit Family'), win_menu_label) def build_interface(self): diff --git a/src/Editors/_EditPrimary.py b/src/Editors/_EditPrimary.py index f1236c3ab..f7ccac83b 100644 --- a/src/Editors/_EditPrimary.py +++ b/src/Editors/_EditPrimary.py @@ -82,7 +82,7 @@ class EditPrimary(ManagedWindow.ManagedWindow): pass def build_window_key(self,obj): - if obj: + if obj and obj.get_handle(): return obj.get_handle() else: return id(self) diff --git a/src/Utils.py b/src/Utils.py index 197f78782..b9f5188ea 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -261,7 +261,7 @@ def wasHistory_broken(): # #------------------------------------------------------------------------- -def family_name(family,db): +def family_name(family,db,noname=_("unknown")): """Builds a name for the family from the parents names""" father_handle = family.get_father_handle() mother_handle = family.get_mother_handle() @@ -278,7 +278,7 @@ def family_name(family,db): elif mother: name = NameDisplay.displayer.display(mother) else: - name = _("unknown") + name = noname return name def family_upper_name(family,db):