'Update edit menu'

def update_edit_menu(self):

    (widget, textedit_properties) = self.get_focus_widget_properties()
    if (textedit_properties is None):
        return
    (console, not_readonly, readwrite_editor) = textedit_properties
    if ((not console) and not_readonly and (not self.editor.is_file_opened())):
        return
    for child in self.edit_menu.actions():
        child.setEnabled(False)
    self.selectall_action.setEnabled(True)
    self.undo_action.setEnabled((readwrite_editor and widget.document().isUndoAvailable()))
    self.redo_action.setEnabled((readwrite_editor and widget.document().isRedoAvailable()))
    has_selection = widget.has_selected_text()
    self.copy_action.setEnabled(has_selection)
    self.cut_action.setEnabled((has_selection and not_readonly))
    self.paste_action.setEnabled(not_readonly)
    if ((not console) and not_readonly):
        for action in self.editor.edit_menu_actions:
            action.setEnabled(True)
