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.



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

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

Instance Method Details

#handleObject



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

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



73
74
75
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 73

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

#labelObject



59
60
61
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 59

def label
  _("&Edit")
end