'Constructor.'

def __init__(self, w3af):

    super(ProxiedRequests, self).__init__(w3af, 'proxytool', _('w3af    -    Proxy'), 'Using_the_Proxy', onDestroy=self._close)
    self.w3af = w3af
    self.def_padding = 5
    self._uimanager = gtk.UIManager()
    accelgroup = self._uimanager.get_accel_group()
    self.add_accel_group(accelgroup)
    actiongroup = gtk.ActionGroup('UIManager')
    actiongroup.add_actions([('Help', gtk.STOCK_HELP, _('_Help'), None, _('Help    regarding    this    window'), self.open_help), ('Drop', gtk.STOCK_CANCEL, _('_Drop    Request'), None, _('Drop    request'), self._drop), ('Send', gtk.STOCK_YES, _('_Send    Request'), None, _('Send    request'), self._send), ('Next', gtk.STOCK_GO_FORWARD, _('_Next    Request'), None, _('Move    to    the    next    request'), self._next)])
    actiongroup.add_toggle_actions([('TrapReq', gtk.STOCK_JUMP_TO, _('_Trap    Requests'), None, _('Trap    requests'), self._toggle_trap, False)])
    self._uimanager.insert_action_group(actiongroup, 0)
    self._uimanager.add_ui_from_string(ui_proxy_menu)
    toolbar = self._uimanager.get_widget('/Toolbar')
    self.bt_drop = toolbar.get_nth_item(2)
    self.bt_send = toolbar.get_nth_item(3)
    self.bt_next = toolbar.get_nth_item(4)
    self.bt_next.set_sensitive(False)
    self.bt_send.set_sensitive(False)
    self.bt_drop.set_sensitive(False)
    separat = toolbar.get_nth_item(5)
    separat.set_draw(False)
    separat.set_expand(True)
    self.vbox.pack_start(toolbar, False)
    self.vbox.show()
    toolbar.show()
    self._init_options()
    self._prev_ip_port = None
    self._layout = self.pref.get_value('proxy', 'trap_view')
    self.reqresp = ReqResViewer(w3af, [self.bt_drop.set_sensitive, self.bt_send.set_sensitive], editableRequest=True, layout=self._layout)
    self.reqresp.set_sensitive(False)
    vbox = gtk.VBox()
    vbox.pack_start(self.reqresp, True, True)
    vbox.show()
    self.nb = gtk.Notebook()
    tabs = []
    tmp = gtk.Label(_('_Intercept'))
    tmp.set_use_underline(True)
    self.nb.append_page(vbox, tmp)
    tabs.append('Intercept')
    self.httplog = httpLogTab.httpLogTab(w3af, time_refresh=True)
    tmp = gtk.Label(_('_History'))
    tmp.set_use_underline(True)
    self.nb.append_page(self.httplog, tmp)
    tabs.append('History')
    tmp = gtk.Label(_('_Options'))
    tmp.set_use_underline(True)
    self.nb.append_page(self.pref, tmp)
    tabs.append('Options')
    self.vbox.pack_start(self.nb, True, True, padding=self.def_padding)
    self.nb.show()
    self.nb.set_current_page(tabs.index(self.pref.get_value('proxy', 'home_tab')))
    self.status_bar = StatusBar()
    self.vbox.pack_start(self.status_bar, False, False)
    self.status_bar.show()
    self.proxy = None
    self.fuzzable = None
    self.waiting_requests = False
    self.keep_checking = False
    self.reload_options()
    gobject.timeout_add(200, self._supervise_requests)
    self.show()
