2007-09-28 Gary Burton <gary.burton@zen.co.uk>

* src/DataViews/_RelationView.py:
	* src/Editors/_EditFamily.py:
	* src/GrampsWidgets.py:
	Allow enter to open iconbuttons that are not delete, issue #1159


svn: r9058
This commit is contained in:
Benny Malengier 2007-10-01 20:50:36 +00:00
parent 7a7d31bbbc
commit 6e4e4887a1
4 changed files with 20 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2007-09-28 Gary Burton <gary.burton@zen.co.uk>
* 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 <benny.malengier@gramps-project.org> 2007-10-01 Benny Malengier <benny.malengier@gramps-project.org>
* src/GrampsDbUtils/_ReadXML.py: read region tag in xml * src/GrampsDbUtils/_ReadXML.py: read region tag in xml
* src/GrampsDb/_GrampsDbWriteXML.py: output region tag in xml (=subsection of picture) * src/GrampsDb/_GrampsDbWriteXML.py: output region tag in xml (=subsection of picture)

View File

@ -89,6 +89,8 @@ _ADATA_START = _ALABEL_STOP
_ADATA_STOP = _ADATA_START+3 _ADATA_STOP = _ADATA_START+3
_SDATA_START = 2 _SDATA_START = 2
_SDATA_STOP = 4 _SDATA_STOP = 4
_RETURN = gtk.gdk.keyval_from_name("Return")
_KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter")
class AttachList: class AttachList:
@ -1139,7 +1141,8 @@ class RelationshipView(PageView.PersonNavView):
self.row += 1 self.row += 1
def edit_button_press(self, obj, event, handle): 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) self.edit_person(obj, handle)
def edit_person(self, obj, handle): def edit_person(self, obj, handle):
@ -1151,7 +1154,8 @@ class RelationshipView(PageView.PersonNavView):
pass pass
def edit_family(self, obj, event, handle): 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 from Editors import EditFamily
family = self.dbstate.db.get_family_from_handle(handle) family = self.dbstate.db.get_family_from_handle(handle)
try: try:
@ -1200,7 +1204,8 @@ class RelationshipView(PageView.PersonNavView):
self.edit_person(obj, phandle) self.edit_person(obj, phandle)
def select_family(self, obj, event, handle): 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 from Selectors import selector_factory
SelectFamily = selector_factory('Family') SelectFamily = selector_factory('Family')

View File

@ -70,6 +70,9 @@ import QuestionDialog
from Selectors import selector_factory from Selectors import selector_factory
SelectPerson = selector_factory('Person') SelectPerson = selector_factory('Person')
_RETURN = gtk.gdk.keyval_from_name("Return")
_KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter")
class ChildEmbedList(EmbeddedList): class ChildEmbedList(EmbeddedList):
""" """
The child embed list is specific to the Edit Family dialog, so it The child embed list is specific to the Edit Family dialog, so it
@ -724,7 +727,8 @@ class EditFamily(EditPrimary):
'select the existing family')) 'select the existing family'))
def edit_person(self,obj,event,handle): 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 from _EditPerson import EditPerson
try: try:
person = self.db.get_person_from_handle(handle) person = self.db.get_person_from_handle(handle)

View File

@ -176,6 +176,7 @@ class IconButton(gtk.Button):
if func: if func:
self.connect('button-press-event', func, handle) self.connect('button-press-event', func, handle)
self.connect('key-press-event', func, handle)
class WarnButton(gtk.Button): class WarnButton(gtk.Button):
def __init__(self): def __init__(self):