convert KEY_PRESS
svn: r19951
This commit is contained in:
parent
5678f5df54
commit
2a6790d795
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user