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
# File 'src/lib/y2network/widgets/renaming_mechanism.rb', line 35

def initialize(builder)
  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

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

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

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

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

#storeObject

See Also:

  • CWM::AbstractWidget#store

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

def store
  @builder.renaming_mechanism = value
end

#valueObject

See Also:

  • CWM::ValueBasedWidget#value

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

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