Class: Watobo::Gui::InterceptorFilterSettingsDialog

Inherits:
FXDialogBox
  • Object
show all
Includes:
Responder
Defined in:
lib/watobo/gui/interceptor_gui.rb

Constant Summary

Constants included from Interceptor

Interceptor::INTERCEPT_BOTH, Interceptor::INTERCEPT_DEFAULT_PORT, Interceptor::INTERCEPT_NONE, Interceptor::INTERCEPT_REQUEST, Interceptor::INTERCEPT_RESPONSE, Interceptor::MODE_REGULAR, Interceptor::MODE_TRANSPARENT, Interceptor::REWRITE_BOTH, Interceptor::REWRITE_NONE, Interceptor::REWRITE_REQUEST, Interceptor::REWRITE_RESPONSE

Instance Method Summary collapse

Constructor Details

#initialize(owner, settings = {}) ⇒ InterceptorFilterSettingsDialog

Returns a new instance of InterceptorFilterSettingsDialog.



855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
# File 'lib/watobo/gui/interceptor_gui.rb', line 855

def initialize(owner, settings = {} )
  super(owner, "Interceptor Settings", DECOR_ALL, :width => 300, :height => 425)

  @request_filter = { }

  @response_filter = { }

  @request_filter.update settings[:request_filter_settings]
  @response_filter.update settings[:response_filter_settings]

  FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)

  base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
  @tabbook = FXTabBook.new(base_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT)
  buttons_frame = FXHorizontalFrame.new(base_frame, :opts => LAYOUT_FILL_X)
  @req_opt_tab = FXTabItem.new(@tabbook, "Request Options", nil)
  frame = FXVerticalFrame.new(@tabbook, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  scroll_window = FXScrollWindow.new(frame, SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  @req_opt_frame = FXVerticalFrame.new(scroll_window, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)

  @resp_opt_tab = FXTabItem.new(@tabbook, "Response Options", nil)
  frame= FXVerticalFrame.new(@tabbook, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  scroll_window = FXScrollWindow.new(frame, SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  @resp_opt_frame = FXVerticalFrame.new(scroll_window, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)

  initRequestFilterFrame()
  updateRequestFilterFrame()

  initResponseFilterFrame()
  updateResponseFilterFrame()

  @finishButton = FXButton.new(buttons_frame, "Accept" ,  nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
  @finishButton.enable
  @finishButton.connect(SEL_COMMAND) do |sender, sel, item|
  #self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
    self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
  end

  @cancelButton = FXButton.new(buttons_frame, "Cancel" ,
  :target => self, :selector => FXDialogBox::ID_CANCEL,
  :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
end

Instance Method Details

#getRequestFilterObject



847
848
849
# File 'lib/watobo/gui/interceptor_gui.rb', line 847

def getRequestFilter()
  @request_filter
end

#getResponseFilterObject



851
852
853
# File 'lib/watobo/gui/interceptor_gui.rb', line 851

def getResponseFilter()
  @response_filter
end