Class: Y2Network::Dialogs::Route

Inherits:
CWM::Popup
  • Object
show all
Defined in:
src/lib/y2network/dialogs/route.rb

Overview

Dialog to create or edit route.

Instance Method Summary collapse

Constructor Details

#initialize(route, available_devices) ⇒ Route

Returns a new instance of Route.

Parameters:



37
38
39
40
41
42
43
# File 'src/lib/y2network/dialogs/route.rb', line 37

def initialize(route, available_devices)
  super()
  log.info "route dialog with route: #{route.inspect} " \
           "and devices #{available_devices.inspect}"
  @route = route
  @available_devices = available_devices
end

Instance Method Details

#contentsObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'src/lib/y2network/dialogs/route.rb', line 45

def contents
  devices = @available_devices.map(&:name) + [""]
  MinWidth(
    60,
    VBox(
      HBox(
        HWeight(100, Widgets::Destination.new(@route))
      ),
      HBox(
        HWeight(70, Widgets::Gateway.new(@route)),
        HSpacing(1),
        HWeight(30, Widgets::Devices.new(@route, devices))
      ),
      Widgets::RouteOptions.new(@route)
    )
  )
end