'Add actions to IPython widget context menu'

def add_actions_to_context_menu(self, menu):

    inspect_action = create_action(self, _('Inspect    current    object'), QKeySequence(get_shortcut('console', 'inspect    current    object')), icon=ima.icon('MessageBoxInformation'), triggered=self.inspect_object)
    clear_line_action = create_action(self, _('Clear    line    or    block'), QKeySequence('Shift+Escape'), icon=ima.icon('editdelete'), triggered=self.clear_line)
    reset_namespace_action = create_action(self, _('Reset    namespace'), QKeySequence('Ctrl+Alt+R'), triggered=self.reset_namespace)
    clear_console_action = create_action(self, _('Clear    console'), QKeySequence(get_shortcut('console', 'clear    shell')), icon=ima.icon('editclear'), triggered=self.clear_console)
    quit_action = create_action(self, _('&Quit'), icon=ima.icon('exit'), triggered=self.exit_callback)
    add_actions(menu, (None, inspect_action, clear_line_action, clear_console_action, reset_namespace_action, None, quit_action))
    return menu
