Skip to content

Commit

Permalink
Merge pull request #115 from cwh42/addonlicense
Browse files Browse the repository at this point in the history
Fixed addon-license dialog (bnc#899892 & bnc#899891)
  • Loading branch information
cwh42 committed Mar 16, 2015
2 parents 3ddfb6b + cf78e9e commit 0190c1b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Mar 16 09:45:04 UTC 2015 - cwh@suse.com

- Added reponame to license's title (bnc#899892)
- Display correct license URL for add-on repositories (bnc#899891)
- 3.1.66

-------------------------------------------------------------------
Fri Mar 13 11:15:53 UTC 2015 - lslezak@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-packager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-packager
Version: 3.1.65
Version: 3.1.66
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
25 changes: 23 additions & 2 deletions src/modules/ProductLicense.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1144,15 +1144,27 @@ def AskLicenseAgreement(src_id, dir, patterns, action, enable_back, base_product
end

licenses_ref = arg_ref(licenses)
DisplayLicenseDialog(

label = Pkg::SourceGeneralData(src_id)["name"]
title = _("License Agreement")

if !label.empty?
# %s is an extension name, e.g. "SUSE Linux Enterprise Software Development Kit"
title = _("%s License Agreement") % label
end

DisplayLicenseDialogWithTitle(
available_langs, # license id
enable_back,
@lic_lang,
licenses_ref,
id
id,
title
)
licenses = licenses_ref.value

update_license_archive_location(src_id)

# Display info as a popup if exists
InstShowInfo.show_info_txt(@info_file) if @info_file != nil

Expand Down Expand Up @@ -1601,6 +1613,15 @@ def update_license_location(lang, licenses)
end
end

# update license location displayed in the dialog
# @param [Fixnum] src_id integer repository to get the license from.
def update_license_archive_location(src_id)
src_url = Pkg::SourceGeneralData(src_id)["url"]
if location_is_url?(src_url) && UI.WidgetExists(:printing_hint)
lic_url = File.join(src_url, @license_file_print)
UI.ReplaceWidget(:printing_hint, Label(license_download_label(lic_url)))
end
end
end

ProductLicense = ProductLicenseClass.new
Expand Down

0 comments on commit 0190c1b

Please sign in to comment.