Class: Y2Network::Widgets::KernelModule

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

Instance Method Summary collapse

Constructor Details

#initialize(names, selected) ⇒ KernelModule

Constructor


31
32
33
34
35
36
# File 'src/lib/y2network/widgets/kernel_module.rb', line 31

def initialize(names, selected)
  textdomain "network"
  @names = names
  @selected = selected
  self.widget_id = "kernel_module"
end

Instance Method Details

#helpObject


42
43
44
45
46
# File 'src/lib/y2network/widgets/kernel_module.rb', line 42

def help
  "<p><b>Kernel Module</b>. Enter the kernel module (driver) name \n" \
    "for your network device here. If the device is already configured, see if there is more than one driver available for\n" \
    "your device in the drop-down list. If necessary, choose a driver from the list, but usually the default value works.</p>\n"
end

#initObject


56
57
58
# File 'src/lib/y2network/widgets/kernel_module.rb', line 56

def init
  self.value = @selected if @selected
end

#itemsObject


52
53
54
# File 'src/lib/y2network/widgets/kernel_module.rb', line 52

def items
  @items ||= [["", _("Auto")]] + @names.map { |n| [n, n] }
end

#labelObject


38
39
40
# File 'src/lib/y2network/widgets/kernel_module.rb', line 38

def label
  _("&Module Name")
end

#optObject


48
49
50
# File 'src/lib/y2network/widgets/kernel_module.rb', line 48

def opt
  [:editable, :notify]
end

#valueObject


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

def value
  ret = super
  ret == "" ? :auto : ret
end