'Refresh context menu'

def refresh_menu(self):

    index = self.currentIndex()
    condition = index.isValid()
    self.edit_action.setEnabled(condition)
    self.remove_action.setEnabled(condition)
    self.refresh_plot_entries(index)
