Class: Y2Network::Widgets::AddRoute

Inherits:
CWM::PushButton
  • Object
show all
Defined in:
src/lib/y2network/widgets/routing_buttons.rb

Instance Method Summary collapse

Constructor Details

#initialize(table, config) ⇒ AddRoute

Returns a new instance of AddRoute.



27
28
29
30
31
32
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 27

def initialize(table, config)
  super()
  @table = table
  @config = config
  textdomain "network"
end

Instance Method Details

#handleObject



38
39
40
41
42
43
44
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 38

def handle
  route = Y2Network::Route.new
  res = Y2Network::Dialogs::Route.run(route, @config.interfaces)
  @table.add_route(route) if res == :ok

  nil
end

#initObject



46
47
48
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 46

def init
  disable if @config.backend?(:network_manager)
end

#labelObject



34
35
36
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 34

def label
  _("Ad&d")
end