convert KEY_PRESS

svn: r19951
This commit is contained in:
Benny Malengier 2012-07-05 03:15:26 +00:00
parent 5678f5df54
commit 2a6790d795
12 changed files with 13 additions and 12 deletions

View File

@ -1403,7 +1403,7 @@ class MultiTreeView(Gtk.TreeView):
self.defer_select = False
def key_press_event(self, widget, event):
if event.type == Gdk.KEY_PRESS:
if event.type == Gdk.EventType.KEY_PRESS:
if event.keyval == Gdk.KEY_Delete:
model, paths = self.get_selection().get_selected_rows()
# reverse, to delete from the end

View File

@ -205,7 +205,7 @@ class ButtonTab(GrampsTab):
Handles the return key being pressed on list. If the key is pressed,
the Edit button handler is called
"""
if event.type == Gdk.KEY_PRESS:
if event.type == Gdk.EventType.KEY_PRESS:
#print 'key pressed', event.keyval, event.get_state(), _ADD
if event.keyval in (_RETURN, _KP_ENTER):
try:

View File

@ -155,7 +155,7 @@ class GrampsTab(Gtk.VBox):
The inheriting object must contain a widget that connects at mimimum
to this method, eg an eventbox, tree, ...
"""
if event.type == Gdk.KEY_PRESS:
if event.type == Gdk.EventType.KEY_PRESS:
if event.keyval in (_LEFT,) and \
(event.get_state() & Gdk.ModifierType.MOD1_MASK):
self.prev_page()

View File

@ -322,7 +322,7 @@ class SurnameTab(EmbeddedList):
Here we make sure tab moves to next or previous value in row on TAB
"""
if not EmbeddedList.key_pressed(self, obj, event):
if event.type == Gdk.KEY_PRESS and event.keyval in (_TAB,):
if event.type == Gdk.EventType.KEY_PRESS and event.keyval in (_TAB,):
if not (event.get_state() & (Gdk.ModifierType.SHIFT_MASK |
Gdk.ModifierType.CONTROL_MASK)):
return self.next_cell()

View File

@ -208,7 +208,7 @@ class EditChildRef(EditSecondary):
def button_activated(event, mouse_button):
if (event.type == Gdk.EventType.BUTTON_PRESS and
event.button == mouse_button) or \
(event.type == Gdk.KEY_PRESS and
(event.type == Gdk.EventType.KEY_PRESS and
event.keyval in (_RETURN, _KP_ENTER)):
return True
else:

View File

@ -1094,7 +1094,7 @@ class EditFamily(EditPrimary):
def button_activated(event, mouse_button):
if (event.type == Gdk.EventType.BUTTON_PRESS and
event.button == mouse_button) or \
(event.type == Gdk.KEY_PRESS and
(event.type == Gdk.EventType.KEY_PRESS and
event.keyval in (_RETURN, _KP_ENTER)):
return True
else:

View File

@ -501,7 +501,7 @@ class NavigationView(PageView):
Handle the control+c (copy) and control+v (paste), or pass it on.
"""
if self.active:
if event.type == Gdk.KEY_PRESS:
if event.type == Gdk.EventType.KEY_PRESS:
if (event.keyval == Gdk.KEY_c and
(event.get_state() & Gdk.ModifierType.CONTROL_MASK)):
self.call_copy()

View File

@ -39,6 +39,7 @@ _LOG = logging.getLogger('.pageview')
#
#----------------------------------------------------------------
from gi.repository import Gtk
from gi.repository import Gdk
from gen.ggettext import gettext as _
#----------------------------------------------------------------
@ -214,7 +215,7 @@ class PageView(DbGUIElement):
(paste).
"""
if self.active:
if event.type == Gdk.KEY_PRESS:
if event.type == Gdk.EventType.KEY_PRESS:
if (event.keyval == Gdk.KEY_v and
(event.get_state() & Gdk.ModifierType.CONTROL_MASK)):
self.call_paste()

View File

@ -789,7 +789,7 @@ class GridGramplet(GuiGramplet):
"""
Edit the title, handle escape.
"""
if event.type == Gdk.KEY_PRESS:
if event.type == Gdk.EventType.KEY_PRESS:
if event.keyval == Gdk.KEY_Escape:
self.titlelabel.show()
widget.hide()

View File

@ -858,7 +858,7 @@ class MonitoredTagList(object):
Invoke the tag editor.
"""
if (event.type == Gdk.EventType.BUTTON_PRESS or
(event.type == Gdk.KEY_PRESS and
(event.type == Gdk.EventType.KEY_PRESS and
event.keyval in (_RETURN, _KP_ENTER))):
from gui.editors import EditTagList
editor = EditTagList(self.tag_list, self.all_tags,

View File

@ -43,7 +43,7 @@ class MultiTreeView(Gtk.TreeView):
self.defer_select = False
def key_press_event(self, widget, event):
if event.type == Gdk.KEY_PRESS:
if event.type == Gdk.EventType.KEY_PRESS:
if event.keyval == Gdk.KEY_Delete:
model, paths = self.get_selection().get_selected_rows()
# reverse, to delete from the end

View File

@ -1873,7 +1873,7 @@ def has_children(db,p):
def button_activated(event, mouse_button):
if (event.type == Gdk.EventType.BUTTON_PRESS and
event.button == mouse_button) or \
(event.type == Gdk.KEY_PRESS and
(event.type == Gdk.EventType.KEY_PRESS and
event.keyval in (_RETURN, _KP_ENTER, _SPACE)):
return True
else: