From 6e4e4887a1b88dc1174a7028e6b5a77d9e6dc2aa Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Mon, 1 Oct 2007 20:50:36 +0000 Subject: [PATCH] 2007-09-28 Gary Burton * src/DataViews/_RelationView.py: * src/Editors/_EditFamily.py: * src/GrampsWidgets.py: Allow enter to open iconbuttons that are not delete, issue #1159 svn: r9058 --- ChangeLog | 6 ++++++ src/DataViews/_RelationView.py | 11 ++++++++--- src/Editors/_EditFamily.py | 6 +++++- src/GrampsWidgets.py | 1 + 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93759ba8b..68f3462de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-09-28 Gary Burton + * src/DataViews/_RelationView.py: + * src/Editors/_EditFamily.py: + * src/GrampsWidgets.py: + Allow enter to open iconbuttons that are not delete, issue #1159 + 2007-10-01 Benny Malengier * src/GrampsDbUtils/_ReadXML.py: read region tag in xml * src/GrampsDb/_GrampsDbWriteXML.py: output region tag in xml (=subsection of picture) diff --git a/src/DataViews/_RelationView.py b/src/DataViews/_RelationView.py index fe3a64da3..b96d04fb2 100644 --- a/src/DataViews/_RelationView.py +++ b/src/DataViews/_RelationView.py @@ -89,6 +89,8 @@ _ADATA_START = _ALABEL_STOP _ADATA_STOP = _ADATA_START+3 _SDATA_START = 2 _SDATA_STOP = 4 +_RETURN = gtk.gdk.keyval_from_name("Return") +_KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter") class AttachList: @@ -1139,7 +1141,8 @@ class RelationshipView(PageView.PersonNavView): self.row += 1 def edit_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 \ + or event.keyval in (_RETURN, _KP_ENTER): self.edit_person(obj, handle) def edit_person(self, obj, handle): @@ -1151,7 +1154,8 @@ class RelationshipView(PageView.PersonNavView): pass def edit_family(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 \ + or event.keyval in (_RETURN, _KP_ENTER): from Editors import EditFamily family = self.dbstate.db.get_family_from_handle(handle) try: @@ -1200,7 +1204,8 @@ class RelationshipView(PageView.PersonNavView): self.edit_person(obj, phandle) def select_family(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 \ + or event.keyval in (_RETURN, _KP_ENTER): from Selectors import selector_factory SelectFamily = selector_factory('Family') diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index 7ff8c2bfa..f7ecead7e 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -70,6 +70,9 @@ import QuestionDialog from Selectors import selector_factory SelectPerson = selector_factory('Person') +_RETURN = gtk.gdk.keyval_from_name("Return") +_KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter") + class ChildEmbedList(EmbeddedList): """ The child embed list is specific to the Edit Family dialog, so it @@ -724,7 +727,8 @@ class EditFamily(EditPrimary): 'select the existing family')) def edit_person(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 \ + or event.keyval in (_RETURN, _KP_ENTER): from _EditPerson import EditPerson try: person = self.db.get_person_from_handle(handle) diff --git a/src/GrampsWidgets.py b/src/GrampsWidgets.py index a65d2b2e5..d2e6bf731 100644 --- a/src/GrampsWidgets.py +++ b/src/GrampsWidgets.py @@ -176,6 +176,7 @@ class IconButton(gtk.Button): if func: self.connect('button-press-event', func, handle) + self.connect('key-press-event', func, handle) class WarnButton(gtk.Button): def __init__(self):