svn: r2875
This commit is contained in:
Alex Roitman 2004-02-20 00:52:24 +00:00
parent 260a131828
commit aa9090e2c5
3 changed files with 66 additions and 66 deletions

View File

@ -83,7 +83,7 @@ class EditPerson:
self.parent = parent self.parent = parent
if self.parent.wins_dict.has_key(self.original_id): if self.parent.wins_dict.has_key(self.original_id):
self.parent.wins_dict[self.original_id].present(None) self.parent.wins_dict[self.original_id].present(None)
return return
self.db = db self.db = db
self.callback = callback self.callback = callback
self.child_windows = [] self.child_windows = []
@ -412,14 +412,15 @@ class EditPerson:
self.window.show() self.window.show()
def close_child_windows(self): def close_child_windows(self):
for child_window in self.child_windows: for child_window in self.child_windows:
child_window.close(None) child_window.close(None)
self.child_windows = []
def close(self,ok=0): def close(self,ok=0):
self.gallery.close(ok) self.gallery.close(ok)
self.close_child_windows() self.close_child_windows()
self.remove_itself_from_winsmenu() self.remove_itself_from_winsmenu()
self.window.destroy() self.window.destroy()
def add_itself_to_winsmenu(self): def add_itself_to_winsmenu(self):
self.parent.wins_dict[self.original_id] = self self.parent.wins_dict[self.original_id] = self
@ -427,11 +428,11 @@ class EditPerson:
if not win_menu_label.strip(): if not win_menu_label.strip():
win_menu_label = _("New Person") win_menu_label = _("New Person")
self.win_menu_item = gtk.MenuItem(win_menu_label) self.win_menu_item = gtk.MenuItem(win_menu_label)
self.win_menu_item.set_submenu(gtk.Menu()) self.win_menu_item.set_submenu(gtk.Menu())
self.win_menu_item.show() self.win_menu_item.show()
self.parent.winsmenu.append(self.win_menu_item) self.parent.winsmenu.append(self.win_menu_item)
self.menu = self.win_menu_item.get_submenu() self.menu = self.win_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Edit Person')) self.menu_item = gtk.MenuItem(_('Edit Person'))
self.menu_item.connect("activate",self.present) self.menu_item.connect("activate",self.present)
self.menu_item.show() self.menu_item.show()
self.menu.append(self.menu_item) self.menu.append(self.menu_item)
@ -439,8 +440,8 @@ class EditPerson:
def remove_itself_from_winsmenu(self): def remove_itself_from_winsmenu(self):
del self.parent.wins_dict[self.original_id] del self.parent.wins_dict[self.original_id]
self.menu_item.destroy() self.menu_item.destroy()
self.menu.destroy() self.menu.destroy()
self.win_menu_item.destroy() self.win_menu_item.destroy()
def present(self,obj): def present(self,obj):
self.window.present() self.window.present()
@ -1749,7 +1750,7 @@ class EditPerson:
child_date = sort.build_sort_date(bday) child_date = sort.build_sort_date(bday)
else: else:
continue continue
if (prev_date <= child_date): # <= allows for twins if (prev_date <= child_date): # <= allows for twins
prev_date = child_date prev_date = child_date
else: else:
inorder = 0 inorder = 0

View File

@ -116,56 +116,55 @@ class NameEditor:
self.type_field.entry.set_text(_(name.get_type())) self.type_field.entry.set_text(_(name.get_type()))
self.priv.set_active(name.get_privacy()) self.priv.set_active(name.get_privacy())
if name.get_note(): if name.get_note():
self.note_buffer.set_text(name.get_note()) self.note_buffer.set_text(name.get_note())
Utils.bold_label(self.notes_label) Utils.bold_label(self.notes_label)
if name.get_note_format() == 1: if name.get_note_format() == 1:
self.preform.set_active(1) self.preform.set_active(1)
else: else:
self.flowed.set_active(1) self.flowed.set_active(1)
if parent_window: if parent_window:
self.window.set_transient_for(parent_window) self.window.set_transient_for(parent_window)
self.parent.child_windows.append(self) self.parent.child_windows.append(self)
self.add_itself_to_menu() self.add_itself_to_menu()
self.window.show() self.window.show()
def on_delete_event(self,obj,b): def on_delete_event(self,obj,b):
self.close_child_windows() self.close_child_windows()
self.parent.child_windows.remove(self) self.remove_itself_from_menu()
self.remove_itself_from_menu()
def close(self,obj): def close(self,obj):
self.close_child_windows() self.close_child_windows()
self.parent.child_windows.remove(self) self.remove_itself_from_menu()
self.remove_itself_from_menu() self.window.destroy()
Utils.destroy_passed_object(self.window)
def close_child_windows(self): def close_child_windows(self):
for child_window in self.child_windows: for child_window in self.child_windows:
child_window.close(None) child_window.close(None)
self.child_windows = []
def add_itself_to_menu(self): def add_itself_to_menu(self):
if not self.name: if not self.name:
label = _("New Name") label = _("New Name")
else: else:
label = self.name.get_name() label = self.name.get_name()
if not label.strip(): if not label.strip():
label = _("New Name") label = _("New Name")
label = "%s: %s" % (_('Alternate Name'),label) label = "%s: %s" % (_('Alternate Name'),label)
self.parent_menu_item = gtk.MenuItem(label) self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu()) self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show() self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item) self.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu() self.menu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Name Editor')) self.menu_item = gtk.MenuItem(_('Name Editor'))
self.menu_item.connect("activate",self.present) self.menu_item.connect("activate",self.present)
self.menu_item.show() self.menu_item.show()
self.menu.append(self.menu_item) self.menu.append(self.menu_item)
def remove_itself_from_menu(self): def remove_itself_from_menu(self):
self.menu_item.destroy() self.menu_item.destroy()
self.menu.destroy() self.menu.destroy()
self.parent_menu_item.destroy() self.parent_menu_item.destroy()
def present(self,obj): def present(self,obj):
self.window.present() self.window.present()
@ -202,7 +201,7 @@ class NameEditor:
self.parent.lists_changed = 1 self.parent.lists_changed = 1
self.callback(self.name) self.callback(self.name)
Utils.destroy_passed_object(obj) self.close(obj)
def update_name(self,first,last,suffix,title,type,note,format,priv): def update_name(self,first,last,suffix,title,type,note,format,priv):

View File

@ -247,7 +247,7 @@ class SourceEditor:
self.parent = parent self.parent = parent
self.update = update self.update = update
self.source_ref = srcref self.source_ref = srcref
self.child_windows = [] self.child_windows = []
self.showSource = gtk.glade.XML(const.srcselFile, "sourceDisplay","gramps") self.showSource = gtk.glade.XML(const.srcselFile, "sourceDisplay","gramps")
self.sourceDisplay = self.get_widget("sourceDisplay") self.sourceDisplay = self.get_widget("sourceDisplay")
@ -287,49 +287,49 @@ class SourceEditor:
if self.parent: if self.parent:
self.sourceDisplay.set_transient_for(self.parent.window) self.sourceDisplay.set_transient_for(self.parent.window)
self.parent.parent.child_windows.append(self) self.parent.parent.child_windows.append(self)
self.add_itself_to_menu() self.add_itself_to_menu()
self.sourceDisplay.show() self.sourceDisplay.show()
def on_delete_event(self,obj,b): def on_delete_event(self,obj,b):
self.close_child_windows() self.close_child_windows()
self.parent.parent.child_windows.remove(self) self.parent.parent.child_windows.remove(self)
self.remove_itself_from_menu() self.remove_itself_from_menu()
def close(self,obj): def close(self,obj):
self.close_child_windows() self.close_child_windows()
self.parent.parent.child_windows.remove(self) self.remove_itself_from_menu()
self.remove_itself_from_menu() Utils.destroy_passed_object(self.sourceDisplay)
Utils.destroy_passed_object(self.sourceDisplay)
def close_child_windows(self): def close_child_windows(self):
for child_window in self.child_windows: for child_window in self.child_windows:
child_window.close() child_window.close()
self.child_windows = []
def add_itself_to_menu(self): def add_itself_to_menu(self):
if self.active_source: if self.active_source:
label = self.active_source.get_title() label = self.active_source.get_title()
else: else:
label = _("New Source") label = _("New Source")
if not label.strip(): if not label.strip():
label = _("New Source") label = _("New Source")
label = "%s: %s" % (_('Source Reference'),label) label = "%s: %s" % (_('Source Reference'),label)
self.parent_menu_item = gtk.MenuItem(label) self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu()) self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show() self.parent_menu_item.show()
self.parent.parent.menu.append(self.parent_menu_item) self.parent.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu() self.menu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Source Information')) self.menu_item = gtk.MenuItem(_('Source Information'))
self.menu_item.connect("activate",self.present) self.menu_item.connect("activate",self.present)
self.menu_item.show() self.menu_item.show()
self.menu.append(self.menu_item) self.menu.append(self.menu_item)
def remove_itself_from_menu(self): def remove_itself_from_menu(self):
self.menu_item.destroy() self.menu_item.destroy()
self.menu.destroy() self.menu.destroy()
self.parent_menu_item.destroy() self.parent_menu_item.destroy()
def present(self,obj): def present(self,obj):
self.window.present() self.sourceDisplay.present()
def on_help_clicked(self,obj): def on_help_clicked(self,obj):
"""Display the relevant portion of GRAMPS manual""" """Display the relevant portion of GRAMPS manual"""
@ -424,7 +424,7 @@ class SourceEditor:
self.update(self.parent,self.source_ref) self.update(self.parent,self.source_ref)
Utils.modified() Utils.modified()
self.close() self.close()
def on_source_changed(self,obj): def on_source_changed(self,obj):
sel = obj.list.get_selection() sel = obj.list.get_selection()