Class: Y2Network::Widgets::UdevRules

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

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ UdevRules


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

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

Instance Method Details

#contentsObject


34
35
36
37
38
39
40
41
42
43
44
45
# File 'src/lib/y2network/widgets/udev_rules.rb', line 34

def contents
  Frame(
    _("Udev Rules"),
    HBox(
      InputField(Id(:udev_rules_name), Opt(:hstretch, :disabled), _("Device Name"), ""),
      VBox(
        VSpacing(),
        PushButton(Id(:udev_rules_change), _("Change"))
      )
    )
  )
end

#handleObject


51
52
53
54
55
56
57
58
# File 'src/lib/y2network/widgets/udev_rules.rb', line 51

def handle
  dialog = Y2Network::Dialogs::RenameInterface.new(@settings)
  ret = dialog.run
  return unless ret == :ok
  self.value = @settings.name

  nil
end

#helpObject


68
69
70
71
72
73
74
# File 'src/lib/y2network/widgets/udev_rules.rb', line 68

def help
  _(
    "<p><b>Udev Rules</b> are rules for the kernel device manager that allow\n" \
      "associating the MAC address or BusID of the network device with its name (for\n" \
      "example, eth1, wlan0 ) and assures a persistent device name upon reboot.\n"
  )
end

#initObject


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

def init
  self.value = @settings.name
end

#valueObject


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

def value
  Yast::UI.QueryWidget(Id(:udev_rules_name), :Value)
end

#value=(name) ⇒ Object


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

def value=(name)
  Yast::UI.ChangeWidget(Id(:udev_rules_name), :Value, name)
end