'Switch between shortcut entry and Accept/Cancel shortcut mode.'

def toggle_state(self):

    self.edit_state = (not self.edit_state)
    if (not self.edit_state):
        self.text_new_sequence.setEnabled(False)
        if self.button_ok.isEnabled():
            self.button_ok.setFocus()
        else:
            self.button_cancel.setFocus()
    else:
        self.text_new_sequence.setEnabled(True)
        self.text_new_sequence.setFocus()
