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
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 27

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

Instance Method Details

#handleObject


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

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

  nil
end

#initObject


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

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

#labelObject


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

def label
  _("Ad&d")
end