'Uses the selected profile.'

def _use_profile(self, widget=None):

    profile_obj = self._get_profile()
    profile_name = self._get_profile_name()
    if (profile_name == self.selectedProfile):
        return
    self.selectedProfile = profile_name
    try:
        self.w3af.profiles.use_profile(profile_obj.get_profile_file())
    except BaseFrameworkException as w3:
        dlg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, str(w3))
        dlg.run()
        dlg.destroy()
        return
    profdesc = (None if (profile_obj is None) else profile_obj.get_desc())
    self.w3af.mainwin.pcbody.reload(profdesc)
    self.origActPlugins = self.w3af.mainwin.pcbody.get_activated_plugins()
    path = self.get_cursor()[0]
    newstatus = self._get_actionsSensitivity(path)
    self.w3af.mainwin.activate_profile_actions(newstatus)
