Class: Y2Network::Widgets::RenamingMechanism
- Inherits:
-
CWM::CustomWidget
- Object
- CWM::CustomWidget
- Y2Network::Widgets::RenamingMechanism
- 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
-
#result ⇒ Symbol
readonly
Renaming mechanism.
Instance Method Summary collapse
- #contents ⇒ Object
- #init ⇒ Object
-
#initialize(builder) ⇒ RenamingMechanism
constructor
Constructor.
- #store ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(builder) ⇒ RenamingMechanism
Constructor
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
#result ⇒ Symbol (readonly)
Returns Renaming mechanism.
30 31 32 |
# File 'src/lib/y2network/widgets/renaming_mechanism.rb', line 30 def result @result end |
Instance Method Details
#contents ⇒ Object
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), * ) ) ) end |
#init ⇒ Object
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 |
#store ⇒ Object
52 53 54 |
# File 'src/lib/y2network/widgets/renaming_mechanism.rb', line 52 def store @builder.renaming_mechanism = value end |
#value ⇒ Object
72 73 74 |
# File 'src/lib/y2network/widgets/renaming_mechanism.rb', line 72 def value Yast::UI.QueryWidget(Id(:udev_type), :Value) end |