svn: r2910
This commit is contained in:
Alex Roitman 2004-02-25 03:20:53 +00:00
parent d6d21fa4b0
commit bbe933fd73
15 changed files with 97 additions and 57 deletions

View File

@ -168,17 +168,17 @@ class AddressEditor:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu()
self.parent.winsmenu.append(self.parent_menu_item)
self.winsmenu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Address Editor'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.parent_menu_item.destroy()
def present(self,obj):

View File

@ -171,17 +171,17 @@ class AttributeEditor:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu()
self.parent.winsmenu.append(self.parent_menu_item)
self.winsmenu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Attribute Editor'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.parent_menu_item.destroy()
def present(self,obj):

View File

@ -78,6 +78,7 @@ class ChooseParents:
"""
self.parent = parent
self.db = db
self.child_windows = {}
self.person = person
self.family = family
self.family_update = family_update
@ -102,9 +103,9 @@ class ChooseParents:
self.glade = gtk.glade.XML(const.gladeFile,"familyDialog","gramps")
self.top = self.glade.get_widget("familyDialog")
text = _("Choose the Parents of %s") % GrampsCfg.nameof(self.person)
self.title_text = _("Choose the Parents of %s") % GrampsCfg.nameof(self.person)
Utils.set_titles(self.top,self.glade.get_widget('title'),
text,_('Choose Parents'))
self.title_text,_('Choose Parents'))
self.mother_rel = self.glade.get_widget("mrel")
self.father_rel = self.glade.get_widget("frel")
@ -149,14 +150,52 @@ class ChooseParents:
"on_prel_changed" : self.parent_relation_changed,
"on_showallf_toggled" : self.showallf_toggled,
"on_showallm_toggled" : self.showallm_toggled,
"destroy_passed_object" : Utils.destroy_passed_object,
"destroy_passed_object" : self.close,
"on_help_familyDialog_clicked" : self.on_help_clicked,
"on_familyDialog_delete_event" : self.on_delete_event,
})
self.add_itself_to_menu()
self.top.show()
def on_delete_event(self,obj,b):
self.close_child_windows()
self.remove_itself_from_menu()
def close(self,obj):
self.close_child_windows()
self.remove_itself_from_menu()
self.top.destroy()
def close_child_windows(self):
for child_window in self.child_windows.values():
child_window.close(None)
self.child_windows = {}
def add_itself_to_menu(self):
self.parent.child_windows[self] = self
self.win_menu_item = gtk.MenuItem(self.title_text)
self.win_menu_item.set_submenu(gtk.Menu())
self.win_menu_item.show()
self.parent.winsmenu.append(self.win_menu_item)
self.winsmenu = self.win_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Choose Parents'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self]
self.menu_item.destroy()
self.winsmenu.destroy()
self.win_menu_item.destroy()
def present(self,obj):
self.top.present()
def on_help_clicked(self,obj):
"""Display the relevant portion of GRAMPS manual"""
gnome.help_display('gramps-manual','gramps-edit-quick')
self.val = self.top.run()
def redrawf(self):
"""Redraws the potential father list"""
@ -460,11 +499,11 @@ class ChooseParents:
else:
self.family = None
Utils.destroy_passed_object(obj)
if self.family:
self.family.set_relationship(self.type)
self.change_family_type(self.family,mother_rel,father_rel)
self.family_update(None)
self.close(obj)
def add_new_parent(self,epo):
"""Adds a new person to either the father list or the mother list,
@ -502,7 +541,7 @@ class ChooseParents:
try:
import EditPerson
EditPerson.EditPerson(self.parent, person,self.db,self.add_new_parent)
EditPerson.EditPerson(self, person,self.db,self.add_new_parent)
except:
import DisplayTrace
DisplayTrace.DisplayTrace()

View File

@ -81,8 +81,8 @@ class EditPerson:
self.person = person
self.original_id = person.get_id()
self.parent = parent
if self.parent.wins_dict.has_key(self.original_id):
self.parent.wins_dict[self.original_id].present(None)
if self.parent.child_windows.has_key(self.original_id):
self.parent.child_windows[self.original_id].present(None)
return
self.db = db
self.callback = callback
@ -423,7 +423,7 @@ class EditPerson:
self.window.destroy()
def add_itself_to_winsmenu(self):
self.parent.wins_dict[self.original_id] = self
self.parent.child_windows[self.original_id] = self
win_menu_label = GrampsCfg.nameof(self.person)
if not win_menu_label.strip():
win_menu_label = _("New Person")
@ -431,16 +431,16 @@ class EditPerson:
self.win_menu_item.set_submenu(gtk.Menu())
self.win_menu_item.show()
self.parent.winsmenu.append(self.win_menu_item)
self.menu = self.win_menu_item.get_submenu()
self.winsmenu = self.win_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Edit Person'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_winsmenu(self):
del self.parent.wins_dict[self.original_id]
del self.parent.child_windows[self.original_id]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.win_menu_item.destroy()
def present(self,obj):
@ -1475,7 +1475,7 @@ class EditPerson:
if self.orig_birth == None:
self.db.add_event(self.birth)
self.person.set_birth_id(self.birth_id)
self.person.set_birth_id(self.birth.get_id())
elif not self.orig_birth.are_equal(self.birth):
self.db.commit_event(self.birth)

View File

@ -164,17 +164,17 @@ class EditSource:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu()
self.parent.winsmenu.append(self.parent_menu_item)
self.winsmenu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Source Editor'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.parent_menu_item.destroy()
def present(self,obj):

View File

@ -238,17 +238,17 @@ class EventEditor:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu()
self.parent.winsmenu.append(self.parent_menu_item)
self.winsmenu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Event Editor'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.parent_menu_item.destroy()
def present(self,obj):

View File

@ -772,17 +772,17 @@ class LocalMediaProperties:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show()
self.parent.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu()
self.parent.parent.winsmenu.append(self.parent_menu_item)
self.winsmenu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Reference Editor'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.parent.parent.child_windows[self.win_key]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.parent_menu_item.destroy()
def present(self,obj):

View File

@ -73,8 +73,8 @@ class Marriage:
"""Initializes the Marriage class, and displays the window"""
self.family = family
self.parent = parent
if self.parent.wins_dict.has_key(family.get_id()):
self.parent.wins_dict[family.get_id()].present(None)
if self.parent.child_windows.has_key(family.get_id()):
self.parent.child_windows[family.get_id()].present(None)
return
self.child_windows = {}
self.db = db
@ -271,7 +271,7 @@ class Marriage:
self.window.destroy()
def add_itself_to_winsmenu(self):
self.parent.wins_dict[self.family.get_id()] = self
self.parent.child_windows[self.family.get_id()] = self
win_menu_label = self.title
if not win_menu_label.strip():
win_menu_label = _("New Relationship")
@ -279,16 +279,16 @@ class Marriage:
self.win_menu_item.set_submenu(gtk.Menu())
self.win_menu_item.show()
self.parent.winsmenu.append(self.win_menu_item)
self.menu = self.win_menu_item.get_submenu()
self.winsmenu = self.win_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Marriage/Relationship Editor'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_winsmenu(self):
del self.parent.wins_dict[self.family.get_id()]
del self.parent.child_windows[self.family.get_id()]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.win_menu_item.destroy()
def present(self,obj):

View File

@ -162,17 +162,17 @@ class NameEditor:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu()
self.parent.winsmenu.append(self.parent_menu_item)
self.winsmenu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Name Editor'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.parent_menu_item.destroy()
def present(self,obj):

View File

@ -107,7 +107,7 @@ class NoteEditor:
self.parent_menu_item = gtk.MenuItem(_('Note'))
self.parent_menu_item.connect("activate",self.present)
self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item)
self.parent.winsmenu.append(self.parent_menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]

View File

@ -129,17 +129,17 @@ class SourceSelector:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu()
self.parent.winsmenu.append(self.parent_menu_item)
self.winsmenu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Reference Selector'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.parent_menu_item.destroy()
def present(self,obj):
@ -371,17 +371,17 @@ class SourceEditor:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.set_submenu(gtk.Menu())
self.parent_menu_item.show()
self.win_parent.menu.append(self.parent_menu_item)
self.menu = self.parent_menu_item.get_submenu()
self.win_parent.winsmenu.append(self.parent_menu_item)
self.winsmenu = self.parent_menu_item.get_submenu()
self.menu_item = gtk.MenuItem(_('Source Information'))
self.menu_item.connect("activate",self.present)
self.menu_item.show()
self.menu.append(self.menu_item)
self.winsmenu.append(self.menu_item)
def remove_itself_from_menu(self):
del self.win_parent.child_windows[self.win_key]
self.menu_item.destroy()
self.menu.destroy()
self.winsmenu.destroy()
self.parent_menu_item.destroy()
def present(self,obj):

View File

@ -102,7 +102,7 @@ class UrlEditor:
self.parent_menu_item = gtk.MenuItem(label)
self.parent_menu_item.connect("activate",self.present)
self.parent_menu_item.show()
self.parent.menu.append(self.parent_menu_item)
self.parent.winsmenu.append(self.parent_menu_item)
def remove_itself_from_menu(self):
self.parent.child_windows[self.win_key]

View File

@ -178,7 +178,7 @@ class WitnessEditor:
self.parent_menu_item = gtk.MenuItem(_('Witness Editor'))
self.parent_menu_item.connect("activate",self.present)
self.parent_menu_item.show()
self.parent.parent.menu.append(self.parent_menu_item)
self.parent.parent.winsmenu.append(self.parent_menu_item)
def remove_itself_from_menu(self):
self.parent.parent.child_windows[self.win_key]

View File

@ -4008,6 +4008,7 @@
<property name="destroy_with_parent">False</property>
<property name="icon">gramps.png</property>
<property name="has_separator">False</property>
<signal name="delete_event" handler="on_familyDialog_delete_event" last_modification_time="Wed, 25 Feb 2004 01:24:37 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox3">

View File

@ -267,7 +267,7 @@ class Gramps:
self.wins = self.gtop.get_widget("windows1")
self.wins.set_submenu(gtk.Menu())
self.winsmenu = self.wins.get_submenu()
self.wins_dict = {}
self.child_windows = {}
self.gtop.signal_autoconnect({
"on_back_clicked" : self.back_clicked,