Class: Y2Network::Widgets::EditRoute

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

Instance Method Summary collapse

Constructor Details

#initialize(table, config) ⇒ EditRoute

Returns a new instance of EditRoute.


51
52
53
54
55
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 51

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

Instance Method Details

#handleObject


61
62
63
64
65
66
67
68
69
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 61

def handle
  return nil unless @table.selected_route

  route = @table.selected_route.dup
  res = Y2Network::Dialogs::Route.run(route, @config.interfaces)
  @table.replace_route(route) if res == :ok

  nil
end

#initObject


71
72
73
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 71

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

#labelObject


57
58
59
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 57

def label
  _("&Edit")
end