Class: Y2Network::Widgets::BridgePorts
- Inherits:
-
CWM::MultiSelectionBox
- Object
- CWM::MultiSelectionBox
- Y2Network::Widgets::BridgePorts
- Includes:
- PortItems
- Defined in:
- src/lib/y2network/widgets/bridge_ports.rb
Instance Method Summary collapse
- #help ⇒ Object
-
#init ⇒ Object
Default function to init the value of port devices box for bridging.
-
#initialize(settings) ⇒ BridgePorts
constructor
A new instance of BridgePorts.
- #label ⇒ Object
-
#store ⇒ Object
Default function to store the value of port devices box.
-
#validate ⇒ Object
Validates created bridge.
Methods included from PortItems
#physical_port_id, #physical_port_id?, #port_items_from
Constructor Details
#initialize(settings) ⇒ BridgePorts
Returns a new instance of BridgePorts.
35 36 37 38 |
# File 'src/lib/y2network/widgets/bridge_ports.rb', line 35 def initialize(settings) textdomain "network" @settings = settings end |
Instance Method Details
#help ⇒ Object
44 45 46 47 |
# File 'src/lib/y2network/widgets/bridge_ports.rb', line 44 def help # TODO: write it "" end |
#init ⇒ Object
Default function to init the value of port devices box for bridging.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'src/lib/y2network/widgets/bridge_ports.rb', line 50 def init br_ports = @settings.ports items = port_items_from( @settings.bridgeable_interfaces.map(&:name), br_ports, Yast::Lan.yast_config # ideally get it from builder? ) # it is list of Items, so cannot use `change_items` helper Yast::UI.ChangeWidget(Id(), :Items, items) end |
#label ⇒ Object
40 41 42 |
# File 'src/lib/y2network/widgets/bridge_ports.rb', line 40 def label _("Bridged Devices") end |
#store ⇒ Object
Default function to store the value of port devices box.
63 64 65 |
# File 'src/lib/y2network/widgets/bridge_ports.rb', line 63 def store @settings.ports = value end |
#validate ⇒ Object
Validates created bridge. Currently just prevent the user to create a bridge with already configured interfaces
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'src/lib/y2network/widgets/bridge_ports.rb', line 71 def validate if @settings.require_adaptation?(value || []) Yast::Popup.ContinueCancel( _( "At least one selected device is already configured.\n" \ "Adapt the configuration for bridge?\n" ) ) else true end end |