'Saves the config changes to the plugins.
:param widg: the widget who generated the signal
First it checks if there\'s some invalid configuration, then gets the value of
each option and save them to the plugin.'

def _save_panel(self, widg):

    invalid = []
    for (section, optList) in self.options.items():
        for opt in optList:
            if hasattr(opt.widg, 'is_valid'):
                if (not opt.widg.is_valid()):
                    invalid.append(opt.get_name())
    if invalid:
        msg = _("The    configuration    can't    be    saved,    there    is    a    problem    in    the    following    parameter(s):\n\n")
        msg += '\n-'.join(invalid)
        dlg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, msg)
        dlg.set_title(_('Configuration    error'))
        dlg.run()
        dlg.destroy()
        return
    for (section, optList) in self.options.items():
        for opt in optList:
            opt.set_value(opt.widg.get_value())
    for (section, optList) in self.options.items():
        for opt in optList:
            opt.widg.save()
    self.w3af.mainwin.sb(_('Configuration    saved    successfully'))
    self.parentWidg.reload_options()
