'Handle the legacy sr* options that may have been previously saved. They
are applied only if the new search_replace option has not been set in
recs.'

def apply_recommendations(self, recs):

    new_val = None
    legacy = {}
    rest = {}
    for (name, val) in recs.items():
        if (name == 'search_replace'):
            new_val = val
            if (name in getattr(recs, 'disabled_options', [])):
                self.search_replace.setDisabled(True)
        elif name.startswith('sr'):
            legacy[name] = (val if val else '')
        else:
            rest[name] = val
    if rest:
        super(SearchAndReplaceWidget, self).apply_recommendations(rest)
    self.set_value(self.opt_search_replace, None)
    if ((new_val is None) and legacy):
        for i in range(1, 4):
            x = ('sr%d' % i)
            (s, r) = ((x + '_search'), (x + '_replace'))
            (s, r) = (legacy.get(s, ''), legacy.get(r, ''))
            if s:
                self.sr_add_row(s, r)
    if (new_val is not None):
        self.set_value(self.opt_search_replace, new_val)
