Skip to content

Commit

Permalink
Made Routing#Write gui aware
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Jun 27, 2017
1 parent 4e2601c commit ca7768d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/modules/Routing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def Read

# Write routing settings and apply changes
# @return true if success
def Write
def Write(gui: false)
Builtins.y2milestone("Writing configuration")
if !Modified()
Builtins.y2milestone("No changes to routing -> nothing to write")
Expand All @@ -316,10 +316,12 @@ def Write

caption = _("Saving Routing Configuration")

Progress.New(caption, " ", Builtins.size(steps), steps, [], "")
if gui
Progress.New(caption, " ", Builtins.size(steps), steps, [], "")

# Progress stage 1/2
ProgressNextStage(_("Writing IP forwarding settings..."))
# Progress stage 1/2
ProgressNextStage(_("Writing IP forwarding settings..."))
end

WriteIPForwarding()

Expand All @@ -329,11 +331,11 @@ def Write
# so we let our caller do it together with other things

# Progress stage 2/2
ProgressNextStage(_("Writing routing settings..."))
ProgressNextStage(_("Writing routing settings...")) if gui

ret = write_routes(@Routes)

Progress.NextStage
Progress.NextStage if gui

ret
end
Expand Down

0 comments on commit ca7768d

Please sign in to comment.