Class: Y2Network::Widgets::DeleteInterface
Instance Method Summary
collapse
#config, #connection_config, #init, #item, #selected_interface
Constructor Details
31
32
33
34
|
# File 'src/lib/y2network/widgets/delete_interface.rb', line 31
def initialize(table)
textdomain "network"
super(table)
end
|
Instance Method Details
#disable? ⇒ Boolean
69
70
71
72
73
74
|
# File 'src/lib/y2network/widgets/delete_interface.rb', line 69
def disable?
return true unless @table.value
return true unless connection_config
false
end
|
#handle ⇒ Object
40
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
|
# File 'src/lib/y2network/widgets/delete_interface.rb', line 40
def handle
return nil unless connection_config
if connection_config.startmode.name == "nfsroot" && !Yast::Popup.YesNoHeadline(
Yast::Label.WarningMsg,
_("Device you select has STARTMODE=nfsroot. Really delete?")
)
return nil
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::Popup.show(message, richtext: :yes, buttons: :yes_no, headline: :warning) == :no
return nil
end
end
config.delete_interface(@table.value)
:redraw
end
|
#help ⇒ Object
76
77
78
79
80
81
82
83
|
# File 'src/lib/y2network/widgets/delete_interface.rb', line 76
def help
_(
"<p><b><big>Deleting:</big></b><br>\n" \
"Choose a network card to remove.\n" \
"Then press <b>Delete</b>.</p>\n"
)
end
|
#label ⇒ Object
36
37
38
|
# File 'src/lib/y2network/widgets/delete_interface.rb', line 36
def label
Yast::Label.DeleteButton
end
|