Revised undo/redo for different versions of gtk
svn: r15762
This commit is contained in:
parent
5ae9f75ded
commit
726da689c6
@ -389,17 +389,16 @@ class GuiGramplet(object):
|
|||||||
Handle formatting shortcuts.
|
Handle formatting shortcuts.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if ((gtk.gdk.keyval_name(event.keyval) == 'z') and
|
if ((gtk.gdk.keyval_name(event.keyval) == 'Z') and
|
||||||
(event.state & gtk.gdk.CONTROL_MASK) and
|
(event.state & gtk.gdk.CONTROL_MASK) and
|
||||||
(event.state & gtk.gdk.MOD2_MASK)):
|
(event.state & gtk.gdk.SHIFT_MASK)):
|
||||||
self.undo()
|
|
||||||
return True
|
|
||||||
elif ((gtk.gdk.keyval_name(event.keyval) == 'Z') and
|
|
||||||
(event.state & gtk.gdk.CONTROL_MASK) and
|
|
||||||
(event.state & gtk.gdk.MOD2_MASK) and
|
|
||||||
(event.state & gtk.gdk.SHIFT_MASK)):
|
|
||||||
self.redo()
|
self.redo()
|
||||||
return True
|
return True
|
||||||
|
elif ((gtk.gdk.keyval_name(event.keyval) == 'z') and
|
||||||
|
(event.state & gtk.gdk.CONTROL_MASK)):
|
||||||
|
self.undo()
|
||||||
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def edit_title(self, widget):
|
def edit_title(self, widget):
|
||||||
|
@ -240,17 +240,15 @@ class StyledTextEditor(gtk.TextView):
|
|||||||
Handle formatting shortcuts.
|
Handle formatting shortcuts.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if ((gtk.gdk.keyval_name(event.keyval) == 'z') and
|
if ((gtk.gdk.keyval_name(event.keyval) == 'Z') and
|
||||||
(event.state & gtk.gdk.CONTROL_MASK) and
|
(event.state & gtk.gdk.CONTROL_MASK) and
|
||||||
(event.state & gtk.gdk.MOD2_MASK)):
|
(event.state & gtk.gdk.SHIFT_MASK)):
|
||||||
self.undo()
|
|
||||||
return True
|
|
||||||
elif ((gtk.gdk.keyval_name(event.keyval) == 'Z') and
|
|
||||||
(event.state & gtk.gdk.CONTROL_MASK) and
|
|
||||||
(event.state & gtk.gdk.MOD2_MASK) and
|
|
||||||
(event.state & gtk.gdk.SHIFT_MASK)):
|
|
||||||
self.redo()
|
self.redo()
|
||||||
return True
|
return True
|
||||||
|
elif ((gtk.gdk.keyval_name(event.keyval) == 'z') and
|
||||||
|
(event.state & gtk.gdk.CONTROL_MASK)):
|
||||||
|
self.undo()
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
for accel, accel_name in self.action_accels.iteritems():
|
for accel, accel_name in self.action_accels.iteritems():
|
||||||
key, mod = gtk.accelerator_parse(accel)
|
key, mod = gtk.accelerator_parse(accel)
|
||||||
|
Loading…
Reference in New Issue
Block a user