* src/DataViews/_RelationView.py: add right context menu

svn: r7531
This commit is contained in:
Don Allingham 2006-10-31 23:03:58 +00:00
parent 3d26ba7968
commit 83f416a7e3
2 changed files with 31 additions and 0 deletions

View File

@ -1,4 +1,5 @@
2006-10-31 Don Allingham <don@gramps-project.org> 2006-10-31 Don Allingham <don@gramps-project.org>
* src/DataViews/_RelationView.py: add right context menu
* src/DataViews/_PersonView.py: fix typo * src/DataViews/_PersonView.py: fix typo
* src/GrampsCfg.py: Fix check box message for adding a family * src/GrampsCfg.py: Fix check box message for adding a family
* src/Reorder.py: Allow for reordering of relationships, enhance * src/Reorder.py: Allow for reordering of relationships, enhance

View File

@ -726,6 +726,36 @@ class RelationshipView(PageView.PersonNavView):
def button_press(self, obj, event, handle): def button_press(self, obj, event, handle):
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
self.dbstate.change_active_handle(handle) self.dbstate.change_active_handle(handle)
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
myMenu = gtk.Menu()
myMenu.append(self.build_menu_item(handle))
myMenu.popup(None,None,None,0,0)
def build_menu_item(self, handle):
person = self.dbstate.db.get_person_from_handle(handle)
name = NameDisplay.displayer.display(person)
item = gtk.ImageMenuItem(None)
image = gtk.image_new_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_MENU)
image.show()
label = gtk.Label(name)
label.show()
label.set_alignment(0,0)
item.set_image(image)
item.add(label)
item.connect('activate',self.edit_menu, handle)
item.show()
return item
def edit_menu(self, obj, handle):
from Editors import EditPerson
person = self.dbstate.db.get_person_from_handle(handle)
try:
EditPerson(self.dbstate, self.uistate, [], person)
except Errors.WindowActiveError:
pass
def write_relationship(self, box, family): def write_relationship(self, box, family):
msg = _('Relationship type: %s') % str(family.get_relationship()) msg = _('Relationship type: %s') % str(family.get_relationship())