'Update search menu'

def update_search_menu(self):

    if self.menuBar().hasFocus():
        return
    (widget, textedit_properties) = self.get_focus_widget_properties()
    for action in self.editor.search_menu_actions:
        try:
            action.setEnabled(self.editor.isAncestorOf(widget))
        except RuntimeError:
            pass
    if (textedit_properties is None):
        return
    (_x, _y, readwrite_editor) = textedit_properties
    self.search_menu_actions[3].setEnabled(readwrite_editor)
