Skip to content

Commit

Permalink
small refactoring in addon_selection_dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Aug 21, 2014
1 parent 74f8982 commit 02e6fd5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/registration/ui/addon_selection_dialog.rb
Expand Up @@ -203,18 +203,21 @@ def reactivate_dependencies

# check for the maximum amount of reg. codes supported by Yast
def supported_addon_count?
need_regcode = Addon.selected.reject(&:registered?).reject(&:free)
# maximum number or reg codes which can be displayed in two column layout
max_supported = 2*MAX_REGCODES_PER_COLUMN

# check the addons requiring a reg. code
if need_regcode.size > max_supported
if selected_non_free_addons.size > max_supported
Report.Error(_("YaST allows to select at most %s extensions or modules.") % max_supported)
return false
end

return true
end

def selected_non_free_addons
Addon.selected.reject(&:registered?).reject(&:free)
end
end
end
end
Expand Down

0 comments on commit 02e6fd5

Please sign in to comment.