'Builds the advanced target widget.
Before building the widget we verify that the target set in the main
window is a valid target, this allows us to avoid some issues like
https://github.com/andresriancho/w3af/issues/2410'

def _advanced_target(self, widg):

    url = self.target.get_text()
    if (not self.target.validate()):
        msg = 'Invalid    target    URL:    "%s",    correct    this    value    to    open    the    advanced    target    configuration.'
        dlg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, (msg % url))
        dlg.run()
        dlg.destroy()
        return
    configurable_target = self.w3af.target
    confpanel.AdvancedTargetConfigDialog(_('Advanced    target    settings'), self.w3af, configurable_target, {'target': url})
    options = configurable_target.get_options()
    self.target.set_text_wrapper(options['target'].get_value_str())
