diff options
author | Gary Martin <gary@garycmartin.com> | 2009-09-12 20:42:25 (GMT) |
---|---|---|
committer | Gary Martin <gary@garycmartin.com> | 2009-09-12 20:42:25 (GMT) |
commit | 35c6ff3ff091dfa37569b4d56705e0eb89f7b556 (patch) | |
tree | 8f12ed53ed44aa176aedd18933561b4aaffa8ba0 /toolbars.py | |
parent | 3247f183143bd3245a4a6028bc1165bda98b24a2 (diff) |
Wrapped key accelerator in try/except clause so Sugar 0.82 doesn't barf.
Diffstat (limited to 'toolbars.py')
-rw-r--r-- | toolbars.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/toolbars.py b/toolbars.py index 868b245..a208763 100644 --- a/toolbars.py +++ b/toolbars.py @@ -123,8 +123,13 @@ class EditToolbar(gtk.Toolbar): copy_tool.connect('clicked', lambda x: calc.text_copy()) self.insert(copy_tool, -1) - menu_item = MenuItem(_('Cut')) - menu_item.set_accelerator(_('<ctrl>x')) + menu_item = MenuItem(_('Cut')) + + try: + menu_item.set_accelerator(_('<ctrl>x')) + except AttributeError: + pass + menu_item.connect('activate', lambda x: calc.text_cut()) menu_item.show() copy_tool.get_palette().menu.append(menu_item) |