svn: r5626
This commit is contained in:
Alex Roitman 2005-12-23 20:16:43 +00:00
parent 0d7edcd59e
commit 1887e7cfa4
4 changed files with 11 additions and 16 deletions

View File

@ -384,13 +384,7 @@ class ManagedWindow:
""" """
window_key = self.build_window_key(obj) window_key = self.build_window_key(obj)
menu_label,submenu_label = self.build_menu_names(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]
if uistate.gwm.get_item_from_id(window_key): if uistate.gwm.get_item_from_id(window_key):
uistate.gwm.get_item_from_id(window_key).present() uistate.gwm.get_item_from_id(window_key).present()
@ -424,10 +418,14 @@ class ManagedWindow:
self.parent_window = self.uistate.window self.parent_window = self.uistate.window
def build_menu_names(self,obj): def build_menu_names(self,obj):
return None return ('Undefined Menu','Undefined Submenu')
def build_window_key(self,obj): 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): def close(self,obj=None,obj2=None):
""" """

View File

@ -448,7 +448,7 @@ class EditPerson(DisplayState.ManagedWindow):
widget = self.top.get_widget(i) widget = self.top.get_widget(i)
if widget: if widget:
widget.set_sensitive(not self.db.readonly) widget.set_sensitive(not self.db.readonly)
self.window.show() self.show()
def build_menu_names(self,person): def build_menu_names(self,person):
win_menu_label = self.nd.display(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.top_window.get_widget('ok').set_sensitive(not self.db.readonly)
self.window.set_transient_for(self.parent_window) self.show()
self.window.show()
self.model = None # This will hold the model for backreferences once it is complete. 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) Utils.bold_label(self.general_label)
self.window.set_transient_for(self.parent_window) self.show()
self.window.show()
def build_menu_names(self,event): def build_menu_names(self,event):
if event: if event:
@ -556,8 +555,7 @@ class EventRefEditor(DisplayState.ManagedWindow):
if self.event.get_media_list(): if self.event.get_media_list():
Utils.bold_label(self.gallery_label) Utils.bold_label(self.gallery_label)
self.window.set_transient_for(self.parent_window) self.show()
self.window.show()
def build_menu_names(self,eventref): def build_menu_names(self,eventref):
if self.event: if self.event: