Class: Watobo::Gui::StatusBar

Inherits:
FXHorizontalFrame
  • Object
show all
Defined in:
lib/watobo/gui/status_bar.rb

Instance Method Summary collapse

Constructor Details

#initialize(owner, opts) ⇒ StatusBar

Returns a new instance of StatusBar.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/watobo/gui/status_bar.rb', line 68

def initialize(owner, opts)
  super(owner, opts)

  frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0)
  FXLabel.new(frame, "Status: ")
  @statusInfo = FXLabel.new(frame, "- no project started -")

  frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0)
  FXLabel.new(frame, "Project: ")
  @projectName = FXLabel.new(frame, " - ")

  frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0)
  FXLabel.new(frame, "Session: ")
  @sessionName = FXLabel.new(frame, " - ")
  
  frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0)

  #@bind_label = FXLabel.new(frame, "BindAddr: ")
  @bind_addr_label = FXLabel.new(frame, "Bind-Addr: - ")

  frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0)

  @port_label = FXLabel.new(frame, "Port: ")
  # @port_label.connect(SEL_RIGHTBUTTONPRESS) { switch_proxy_mode }
  @portNumber = FXLabel.new(frame, " - ")
  # @portNumber.connect(SEL_RIGHTBUTTONPRESS) { switch_proxy_mode }

  frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0)
  FXLabel.new(frame, "Forwarding Proxy: ")
  @forwardingProxy = FXLabel.new(frame, " - ")
end

Instance Method Details

#bindAddress=(bind_addr) ⇒ Object



64
65
66
# File 'lib/watobo/gui/status_bar.rb', line 64

def bindAddress=(bind_addr)
  @bind_addr_label.text = "Bind-Addr: #{bind_addr} "
end

#forwardingProxy=(forward_proxy) ⇒ Object



60
61
62
# File 'lib/watobo/gui/status_bar.rb', line 60

def forwardingProxy=(forward_proxy)
  @forwardingProxy.text = forward_proxy
end

#portNumber=(port_number) ⇒ Object



56
57
58
# File 'lib/watobo/gui/status_bar.rb', line 56

def portNumber=(port_number)
  @portNumber.text = port_number
end

#projectName=(project_name) ⇒ Object



48
49
50
# File 'lib/watobo/gui/status_bar.rb', line 48

def projectName=(project_name)
  @projectName.text = project_name
end

#sessionName=(session_name) ⇒ Object



52
53
54
# File 'lib/watobo/gui/status_bar.rb', line 52

def sessionName=(session_name)
  @sessionName.text = session_name
end

#setStatusInfo(prefs = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/watobo/gui/status_bar.rb', line 14

def setStatusInfo( prefs={} )
  cprefs = {
    :color => self.parent.backColor,
    :text => ''
  }

  cprefs.update prefs unless prefs.nil?

  @statusInfo.text = cprefs[:text]
  unless cprefs[:color].nil?
    @statusInfo.backColor = cprefs[:color]
  end
  

end

#statusInfoText=(new_text) ⇒ Object



43
44
45
46
# File 'lib/watobo/gui/status_bar.rb', line 43

def statusInfoText=( new_text )
  @statusInfo.text = new_text
  @statusInfo.backColor = self.parent.backColor
end

#update_proxy_modeObject



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/watobo/gui/status_bar.rb', line 30

def update_proxy_mode
 # puts "Update Proxy Mode ..."
  if Watobo::Conf::Interceptor.proxy_mode == Watobo::Interceptor::MODE_REGULAR
 #   puts "REGULAR MODE"
    @portNumber.backColor = @portNumber.parent.backColor
    @port_label.backColor = @port_label.parent.backColor
  else
 #   puts "TRANSPARENT MODE"
    @portNumber.backColor = FXColor::Red
    @port_label.backColor = FXColor::Red
  end
end