'Setup tab context menu before showing it'

def __setup_menu(self):

    self.menu.clear()
    if self.data:
        actions = self.menu_actions
    else:
        actions = (self.new_action, self.open_action)
        self.setFocus()
    add_actions(self.menu, (list(actions) + self.__get_split_actions()))
    self.close_action.setEnabled(self.is_closable)
