'Get the available context menu actions for a given DownloadItem.
Args:
item: The DownloadItem to get the actions for, or None.
Return:
A list of either:
- (QAction, callable) tuples.
- (None, None) for a separator'

def _get_menu_actions(self, item):

    model = self.model()
    actions = []
    if (item is None):
        pass
    elif item.done:
        if item.successful:
            actions.append(('Open', item.open_file))
        else:
            actions.append(('Retry', item.try_retry))
        actions.append(('Remove', item.remove))
    else:
        actions.append(('Cancel', item.cancel))
    if model.can_clear():
        actions.append((None, None))
        actions.append(('Remove    all    finished', model.download_clear))
    return actions
