Skip to content

Commit

Permalink
reduce duplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Dec 3, 2014
1 parent aa6ac5c commit 732dba1
Showing 1 changed file with 18 additions and 28 deletions.
46 changes: 18 additions & 28 deletions src/lib/installation/proposal_runner.rb
Expand Up @@ -396,20 +396,7 @@ def make_proposal(force_reset, language_changed)

@html = {}
@store.proposal_names.each do |submod|
title = @store.title_for(submod)
if !Yast::Builtins.contains(@locked_modules, submod)
heading = title.include?("<a") ?
title :
Yast::HTML.Link(
title,
@store.id_for(submod)
)

# heading in proposal, in case the module doesn't create one
prop = Yast::HTML.Heading(heading)
else
prop = Yast::HTML.Heading(title)
end
prop = html_header(submod)
# BNC #463567
# Submod already called
if @submods_already_called.include?(submod)
Expand All @@ -431,20 +418,7 @@ def make_proposal(force_reset, language_changed)
make_proposal_callback = Proc.new do |submod, prop_map|
submodule_nr += 1
Yast::UI.ChangeWidget(Id("pb_ip"), :Value, submodule_nr)
title = @store.title_for(submod)
if !Yast::Builtins.contains(@locked_modules, submod)
heading = title.include?("<a") ?
title :
Yast::HTML.Link(
title,
@store.id_for(submod)
)

# heading in proposal, in case the module doesn't create one
prop = Yast::HTML.Heading(heading)
else
prop = Yast::HTML.Heading(title)
end
prop = html_header(submod)

# check if it is needed to switch to another tab
# because of an error
Expand Down Expand Up @@ -869,5 +843,21 @@ def SetNextButton

nil
end

def html_header(submod)
title = @store.title_for(submod)
if @locked_modules.include?(submod)
heading = title
else
heading = title.include?("<a") ?
title :
Yast::HTML.Link(
title,
@store.id_for(submod)
)
end

Yast::HTML.Heading(title)
end
end
end

0 comments on commit 732dba1

Please sign in to comment.