'Refresh context menu'

def refresh_menu(self):

    data = self.model.get_data()
    index = self.currentIndex()
    condition = ((not isinstance(data, tuple)) and index.isValid() and (not self.readonly))
    self.edit_action.setEnabled(condition)
    self.remove_action.setEnabled(condition)
    self.insert_action.setEnabled((not self.readonly))
    self.refresh_plot_entries(index)
