diff --git a/src/DisplayState.py b/src/DisplayState.py index 9d5ea022e..28f9cb3b1 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -384,13 +384,7 @@ class ManagedWindow: """ window_key = self.build_window_key(obj) - - menu_info = self.build_menu_names(obj) - if not menu_info: - menu_info = ('Undefined Menu','Undefined Submenu') - - menu_label = menu_info[0] - submenu_label = menu_info[1] + menu_label,submenu_label = self.build_menu_names(obj) if uistate.gwm.get_item_from_id(window_key): uistate.gwm.get_item_from_id(window_key).present() @@ -424,10 +418,14 @@ class ManagedWindow: self.parent_window = self.uistate.window def build_menu_names(self,obj): - return None + return ('Undefined Menu','Undefined Submenu') def build_window_key(self,obj): - return self + return id(self) + + def show(self): + self.window.set_transient_for(self.parent_window) + self.window.show() def close(self,obj=None,obj2=None): """ diff --git a/src/EditPerson.py b/src/EditPerson.py index 4dfeb3e9b..566c7c992 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -448,7 +448,7 @@ class EditPerson(DisplayState.ManagedWindow): widget = self.top.get_widget(i) if widget: widget.set_sensitive(not self.db.readonly) - self.window.show() + self.show() def build_menu_names(self,person): win_menu_label = self.nd.display(person) diff --git a/src/EditSource.py b/src/EditSource.py index 07e5321d6..1fbd67ff6 100644 --- a/src/EditSource.py +++ b/src/EditSource.py @@ -318,8 +318,7 @@ class EditSource(DisplayState.ManagedWindow): self.top_window.get_widget('ok').set_sensitive(not self.db.readonly) - self.window.set_transient_for(self.parent_window) - self.window.show() + self.show() self.model = None # This will hold the model for backreferences once it is complete. diff --git a/src/EventEdit.py b/src/EventEdit.py index e1d9224bd..3a2a73a3b 100644 --- a/src/EventEdit.py +++ b/src/EventEdit.py @@ -261,8 +261,7 @@ class EventEditor(DisplayState.ManagedWindow): Utils.bold_label(self.general_label) - self.window.set_transient_for(self.parent_window) - self.window.show() + self.show() def build_menu_names(self,event): if event: @@ -556,8 +555,7 @@ class EventRefEditor(DisplayState.ManagedWindow): if self.event.get_media_list(): Utils.bold_label(self.gallery_label) - self.window.set_transient_for(self.parent_window) - self.window.show() + self.show() def build_menu_names(self,eventref): if self.event: