svn: r5626
This commit is contained in:
Alex Roitman 2005-12-23 20:16:43 +00:00
parent 2ed1502dad
commit 30b54a33e9
4 changed files with 11 additions and 16 deletions

View File

@ -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):
"""

View File

@ -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)

View File

@ -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.

View File

@ -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: