Skip to content

Commit

Permalink
remove obsolete code concerning status toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
gabi2 committed Feb 16, 2016
1 parent 27ff66e commit c075ca7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
2 changes: 1 addition & 1 deletion src/include/iscsi-client/dialogs.rb
Expand Up @@ -156,7 +156,7 @@ def initialize_iscsi_client_dialogs(include_target)
),
Left(
HBox(
PushButton(Id(:add), _("Add")), # `PushButton(`id(`toggle), _("Toggle Start-Up"))
PushButton(Id(:add), _("Add")),
PushButton(Id(:edit), _("Edit")),
PushButton(Id(:del), _("Disconnect"))
)
Expand Down
35 changes: 0 additions & 35 deletions src/include/iscsi-client/widgets.rb
Expand Up @@ -230,41 +230,6 @@ def handleConnectedTable(key, event)
when :edit
record = setRecord
return :edit
when :toggle
# change manual/onboot status of connected target
# don't use automatic anymore (replaced by onboot) (bnc#449108)
record = setRecord
if Ops.greater_than(Builtins.size(record), 0)
Builtins.y2milestone("toggle record %1", record)
startup = IscsiClientLib.getStartupStatus
if Ops.greater_than(Builtins.size(startup), 0)
# toggle all 3 possible values (bnc#457252)
options = ["manual", "onboot", "automatic"]
pos = 0
Builtins.foreach(options) do |option|
if startup == option
startup = Ops.get(
options,
Ops.greater_than(Builtins.size(options), Ops.add(pos, 1)) ?
Ops.add(pos, 1) :
0,
""
)
Builtins.y2milestone(
"Changing state from %1 to %2",
option,
startup
)
IscsiClientLib.setStartupStatus(startup)
raise Break
end
pos = Ops.add(pos, 1)
end
initConnectedTable("")
end
else
Popup.Error(_("No record found."))
end
end
end
# if nothing selected - disable some buttons, otherwise enable them
Expand Down

0 comments on commit c075ca7

Please sign in to comment.