Class: Y2Network::Widgets::WirelessBitRate

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

Overview

bit rate selection widget

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ WirelessBitRate


59
60
61
62
63
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 59

def initialize(settings)
  @settings = settings

  textdomain "network"
end

Instance Method Details

#initObject


73
74
75
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 73

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

#itemsObject


81
82
83
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 81

def items
  bitrates.map { |b| [b.to_s, b.to_s] }.prepend(["", _("Automatic")])
end

#labelObject


69
70
71
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 69

def label
  _("B&it Rate")
end

#optObject


65
66
67
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 65

def opt
  [:hstretch, :editable]
end

#storeObject


77
78
79
# File 'src/lib/y2network/widgets/wireless_expert.rb', line 77

def store
  @settings.bitrate = value.empty? ? nil : value.to_f
end