Class: Y2Network::Widgets::EditRoute
- Inherits:
-
CWM::PushButton
- Object
- CWM::PushButton
- Y2Network::Widgets::EditRoute
- Defined in:
- src/lib/y2network/widgets/routing_buttons.rb
Instance Method Summary collapse
- #handle ⇒ Object
- #init ⇒ Object
-
#initialize(table, config) ⇒ EditRoute
constructor
A new instance of EditRoute.
- #label ⇒ Object
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
#handle ⇒ Object
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 |
#init ⇒ Object
71 72 73 |
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 71 def init disable if @config.backend?(:network_manager) end |
#label ⇒ Object
57 58 59 |
# File 'src/lib/y2network/widgets/routing_buttons.rb', line 57 def label _("&Edit") end |