Author: jsuchome
Date: Mon Sep 1 14:00:34 2008
New Revision: 50519
URL: http://svn.opensuse.org/viewcvs/yast?rev=50519&view=rev
Log:
fixed indentation, clean up whitespace
Modified:
trunk/nis-client/src/Nis.ycp
trunk/nis-client/src/ui.ycp
Modified: trunk/nis-client/src/Nis.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/nis-client/src/Nis.ycp?rev=50519&r1=50518&r2=50519&view=diff
==============================================================================
--- trunk/nis-client/src/Nis.ycp (original)
+++ trunk/nis-client/src/Nis.ycp Mon Sep 1 14:00:34 2008
@@ -73,7 +73,7 @@
/**
* @return Access the servers as a string
*/
- global define string GetServers () ``{
+ global string GetServers () {
return mergestring (servers, " ");
}
@@ -81,8 +81,8 @@
* Set the servers from a string
* @param servers_s a whitespace separated list
*/
- global define void SetServers (string servers_s) ``{
- servers = filter (string s, splitstring (servers_s, " \t"), ``(s != ""));
+ global void SetServers (string servers_s) {
+ servers = filter (string s, splitstring (servers_s, " \t"),``(s != ""));
}
/**
@@ -97,7 +97,7 @@
* The domains must be the same as for multidomain_broadcast
* @see multidomain_broadcast
*/
- global map multidomain_servers = $[];
+ global map multidomain_servers = $[];
/**
* Servers for a multiple-domain configuration.
@@ -107,254 +107,256 @@
* @see multidomain_servers
* @see global_broadcast
*/
- global map multidomain_broadcast = $[];
+ global map multidomain_broadcast = $[];
global map slp_domain = $[];
- global boolean manual = false;
+ global boolean manual = false;
+
+ // netconfig policy
+ global string policy = "auto";
- global string policy = "auto";
-
string domain = "";
string old_domain = nil;
boolean domain_changed = false;
- list<string> static_keylist = [];
-
- global define void getNetconfigValues() ``{
-
- y2milestone("getNetconfigValues called");
-
- policy = (string)SCR::Read(.sysconfig.network.config.NETCONFIG_NIS_POLICY);
-
- map > staticVals = $[];
-
- list<string> keylist = SCR::Dir(.sysconfig.network.config);
-
- y2milestone("KEYLIST: %1", keylist);
-
- foreach (string key, keylist, ``{
- if (!issubstring(key, "NETCONFIG_NIS_STATIC_DOMAIN") &&
- !issubstring(key, "NETCONFIG_NIS_STATIC_SERVERS"))
- continue;
-
-
- string value = (string)SCR::Read(add(.sysconfig.network.config, key));
-
- y2milestone("Found %1 = %2", key, value);
-
- string num = "";
-
- if(key == "NETCONFIG_NIS_STATIC_DOMAIN")
- {
- staticVals["0"] = add(staticVals["0"]:$[], "DOMAIN", value );
- }
- else if (key == "NETCONFIG_NIS_STATIC_SERVERS")
- {
- staticVals["0"] = add(staticVals["0"]:$[], "SERVERS", value );
- }
- else
- {
- static_keylist = add(static_keylist, key);
-
- num = regexpsub(key, "^NETCONFIG_STATIC_NIS_(DOMAIN|SERVERS)_(.*)", "\\2");
-
- y2milestone("try to get the number: %1", num);
-
- if( issubstring(key, "NETCONFIG_NIS_STATIC_DOMAIN"))
- {
- staticVals[num] = add(staticVals[num]:$[], "DOMAIN", value );
- }
- else if( issubstring(key, "NETCONFIG_NIS_STATIC_SERVERS"))
- {
- staticVals[num] = add(staticVals[num]:$[], "SERVERS", value );
- }
- }
- });
-
- y2milestone("STATIC VALS: %1", staticVals);
-
- foreach (string key, map value, staticVals, ``{
- if(value["DOMAIN"]:nil == "")
- {
- if(value["SERVERS"]:"" != "")
- {
- string sr = GetServers()+" "+value["SERVERS"]:"" ;
- SetServers(sr);
- }
- }
- else if(value["DOMAIN"]:nil == "broadcast")
- {
- default_broadcast = true;
- }
- else if(value["DOMAIN"]:"" != "")
- {
- if(value["SERVERS"]:nil == "broadcast")
- {
- multidomain_broadcast = add(multidomain_broadcast, value["DOMAIN"]:"", true);
- }
- else if(value["SERVERS"]:nil == "slp")
- {
- slp_domain = add(slp_domain, value["DOMAIN"]:"", true);
- }
- else if(value["SERVERS"]:"" != "")
- {
- multidomain_servers = add(multidomain_servers, value["DOMAIN"]:"",
- splitstring(value["SERVERS"]:"", " "));
- }
- }
- });
- foreach (string domain, list<string> value, multidomain_servers, ``{
- if(!haskey(multidomain_broadcast, domain))
- {
- multidomain_broadcast = add(multidomain_broadcast, domain, false);
- }
- });
-
- foreach (string domain, any value, (map)multidomain_broadcast, ``{
- if(!haskey(multidomain_servers, domain))
- {
- multidomain_servers = add(multidomain_servers, domain, []);
- }
- });
-
- foreach (string domain, any value, (map)slp_domain, ``{
- if(!haskey(multidomain_servers, domain))
- {
- multidomain_servers = add(multidomain_servers, domain, []);
- }
- });
-
- y2milestone("Servers: %1", servers);
- y2milestone("multidomain_servers: %1", multidomain_servers);
- y2milestone("multidomain_broadcast: %1", multidomain_broadcast);
- y2milestone("slp_domain: %1", slp_domain);
- y2milestone("default_broadcast: %1", default_broadcast);
-
- }
-
-
- global define void setNetconfigValues() ``{
-
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_POLICY, policy);
-
- foreach (string domain, list value, (map)multidomain_servers, ``{
- if(!haskey(multidomain_broadcast, domain))
- {
- multidomain_broadcast = add(multidomain_broadcast, domain, false);
- }
- });
-
- foreach (string domain, boolean value, (map)multidomain_broadcast, ``{
- if(!haskey(multidomain_servers, domain))
- {
- multidomain_servers = add(multidomain_servers, domain, []);
- }
- });
-
- foreach (string domain, boolean value, (map)slp_domain, ``{
- if(!haskey(multidomain_servers, domain))
- {
- multidomain_servers = add(multidomain_servers, domain, []);
- }
- });
-
- foreach(string key, static_keylist, ``{
- y2milestone("Remove : %1", key);
- SCR::Write(add(.sysconfig.network.config, key), nil);
- });
- /* remove the content of this */
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, "");
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, "");
+ list<string> static_keylist = [];
+
+ /**
+ * Read Netconfig conmfiguration
+ */
+ global void getNetconfigValues() {
+
+ y2milestone("getNetconfigValues called");
+
+ policy = (string)SCR::Read(.sysconfig.network.config.NETCONFIG_NIS_POLICY);
+ map > staticVals = $[];
+ list<string> keylist = SCR::Dir (.sysconfig.network.config);
- integer cnt = 0;
+ y2milestone("KEYLIST: %1", keylist);
- y2milestone("Servers: %1", servers);
- y2milestone("multidomain_servers: %1", multidomain_servers);
- y2milestone("multidomain_broadcast: %1", multidomain_broadcast);
- y2milestone("slp_domain: %1", slp_domain);
- y2milestone("default_broadcast: %1", default_broadcast);
-
- if(size(servers) > 0)
+ if (keylist == nil) keylist = [];
+
+ foreach (string key, keylist, {
+
+ if (!issubstring(key, "NETCONFIG_NIS_STATIC_DOMAIN") &&
+ !issubstring(key, "NETCONFIG_NIS_STATIC_SERVERS"))
+ continue;
+
+ string value =(string)SCR::Read(add(.sysconfig.network.config,key));
+
+ y2milestone("Found %1 = %2", key, value);
+ string num = "";
+
+ if (key == "NETCONFIG_NIS_STATIC_DOMAIN")
+ {
+ staticVals["0"] = add (staticVals["0"]:$[], "DOMAIN", value);
+ }
+ else if (key == "NETCONFIG_NIS_STATIC_SERVERS")
+ {
+ staticVals["0"] = add (staticVals["0"]:$[], "SERVERS", value);
+ }
+ else
+ {
+ static_keylist = add (static_keylist, key);
+ num = regexpsub(key, "^NETCONFIG_STATIC_NIS_(DOMAIN|SERVERS)_(.*)", "\\2");
+ y2milestone("try to get the number: %1", num);
+ if (issubstring(key, "NETCONFIG_NIS_STATIC_DOMAIN"))
+ {
+ staticVals[num] = add(staticVals[num]:$[], "DOMAIN", value); }
+ else if (issubstring(key, "NETCONFIG_NIS_STATIC_SERVERS"))
{
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, "");
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, mergestring(servers, " "));
- cnt = cnt + 1;
+ staticVals[num] = add(staticVals[num]:$[], "SERVERS",value);
}
-
- foreach( string dom, list<string> srvs, multidomain_servers, ``{
- if(dom == "")
- continue;
-
- if(size(srvs) > 0)
- {
- if(cnt == 0)
- {
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, dom);
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, mergestring(srvs, " "));
- }
- else
- {
- SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_DOMAIN_"+cnt), dom);
- SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_SERVERS_"+cnt), mergestring(srvs, " "));
- }
- cnt = cnt + 1;
- }
-
- if(multidomain_broadcast[dom]:false == true)
- {
- if(cnt == 0)
- {
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, dom);
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, "broadcast");
- }
- else
- {
- SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_DOMAIN_"+cnt), dom);
- SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_SERVERS_"+cnt), "broadcast");
- }
- cnt = cnt + 1;
- }
-
- if(slp_domain[dom]:false == true)
- {
- if(cnt == 0)
- {
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, dom);
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, "slp");
- }
- else
- {
- SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_DOMAIN_"+cnt), dom);
- SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_SERVERS_"+cnt), "slp");
- }
- cnt = cnt + 1;
- }
+ }
+ });
- });
- if(default_broadcast == true)
+ y2milestone("STATIC VALS: %1", staticVals);
+
+ foreach (string key, map value, staticVals, {
+ if (value["DOMAIN"]:nil == "")
+ {
+ if (value["SERVERS"]:"" != "")
{
- if(cnt == 0)
- {
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, "broadcast");
- SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, "");
- }
- else
- {
- SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_DOMAIN_"+cnt), "broadcast");
- SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_SERVERS_"+cnt), "");
- }
- cnt = cnt + 1;
+ string sr = GetServers() + " " + value["SERVERS"]:"";
+ SetServers (sr);
+ }
+ }
+ else if (value["DOMAIN"]:nil == "broadcast")
+ {
+ default_broadcast = true;
+ }
+ else if (value["DOMAIN"]:"" != "")
+ {
+ if (value["SERVERS"]:nil == "broadcast")
+ {
+ multidomain_broadcast[value["DOMAIN"]:""] = true;
+ }
+ else if (value["SERVERS"]:nil == "slp")
+ {
+ slp_domain[value["DOMAIN"]:""] = true;
}
-
- if (! SCR::Write(.sysconfig.network.config, nil))
+ else if (value["SERVERS"]:"" != "")
{
- Report::Error (Message::ErrorWritingFile ("/etc/sysconfig/network/config"));
+ multidomain_servers[value["DOMAIN"]:""] =
+ splitstring (value["SERVERS"]:"", " ");
}
+ }
+ });
+
+ foreach (string domain, list value, multidomain_servers, {
+ if (!haskey (multidomain_broadcast, domain))
+ {
+ multidomain_broadcast[domain] = false;
+ }
+ });
+
+ foreach (string domain, boolean value, multidomain_broadcast, {
+ if (!haskey(multidomain_servers, domain))
+ {
+ multidomain_servers [domain] = [];
+ }
+ });
+
+ foreach (string domain, any value, (map) slp_domain, {
+ if (!haskey (multidomain_servers, domain))
+ {
+ multidomain_servers[domain] = [];
+ }
+ });
+
+ y2milestone("Servers: %1", servers);
+ y2milestone("multidomain_servers: %1", multidomain_servers);
+ y2milestone("multidomain_broadcast: %1", multidomain_broadcast);
+ y2milestone("slp_domain: %1", slp_domain);
+ y2milestone("default_broadcast: %1", default_broadcast);
+ }
+
+ /**
+ * Write the netconfig configuration
+ */
+ global boolean setNetconfigValues() {
+
+ SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_POLICY, policy);
+
+ foreach (string domain, list value, multidomain_servers, {
+ if (!haskey (multidomain_broadcast, domain))
+ {
+ multidomain_broadcast[domain] = false;
+ }
+ });
+
+ foreach (string domain, boolean value, multidomain_broadcast, {
+ if (!haskey (multidomain_servers, domain))
+ {
+ multidomain_servers[domain] = [];
+ }
+ });
+
+ foreach (string domain, any value, (map) slp_domain, {
+ if (!haskey (multidomain_servers, domain))
+ {
+ multidomain_servers[domain] = [];
+ }
+ });
+
+ foreach (string key, static_keylist, {
+ y2milestone("Remove : %1", key);
+ SCR::Write (add (.sysconfig.network.config, key), nil);
+ });
+
+ /* remove the content of this */
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, "");
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, "");
+
+
+ y2milestone("Servers: %1", servers);
+ y2milestone("multidomain_servers: %1", multidomain_servers);
+ y2milestone("multidomain_broadcast: %1", multidomain_broadcast);
+ y2milestone("slp_domain: %1", slp_domain);
+ y2milestone("default_broadcast: %1", default_broadcast);
+
+ integer cnt = 0;
+ if (size (servers) > 0)
+ {
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN,
+ "");
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS,
+ mergestring (servers, " "));
+ cnt = cnt + 1;
}
-
-
+ foreach (string dom, list<string> srvs, (map)
+ multidomain_servers,
+ {
+ if (dom == "") continue;
+ if (size(srvs) > 0)
+ {
+ if (cnt == 0)
+ {
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, dom);
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, mergestring (srvs, " "));
+ }
+ else
+ {
+ SCR::Write (add (.sysconfig.network.config, "NETCONFIG_NIS_STATIC_DOMAIN_"+cnt), dom);
+ SCR::Write (add (.sysconfig.network.config, "NETCONFIG_NIS_STATIC_SERVERS_"+cnt), mergestring(srvs, " "));
+ }
+ cnt = cnt + 1;
+ }
+ if (multidomain_broadcast[dom]:false == true)
+ {
+ if (cnt == 0)
+ {
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, dom);
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, "broadcast");
+ }
+ else
+ {
+ SCR::Write (add (.sysconfig.network.config, "NETCONFIG_NIS_STATIC_DOMAIN_"+cnt), dom);
+ SCR::Write (add (.sysconfig.network.config, "NETCONFIG_NIS_STATIC_SERVERS_"+cnt), "broadcast");
+ }
+ cnt = cnt + 1;
+ }
+ if (slp_domain[dom]:false == true)
+ {
+ if (cnt == 0)
+ {
+ SCR::Write (.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, dom);
+ SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, "slp");
+ }
+ else
+ {
+ SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_DOMAIN_"+cnt), dom);
+ SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_SERVERS_"+cnt), "slp");
+ }
+ cnt = cnt + 1;
+ }
+ });
+
+ if (default_broadcast == true)
+ {
+ if (cnt == 0)
+ {
+ SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_DOMAIN, "broadcast");
+ SCR::Write(.sysconfig.network.config.NETCONFIG_NIS_STATIC_SERVERS, "");
+ }
+ else
+ {
+ SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_DOMAIN_"+cnt), "broadcast");
+ SCR::Write(add(.sysconfig.network.config, "NETCONFIG_NIS_STATIC_SERVERS_"+cnt), "");
+ }
+ cnt = cnt + 1;
+ }
+
+ if (! SCR::Write(.sysconfig.network.config, nil))
+ {
+ Report::Error (Message::ErrorWritingFile ("/etc/sysconfig/network/config"));
+ return false;
+ }
+ return true;
+ }
+
/**
* If the domain has changed from a nonempty one, it may only be
* changed at boot time. Use this to warn the user.
@@ -386,28 +388,12 @@
// DHCP cooperation
/**
- * Whether sysconfig/network/dhcp says
- * to get the domain AND yp.conf by DHCP.
- * It will be turned off if dhcp_possible is off
- * (the user can override it)
- */
- /* global boolean dhcp_wanted = false; */
-
- /**
* #35654: if the server is running and sysconfig wants NIS data,
* it's ok to FitIntoSingle
*/
global boolean dhcpcd_running = false;
/**
- * Is the domain AND yp.conf served by DHCP?
- * This is independent of dhcp_wanted:
- * dhcpcd*.pid exists and dhcpcd*.info contains NISSERVERS and NISDOMAIN.
- * It is used to warn the user if he wants to turn DHCP on but the config
- * is not provided.
- */
- global boolean dhcp_possible = false;
- /**
* If dhcp_wanted changes, we need to restart the DHCP client
*/
global boolean dhcp_restart = false;
@@ -607,19 +593,16 @@
domain = settings["nis_domain"]:"";
old_domain = domain;
- //dhcp_wanted = settings["nis_by_dhcp"]:false;
- // we have to hope the config will be available
- dhcp_possible = true;
// we don't know what the state will be before Write, so restart it
dhcp_restart = true;
list<map> other_domains = settings["nis_other_domains"]:[];
foreach (map other_domain, other_domains, ``{
- string d = other_domain["nis_domain"]:"";
- list<string> s = other_domain["nis_servers"]:[];
+ string domain = other_domain["nis_domain"]:"";
+ list<string> servers = other_domain["nis_servers"]:[];
boolean b = other_domain["nis_broadcast"]:false;
- multidomain_servers = add (multidomain_servers, d, s);
- multidomain_broadcast = add (multidomain_broadcast, d, b);
+ multidomain_servers[domain] = servers;
+ multidomain_broadcast[domain] = b;
});
local_only = settings["nis_local_only"]:false;
@@ -685,8 +668,8 @@
* Dump the NIS settings to a map, for autoinstallation use.
* @return $["start":, "servers":[...], "domain":]
*/
- global define map Export () ``{
- list other_domains = maplist (string d, list s, multidomain_servers, ``{
+ global define map Export () {
+ list other_domains = maplist (string d, list s, multidomain_servers, {
return $[
"nis_domain": d,
"nis_servers": s,
@@ -776,9 +759,7 @@
// summary header
summary = Summary::AddHeader(summary, _("NIS Domain"));
summary = Summary::AddLine(summary,((domain != "") ? domain : nc));
-
-
- // summary header
+ // summary header
summary = Summary::AddHeader(summary, _("NIS Servers"));
summary = Summary::AddLine(summary, ((servers !=[]) ? mergestring(servers,"<br>") : nc));
// summary header
@@ -860,22 +841,7 @@
dhcpcd_running =
SCR::Execute (.target.bash, "ls /var/run/dhcpcd-*.pid") == 0;
- string di = "/var/lib/dhcpcd/dhcpcd-*.info";
- boolean servers_by_dhcp_possible = dhcpcd_running && SCR::Execute (
- .target.bash, "/bin/grep -qs '^NISSERVERS' " + di) == 0;
- boolean domain_by_dhcp_possible = dhcpcd_running && SCR::Execute (
- .target.bash, "/bin/grep -qs '^NISDOMAIN' " + di) == 0;
- dhcp_possible = servers_by_dhcp_possible && domain_by_dhcp_possible;
- // we do it here instead of in the ui so that the user can override it
- // in the ui or switch single/multiple domains
- /*
- if (dhcp_wanted && !dhcp_possible)
- {
- dhcp_wanted = false;
- Touch (true);
- }
- */
-
+
local_only = SCR::Read (.sysconfig.ypbind.YPBIND_LOCAL_ONLY) == "yes";
global_broadcast = SCR::Read (.sysconfig.ypbind.YPBIND_BROADCAST) == "yes";
broken_server = SCR::Read (.sysconfig.ypbind.YPBIND_BROKEN_SERVER) == "yes";
@@ -920,8 +886,6 @@
];
domain = "example.com";
old_domain = domain;
- //dhcp_wanted = false;
- dhcp_possible = false; // to see the warning popup
local_only = false;
global_broadcast = false;
broken_server = false;
@@ -1102,25 +1066,19 @@
Service::Enable("portmap");
Service::Enable("ypbind");
- /*
- if (!dhcp_wanted)
+ if (!SCR::Write (.etc.defaultdomain, domain))
{
- */
- if (!SCR::Write (.etc.defaultdomain, domain))
- {
- Report::Error (
- Message::ErrorWritingFile ("/etc/defaultdomain"));
- return false;
- }
+ Report::Error (Message::ErrorWritingFile("/etc/defaultdomain"));
+ return false;
+ }
+
+ // so that dhcpcd cannot restore it
+ SCR::Execute (.target.remove, "/etc/yp.conf.sv");
- // so that dhcpcd cannot restore it
- SCR::Execute (.target.remove, "/etc/yp.conf.sv");
+ setNetconfigValues();
- setNetconfigValues();
+ SCR::Execute(.target.bash, "/sbin/netconfig update");
- SCR::Execute(.target.bash, "/sbin/netconfig update");
-
- //}
SCR::Write (.sysconfig.ypbind.YPBIND_LOCAL_ONLY, local_only? "yes":"no");
SCR::Write (.sysconfig.ypbind.YPBIND_BROADCAST, global_broadcast? "yes":"no");
SCR::Write (.sysconfig.ypbind.YPBIND_BROKEN_SERVER, broken_server? "yes":"no");
Modified: trunk/nis-client/src/ui.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/nis-client/src/ui.ycp?rev=50519&r1=50518&r2=50519&view=diff
==============================================================================
--- trunk/nis-client/src/ui.ycp (original)
+++ trunk/nis-client/src/ui.ycp Mon Sep 1 14:00:34 2008
@@ -75,20 +75,6 @@
}
/**
- * Pop up a warning if dhcp does not provide nis configuration
- */
- define void WarnIfDhcpNotServed () ``{
- // do not error message for NM (#152262)
- if (!Nis::dhcp_possible && !NetworkService::IsManaged ())
- {
- // Translators: warning popup
- Report::Warning (_("NIS configuration is not currently provided by DHCP.
-Change the DHCP server configuration to provide it.
-"));
- }
- }
-
- /**
* Let the user choose some of a list of items
* @param title selectionbox title
* @param items a list of items
@@ -226,7 +212,7 @@
help_text = help_text + broadcast_help;
- help_text = help_text + dhcp_help;
+// help_text = help_text + dhcp_help;
// help text
help_text = help_text + _("<p>Automounter is a daemon that mounts directories automatically,
@@ -238,7 +224,6 @@
help_text = help_text + firewall_widget["help"]:"";
- //boolean dhcp_wanted = Nis::dhcp_wanted || NetworkService::IsManaged ();
string domain = Nis::GetDomain ();
string servers = Nis::GetServers ();
@@ -288,28 +273,24 @@
`VBox (
`VSpacing (0.2),
`HBox (
- `ComboBox(`id(`policy), `opt (`notify), _("Nis &Policy"),
- [`item(`id(`nomodify), "manual"),
- `item(`id(`auto), "auto"),
- `item(`id(`custom), "custom")]),
- `TextEntry(`id(`custompolicy), `opt(`hstrech), _("C&ustom Policy"), "")
- ),
-
-
-// `RadioButtonGroup (`id (`dhcpg), `VBox (
-// `Left (`RadioButton (`id (`dhcpyes), `opt (`notify),
-// automatic_label, dhcp_wanted)),
-// radio button label
-// `Left (`RadioButton (`id (`dhcpno), `opt (`notify), _("&Static Setup"), !dhcp_wanted))
-// )),
-
-
+ // combo box label
+ `ComboBox(`id(`policy), `opt (`notify), _("Nis &Policy"), [
+ `item(`id(`nomodify), "manual"),
+ `item(`id(`auto), "auto"),
+ `item(`id(`custom), "custom")
+ ]),
+ `InputField (`id(`custompolicy), `opt (`hstrech),
+ // text entry label
+ _("C&ustom Policy"), "")
+ ),
`VSpacing (0.2),
// text entry label
- `TextEntry (`id (`domain), _("N&IS Domain"), domain),
+ `InputField (`id (`domain), `opt (`hstrech), _("N&IS Domain"),
+ domain),
`VSpacing (0.2),
- // text entry label
- `TextEntry (`id (`servers), _("&Addresses of NIS servers"), servers),
+ `InputField (`id (`servers), `opt (`hstrech),
+ // text entry label
+ _("&Addresses of NIS servers"), servers),
`HBox (
// check box label
`Left (`CheckBox (`id (`broadcast), `opt (`notify), _("Br&oadcast"), default_broadcast)),
@@ -404,9 +385,7 @@
//UI::ChangeWidget (`id (`custompolicy), `Enabled, yp_client);
UI::ChangeWidget (`id (`autofs), `Enabled, yp_client);
- //dhcp_wanted = ((symbol) UI::QueryWidget (`id (`dhcpg), `CurrentButton) == `dhcpyes);
-
- Nis::manual = ((symbol) UI::QueryWidget (`id (`policy), `Value) == `nomodify);
+ Nis::manual = ((symbol) UI::QueryWidget (`id (`policy), `Value) == `nomodify);
UI::ChangeWidget (`id (`domain), `Enabled, !Nis::manual && yp_client);
UI::ChangeWidget (`id (`servers), `Enabled, !Nis::manual && yp_client);
UI::ChangeWidget (`id (`broadcast), `Enabled, !Nis::manual && yp_client);
@@ -431,25 +410,16 @@
UI::ChangeWidget (`id (`custompolicy), `Enabled, (true && yp_client));
}
}
-
event = UI::WaitForEvent ();
result = (symbol) event["ID"]:nil;
CWMFirewallInterfaces::OpenFirewallHandle(firewall_widget,"",event);
- if (result == `cancel)
+ if (result == `cancel)
{
result = `abort;
}
- /*
- if (result == `dhcpyes)
- {
- WarnIfDhcpNotServed ();
- }
- else
- */
-
- if (result == `find)
+ if (result == `find)
{
domain = (string) UI::QueryWidget (`id (`domain), `Value);
if (domain == "")
@@ -537,15 +507,7 @@
{
Nis::Touch (Nis::start != yp_client);
Nis::start = yp_client;
-
- Nis::dhcp_restart = false;
- /*
- Nis::dhcp_restart = Nis::dhcp_restart ||
- (Nis::dhcp_wanted != dhcp_wanted);
- Nis::Touch (Nis::dhcp_restart);
- Nis::dhcp_wanted = dhcp_wanted;
- */
-
+ Nis::dhcp_restart = false;
Nis::SetDomain (domain);
Nis::SetServers (servers);
Nis::Touch (Nis::default_broadcast != default_broadcast);
@@ -596,9 +558,9 @@
// check box label
`Left (`CheckBox (`id (`broken_server), _("Br&oken server"), broken_server)),
`VSpacing (0.2),
- // text entry label
- // ypbind is the daemon name
- `TextEntry (`id (`options), _("Other &ypbind options"), options),
+ `InputField (`id (`options), `opt (`hstrech),
+ // text entry label (do not translate 'ypbind')
+ _("Other &ypbind options"), options),
`VSpacing (0.2)
)
),
@@ -750,7 +712,7 @@
`Heading (_("Domain Settings")),
// Add a domain, Adding a domain? Edit...
// Translators: text entry label
- `Left (`TextEntry (`id (`domain), _("&Domain name"), domain)),
+ `Left (`InputField (`id (`domain), _("&Domain name"), domain)),
`VSpacing(0.5),
t_servers,
`VSpacing(0.2),
@@ -1118,7 +1080,7 @@
string d = Nis::GetDomain ();
if (size (Nis::multidomain_servers) == 1)
{
- list<string> s = Nis::multidomain_servers[d]:[];
+ list<string> s = (list<string>) Nis::multidomain_servers[d]:[];
// if there's only one entry, for the correct domain
if (size (s) > 0)
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org