Class: Y2Network::Widgets::RenamingMechanism

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

Overview

This class allows the user to select which hardware information should be taken into account when renaming a device

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(builder) ⇒ RenamingMechanism

Constructor

Parameters:



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

def initialize(builder)
  super()
  textdomain "network"
  @builder = builder

  interface = builder.interface
  @hwinfo = interface.hardware
  @mac = @hwinfo.mac
  @bus_id = @hwinfo.busid
  @renaming_mechanism = builder.renaming_mechanism || :mac
end

Instance Attribute Details

#resultSymbol (readonly)

Returns Renaming mechanism.

Returns:

  • (Symbol)

    Renaming mechanism



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

def result
  @result
end

Instance Method Details

#contentsObject

See Also:

  • CWM::CustomWidget


58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'src/lib/y2network/widgets/renaming_mechanism.rb', line 58

def contents
  Frame(
    _("Base Udev Rule On"),
    RadioButtonGroup(
      Id(:udev_type),
      VBox(
        # make sure there is enough space (#367239)
        HSpacing(30),
        *radio_buttons
      )
    )
  )
end

#initObject

See Also:

  • CWM::AbstractWidget#init


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

def init
  Yast::UI.ChangeWidget(Id(:udev_type), :Value, @renaming_mechanism)
end

#storeObject

See Also:

  • CWM::AbstractWidget#store


53
54
55
# File 'src/lib/y2network/widgets/renaming_mechanism.rb', line 53

def store
  @builder.renaming_mechanism = value
end

#valueObject

See Also:

  • CWM::ValueBasedWidget#value


73
74
75
# File 'src/lib/y2network/widgets/renaming_mechanism.rb', line 73

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