'Perform actions before parent main window is closed'

def closing_plugin(self, cancelable=False):

    self.findinfiles.closing_widget()
    options = self.findinfiles.find_options.get_options(all=True)
    if (options is not None):
        (search_text, text_re, search_path, exclude, exclude_idx, exclude_re, in_python_path, more_options) = options
        hist_limit = 15
        search_text = search_text[:hist_limit]
        search_path = search_path[:hist_limit]
        exclude = exclude[:hist_limit]
        self.set_option('search_text', search_text)
        self.set_option('search_text_regexp', text_re)
        self.set_option('search_path', search_path)
        self.set_option('exclude', exclude)
        self.set_option('exclude_idx', exclude_idx)
        self.set_option('exclude_regexp', exclude_re)
        self.set_option('in_python_path', in_python_path)
        self.set_option('more_options', more_options)
    return True
