Class: Y2Network::Widgets::InterfaceType

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default: nil) ⇒ InterfaceType


29
30
31
32
33
# File 'src/lib/y2network/widgets/interface_type.rb', line 29

def initialize(default: nil)
  textdomain "network"
  # eth as default
  @default = default || "eth"
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result


28
29
30
# File 'src/lib/y2network/widgets/interface_type.rb', line 28

def result
  @result
end

Instance Method Details

#helpObject


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

def help
  # FIXME: help is not helpful
  _(
    "<p><b>Device Type</b>. Various device types are available, select \n" \
      "one according your needs.</p>"
  )
end

#initObject


47
48
49
# File 'src/lib/y2network/widgets/interface_type.rb', line 47

def init
  self.value = @default
end

#itemsObject


51
52
53
54
55
# File 'src/lib/y2network/widgets/interface_type.rb', line 51

def items
  Yast::NetworkInterfaces.GetDeviceTypes.map do |type|
    [type, Yast::NetworkInterfaces.GetDevTypeDescription(type, _long_desc = false)]
  end
end

#labelObject


35
36
37
# File 'src/lib/y2network/widgets/interface_type.rb', line 35

def label
  _("&Device Type")
end

#storeObject


57
58
59
# File 'src/lib/y2network/widgets/interface_type.rb', line 57

def store
  @result = value
end