41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# File 'src/lib/y2network/widgets/delete_interface.rb', line 41
def handle
config = Yast::Lan.yast_config
connection_config = config.connections.by_name(@table.value)
return nil unless connection_config
if connection_config.startmode.name == "nfsroot"
if !Yast::.YesNoHeadline(
Yast::Label.WarningMsg,
_("Device you select has STARTMODE=nfsroot. Really delete?")
)
return nil
end
end
others = all_modify(config, connection_config)
if !others.empty?
delete, modify = others.partition { |c| c.type.vlan? }
message = format(_("Device you select has been used in other devices.<br>" \
"When deleted these devices will be modified<ul>%s</ul><br>" \
"and these devices deleted: <ul>%s</ul><br>" \
"Really delete?"),
modify.map { |m| "<li>#{m.name}</li>" }.join("\n"),
delete.map { |m| "<li>#{m.name}</li>" }.join("\n"))
if Yast2::.show(message, richtext: :yes, buttons: :yes_no, headline: :warning) == :no
return nil
end
end
config.delete_interface(@table.value)
:redraw
end
|