Author: locilka
Date: Mon Jan 11 13:59:06 2010
New Revision: 60305
URL: http://svn.opensuse.org/viewcvs/yast?rev=60305&view=rev
Log:
- Fixed switching license language in ProductLicense.
- Fixed disabled Next button while showing license with no
acceptance needed in ProductLicense.
- 2.17.67
Modified:
branches/SuSE-Code-11-SP1-Branch/packager/VERSION
branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes
branches/SuSE-Code-11-SP1-Branch/packager/src/modules/ProductLicense.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/VERSION?rev=60305&r1=60304&r2=60305&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/packager/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/packager/VERSION Mon Jan 11 13:59:06 2010
@@ -1 +1 @@
-2.17.66
+2.17.67
Modified: branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes?rev=60305&r1=60304&r2=60305&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes Mon Jan 11 13:59:06 2010
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Mon Jan 11 13:57:26 CET 2010 - locilka@suse.cz
+
+- Fixed switching license language in ProductLicense.
+- Fixed disabled Next button while showing license with no
+ acceptance needed in ProductLicense.
+- 2.17.67
+
+-------------------------------------------------------------------
Thu Jan 7 12:16:03 UTC 2010 - lslezak@suse.cz
- pass the selected CD/DVD device to the package manager in case
Modified: branches/SuSE-Code-11-SP1-Branch/packager/src/modules/ProductLicense.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/src/modules/ProductLicense.ycp?rev=60305&r1=60304&r2=60305&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/packager/src/modules/ProductLicense.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/packager/src/modules/ProductLicense.ycp Mon Jan 11 13:59:06 2010
@@ -45,6 +45,12 @@
list <string> license_ids = [];
/**
+ * License files by their eula_ID
+ * @struct $["ID":$[licenses]]
+ */
+map > all_licenses = $[];
+
+/**
* Checks the string that might contain ID of a license and
* eventually returns that id.
* See also GetIdPlease for a better ratio of successful stories.
@@ -52,8 +58,8 @@
string GetId (string id_text) {
string id = nil;
- if (regexpmatch (id_text, "^license_language_[[:digit:]]+")) {
- id = regexpsub (id_text, "^license_language_([[:digit:]]+)", "\\1");
+ if (regexpmatch (id_text, "^license_language_.+")) {
+ id = regexpsub (id_text, "^license_language_(.+)", "\\1");
} else {
y2error ("Cannot get ID from %1", id_text);
}
@@ -671,6 +677,10 @@
licenses = LicenseFiles (license_dir,
license_patterns);
+
+ // all other 'licenses' could be replaced by this one
+ all_licenses[id] = licenses;
+
if (info_file == nil && size (licenses) == 0)
return `auto;
@@ -776,6 +786,11 @@
// read the selected language
lic_lang = (string) UI::QueryWidget (`id (sformat ("license_language_%1", id)), `Value);
term rp_id = `id (sformat ("license_contents_rp_%1", id));
+
+ if (licenses == $[]) {
+ licenses = all_licenses[id]:$[];
+ }
+
if (UI::WidgetExists (rp_id)) {
UI::ReplaceWidget (rp_id, GetLicenseContent (lic_lang, licenses, id));
} else {
@@ -819,7 +834,7 @@
string eula_id = nil;
foreach (string one_license_id, license_ids, {
- if (AcceptanceNeeded (one_license_id))
+ if (AcceptanceNeeded (one_license_id) != true)
return;
eula_id = sformat ("eula_%1", one_license_id);
@@ -842,11 +857,10 @@
symbol HandleLicenseDialogRet (map & licenses, boolean base_product, string action) {
any ret = nil;
- while (true)
- {
+ while (true) {
ret = UI::UserInput();
- if (is (ret, string) && regexpmatch (tostring (ret), "^license_language_[[:digit:]]+$")) {
+ if (is (ret, string) && regexpmatch (tostring (ret), "^license_language_")) {
UpdateLicenseContent (licenses, GetId (tostring (ret)));
ret = `language;
// bugzilla #303828
@@ -854,10 +868,8 @@
} else if (is (ret, string) && (regexpmatch (tostring(ret), "^yes_") || regexpmatch (tostring(ret), "^no_"))) {
if (AllLicensesAcceptedOrDeclined())
Wizard::EnableNextButton();
- }
-
// Aborting the license dialog
- if (ret == `abort) {
+ } else if (ret == `abort) {
// bugzilla #218677
if (base_product) {
if (Popup::ConfirmAbort (`painless)) {
@@ -873,9 +885,7 @@
break;
}
}
- }
- else if (ret == `next)
- {
+ } else if (ret == `next) {
// License declined
if (AllLicensesAccepted() != true)
{
@@ -941,11 +951,11 @@
ret = `accepted;
break;
}
- }
- else if (ret == `back)
- {
+ } else if (ret == `back) {
ret = `back;
break;
+ } else {
+ y2error ("Unhandled input: %1", ret);
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org