Class: Y2Network::Widgets::BondOptions

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

Constant Summary collapse

PRESET_ITEMS =
[
  ["mode=balance-rr miimon=100", "mode=balance-rr miimon=100"],
  ["mode=active-backup miimon=100", "mode=active-backup miimon=100"],
  ["mode=balance-xor miimon=100", "mode=balance-xor miimon=100"],
  ["mode=broadcast miimon=100", "mode=broadcast miimon=100"],
  ["mode=802.3ad miimon=100", "mode=802.3ad miimon=100"],
  ["mode=balance-tlb miimon=100", "mode=balance-tlb miimon=100"],
  ["mode=balance-alb miimon=100", "mode=balance-alb miimon=100"]
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ BondOptions

Returns a new instance of BondOptions.



25
26
27
28
29
# File 'src/lib/y2network/widgets/bond_options.rb', line 25

def initialize(settings)
  super()
  textdomain "network"
  @settings = settings
end

Instance Method Details

#helpObject



45
46
47
48
49
# File 'src/lib/y2network/widgets/bond_options.rb', line 45

def help
  _(
    "<p>Select the bond driver options and edit them if necessary. </p>"
  )
end

#initObject



59
60
61
# File 'src/lib/y2network/widgets/bond_options.rb', line 59

def init
  self.value = @settings.bond_options
end

#itemsObject



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

def items
  PRESET_ITEMS
end

#labelObject



51
52
53
# File 'src/lib/y2network/widgets/bond_options.rb', line 51

def label
  _("&Bond Driver Options")
end

#optObject



55
56
57
# File 'src/lib/y2network/widgets/bond_options.rb', line 55

def opt
  [:hstretch, :editable]
end

#storeObject



63
64
65
# File 'src/lib/y2network/widgets/bond_options.rb', line 63

def store
  @settings.bond_options = value
end