Class: Y2Network::Widgets::Devices
- Inherits:
-
CWM::ComboBox
- Object
- CWM::ComboBox
- Y2Network::Widgets::Devices
- Defined in:
- src/lib/y2network/widgets/devices.rb
Instance Method Summary collapse
- #help ⇒ Object
- #init ⇒ Object
-
#initialize(route, available_devices) ⇒ Devices
constructor
A new instance of Devices.
- #items ⇒ Object
- #label ⇒ Object
- #opt ⇒ Object
- #store ⇒ Object
Constructor Details
#initialize(route, available_devices) ⇒ Devices
Returns a new instance of Devices.
27 28 29 30 31 32 33 |
# File 'src/lib/y2network/widgets/devices.rb', line 27 def initialize(route, available_devices) super() textdomain "network" @devices = available_devices @route = route end |
Instance Method Details
#help ⇒ Object
39 40 41 42 43 44 |
# File 'src/lib/y2network/widgets/devices.rb', line 39 def help _( "<p><b>Device</b> specifies the device through which the traffic" \ " to the defined network will be routed.</p>" ) end |
#init ⇒ Object
55 56 57 58 |
# File 'src/lib/y2network/widgets/devices.rb', line 55 def init interface = @route.interface self.value = interface ? interface.name : "" end |
#items ⇒ Object
46 47 48 49 |
# File 'src/lib/y2network/widgets/devices.rb', line 46 def items # TODO: maybe some translated names? @devices.map { |d| [d, d] } end |
#label ⇒ Object
35 36 37 |
# File 'src/lib/y2network/widgets/devices.rb', line 35 def label _("De&vice") end |
#opt ⇒ Object
51 52 53 |
# File 'src/lib/y2network/widgets/devices.rb', line 51 def opt [:hstretch, :editable] end |