Class: Y2Network::Widgets::WirelessChannel

Inherits:
CWM::ComboBox
  • Object
show all
Defined in:
src/lib/y2network/widgets/wireless_expert.rb

Overview

Channel selector widget

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ WirelessChannel


27
28
29
30
31
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 27

def initialize(settings)
  @settings = settings

  textdomain "network"
end

Instance Method Details

#initObject


33
34
35
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 33

def init
  self.value = @settings.channel.to_s
end

#itemsObject


49
50
51
52
53
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 49

def items
  # FIXME: different protocol has different number of channels, we need to reflect it somehow
  # 1..14 is number of channels available in legal range for wireless
  1.upto(14).map { |c| [c.to_s, c.to_s] }.prepend(["", _("Automatic")])
end

#labelObject


41
42
43
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 41

def label
  _("&Channel")
end

#optObject


45
46
47
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 45

def opt
  [:hstretch]
end

#storeObject


37
38
39
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 37

def store
  @settings.channel = value.empty? ? nil : value.to_i
end