Class: Y2Network::Widgets::EditInterface

Inherits:
InterfaceButton show all
Defined in:
src/lib/y2network/widgets/edit_interface.rb

Instance Method Summary collapse

Methods inherited from InterfaceButton

#config, #connection_config, #init, #item, #selected_interface

Constructor Details

#initialize(table) ⇒ EditInterface

Constructor

Parameters:



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

def initialize(table)
  textdomain "network"
  super(table)
end

Instance Method Details

#disable?Boolean

Returns:

  • (Boolean)


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

def disable?
  return true unless @table.value
  return true if config.interfaces.by_name(@table.value)&.firmware_configured?

  false
end

#handleObject



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'src/lib/y2network/widgets/edit_interface.rb', line 37

def handle
  builder = Y2Network::InterfaceConfigBuilder.for(item.type, config: connection_config)
  builder.name = item.name

  if item.is_a?(Y2Network::S390GroupDevice)
    builder.device_id = builder.name
    activation_dialog = Y2Network::Dialogs::S390DeviceActivation.for(builder)
    return :redraw if activation_dialog.run != :next
  end

  Y2Network::Sequences::Interface.new.public_send(:edit, builder)
  :redraw
end

#helpObject



58
59
60
61
62
63
64
65
# File 'src/lib/y2network/widgets/edit_interface.rb', line 58

def help
  # TRANSLATORS: Help for 'Edit' interface configuration button
  _(
    "<p><b><big>Configuring:</big></b><br>\n" \
    "Choose a network card to change.\n" \
    "Then press <b>Edit</b>.</p>\n"
  )
end

#labelObject



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

def label
  Yast::Label.EditButton
end