Class: Y2Network::Widgets::MTU

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

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ MTU


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

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

Instance Method Details

#default_itemsObject


38
39
40
41
42
43
44
45
# File 'src/lib/y2network/widgets/mtu.rb', line 38

def default_items
  [
    # translators: MTU value description (size in bytes, desc)
    ["1500", _("1500 (Ethernet, DSL broadband)")],
    ["1492", _("1492 (PPPoE broadband)")],
    ["576", _("576 (dial-up)")]
  ]
end

#initObject


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

def init
  change_items(items)
  self.value = @settings.mtu
end

#ipoib_itemsObject


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

def ipoib_items
  [
    # translators: MTU value description (size in bytes, desc)
    ["65520", _("65520 (IPoIB in connected mode)")],
    ["2044", _("2044 (IPoIB in datagram mode)")]
  ]
end

#itemsObject


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

def items
  @settings.type.infiniband? ? ipoib_items : default_items
end

#labelObject


30
31
32
# File 'src/lib/y2network/widgets/mtu.rb', line 30

def label
  _("Set &MTU")
end

#optObject


34
35
36
# File 'src/lib/y2network/widgets/mtu.rb', line 34

def opt
  [:hstretch, :editable]
end

#storeObject


64
65
66
# File 'src/lib/y2network/widgets/mtu.rb', line 64

def store
  @settings.mtu = value
end