'Convenience method to easily add actions to a QMenu.
Returns the created QAction. This action has one extra attribute
calibre_shortcut_unique_name which if not None refers to the unique
name under which this action is registered with the keyboard manager.
:param menu: The QMenu the newly created action will be added to
:param unique_name: A unique name for this action, this must be
globally unique, so make it as descriptive as possible. If in doubt add
a uuid to it.
:param text: The text of the action.
:param icon: Either a QIcon or a file name. The file name is passed to
the I() builtin, so you do not need to pass the full path to the images
directory.
:param shortcut: A string, a list of strings, None or False. If False,
no keyboard shortcut is registered for this action. If None, a keyboard
shortcut with no default keybinding is registered. String and list of
strings register a shortcut with default keybinding as specified.
:param description: A description for this action. Used to set
tooltips.
:param triggered: A callable which is connected to the triggered signal
of the created action.
:param shortcut_name: The text displayed to the user when customizing
the keyboard shortcuts for this action. By default it is set to the
value of ``text``.'

def create_menu_action(self, menu, unique_name, text, icon=None, shortcut=None, description=None, triggered=None, shortcut_name=None):

    if (shortcut_name is None):
        shortcut_name = unicode(text)
    ac = menu.addAction(text)
    if (icon is not None):
        if (not isinstance(icon, QIcon)):
            icon = QIcon(I(icon))
        ac.setIcon(icon)
    keys = ()
    if ((shortcut is not None) and (shortcut is not False)):
        keys = ((shortcut,) if isinstance(shortcut, basestring) else tuple(shortcut))
    unique_name = menu_action_unique_name(self, unique_name)
    if (description is not None):
        ac.setToolTip(description)
        ac.setStatusTip(description)
        ac.setWhatsThis(description)
    ac.calibre_shortcut_unique_name = unique_name
    if (shortcut is not False):
        self.gui.keyboard.register_shortcut(unique_name, shortcut_name, default_keys=keys, action=ac, description=description, group=self.action_spec[0])
        self.gui.addAction(ac)
    if (triggered is not None):
        ac.triggered.connect(triggered)
    return ac
