Skip to content

Commit

Permalink
remove unneeded test_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jun 30, 2016
1 parent c7cf9fb commit c3bd9e0
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions src/lib/installation/clients/inst_finish.rb
Expand Up @@ -23,6 +23,8 @@

module Yast
class InstFinishClient < Client
include Yast::Logger

def main
Yast.import "UI"
Yast.import "Pkg"
Expand Down Expand Up @@ -55,22 +57,11 @@ def main

# <-- Functions

@test_mode = false

if Ops.greater_than(Builtins.size(WFM.Args), 0) &&
Ops.is_string?(WFM.Args(0))
Builtins.y2milestone("Args: %1", WFM.Args)
@test_mode = true if WFM.Args(0) == "test"
end

Wizard.CreateDialog if @test_mode

Wizard.DisableBackButton
Wizard.DisableNextButton

# Adjust a SlideShow dialog if not configured
@get_setup = SlideShow.GetSetup
if @get_setup.nil? || @get_setup == {}
if [nil, {}].include?(SlideShow.GetSetup)
Builtins.y2milestone("No SlideShow setup has been set, adjusting")
SlideShow.Setup(
[
Expand All @@ -84,15 +75,14 @@ def main
]
)
end
@get_setup = nil

Wizard.SetTitleIcon("yast-sysconfig")

# Do not open a new SlideShow widget, reuse the old one instead
# variable used later to close that dialog (if needed)
@required_to_open_sl_dialog = !SlideShow.HaveSlideWidget
required_to_open_sl_dialog = !SlideShow.HaveSlideWidget

if @required_to_open_sl_dialog
if required_to_open_sl_dialog
Builtins.y2milestone("SlideShow dialog not yet created")
SlideShow.OpenDialog
end
Expand All @@ -102,10 +92,10 @@ def main

SlideShow.MoveToStage("finish")

@log = _("Creating list of finish scripts to call...")
log = _("Creating list of finish scripts to call...")
SlideShow.SubProgress(0, "")
SlideShow.StageProgress(0, @log)
SlideShow.AppendMessageToInstLog(@log)
SlideShow.StageProgress(0, log)
SlideShow.AppendMessageToInstLog(log)

# Used later in 'stages' definition
# Using empty callbacks that don't break the UI
Expand Down Expand Up @@ -252,21 +242,20 @@ def main
}
]

if Ops.greater_than(Builtins.size(ProductControl.inst_finish), 0)
Builtins.y2milestone(
"Using inst_finish steps definition from control file"
)
if !ProductControl.inst_finish.size
log.info "Using inst_finish steps definition from control file"
@stages = deep_copy(ProductControl.inst_finish)

# Inst-finish need to be translated (#343783)
@textdom = Ops.get_string(
textdom = Ops.get_string(
ProductControl.productControl,
"textdomain",
"control"
)

@stages_copy = deep_copy(@stages)

Builtins.y2milestone("Inst finish stages before: %1", @stages)
log.info "Inst finish stages before: #{@stages}"

@counter = -1
# going through copy, the original is going to be changed in the loop
Expand Down Expand Up @@ -485,7 +474,7 @@ def main
return :abort
end

if @required_to_open_sl_dialog
if required_to_open_sl_dialog
Builtins.y2milestone("Closing previously opened SlideShow dialog")
SlideShow.CloseDialog
end
Expand Down

0 comments on commit c3bd9e0

Please sign in to comment.