Author: jsuchome Date: Mon Jun 18 10:35:05 2007 New Revision: 38495 URL: http://svn.opensuse.org/viewcvs/yast?rev=38495&view=rev Log: - Authentication dialog: lazy checking if packages are available saves some time (#273013) - 2.15.32 Modified: trunk/users/VERSION trunk/users/package/yast2-users.changes trunk/users/src/dialogs.ycp Modified: trunk/users/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/VERSION?rev=38495&r1=38494&r2=38495&view=diff ============================================================================== --- trunk/users/VERSION (original) +++ trunk/users/VERSION Mon Jun 18 10:35:05 2007 @@ -1 +1 @@ -2.15.31 +2.15.32 Modified: trunk/users/package/yast2-users.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/package/yast2-users.changes?rev=38495&r1=38494&r2=38495&view=diff ============================================================================== --- trunk/users/package/yast2-users.changes (original) +++ trunk/users/package/yast2-users.changes Mon Jun 18 10:35:05 2007 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Jun 18 10:25:53 CEST 2007 - jsuchome@suse.cz + +- Authentication dialog: lazy checking if packages are available + saves some time (#273013) +- 2.15.32 + +------------------------------------------------------------------- Mon Jun 18 08:45:02 CEST 2007 - jsuchome@suse.cz - fix checking autologin status during second stage (#285017) Modified: trunk/users/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/src/dialogs.ycp?rev=38495&r1=38494&r2=38495&view=diff ============================================================================== --- trunk/users/src/dialogs.ycp (original) +++ trunk/users/src/dialogs.ycp Mon Jun 18 10:35:05 2007 @@ -2529,8 +2529,6 @@ define symbol AuthentizationDialog() { list<string> configurable = [ "nis", "ldap", "kerberos", "samba" ]; - - list<string> available = []; list<string> installed = []; list mb = []; @@ -2608,14 +2606,14 @@ } /** - * Reloads the configuration and updates the auth-widget contents + * Reloads the configuration for given client and creates updated summary widget contents * returns the summary value for richtext */ define string reload_config (list<string> clients) { string summary = ""; if (clients == nil || clients == []) - clients = (list<string>) union (available, installed); + clients = configurable; foreach (string client, clients, { summary = Summary::AddHeader (summary, sformat ( "%2</a></font>", @@ -2626,38 +2624,21 @@ } /** - * helper: check availability of authentication packages and - * update the RichText summary accordingly + * helper: check availability of authentication packages, + * update the RichText summary and menubutton labels accordingly */ define void check_packages () { - boolean check_available = true; // save if more Available calls should be done (bug #225484) - foreach (string client, configurable, { string package = sformat ("yast2-%1-client", client); - term client_item = `item (`id(client), to_string[client]:""); + term client_item = `item (`id(client), to_string[client]:client); if (Package::Installed (package)) { installed = add (installed, client); - mb = add (mb, client_item); - UI::ChangeWidget (`id(`summary), `Value, - (string) UI::QueryWidget (`id (`summary),`Value) + reload_config ([client])); - } - else if (check_available) - { - boolean avai = Package::Available (package); - if (avai == nil) - { - check_available = false; - } - else if (avai) - { - available = add (available, client); - mb = add (mb, client_item); - UI::ChangeWidget (`id(`summary), `Value, - (string)UI::QueryWidget (`id (`summary),`Value) + reload_config ([client])); - } } + mb = add (mb, client_item); + UI::ChangeWidget (`id(`summary), `Value, + (string) UI::QueryWidget (`id (`summary),`Value) + reload_config ([client])); }); } @@ -2689,6 +2670,9 @@ UI::ReplaceWidget (`id (`rpbutton), `MenuButton(`opt(`key_F4), _("&Configure..."), mb)); } + // save if no more Available calls should be done (bug #225484) + boolean check_available = true; + any button = nil; boolean changed = false; list param = []; @@ -2705,6 +2689,24 @@ if (!contains (installed, (string) button)) { string package = sformat ("yast2-%1-client", button); + if (check_available) + { + boolean avai = Package::Available (package); + if (avai == nil) + { + // package manager is probably not accessible -> no more checks + check_available = false; + } + if (avai != true) + { + // error popup, %1 is package name + Popup::Error (sformat (_("Package %1 is not available for installation."), + package)); + configurable = filter (string p, configurable, ``(p != button)); + UI::ChangeWidget (`id(`summary), `Value, reload_config ([])); + continue; + } + } if (Package::InstallAllMsg ([package], // popup label (%1 is package to install) sformat (_("Package %1 is not installed. -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org