Author: xwhu Date: Tue Feb 24 07:41:34 2009 New Revision: 55701 URL: http://svn.opensuse.org/viewcvs/yast?rev=55701&view=rev Log: Change the validate notification Modified: trunk/cluster/src/dialogs.ycp Modified: trunk/cluster/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/cluster/src/dialogs.ycp?rev=55701&r1=55700&r2=55701&view=diff ============================================================================== --- trunk/cluster/src/dialogs.ycp (original) +++ trunk/cluster/src/dialogs.ycp Tue Feb 24 07:41:34 2009 @@ -47,53 +47,54 @@ boolean ValidateCommunication () { - boolean ret = true; - foreach(symbol tid, [`bindnetaddr1, `mcastaddr1, ], { - if (IP::Check((string)UI::QueryWidget(`id(tid), `Value)) == false) { - Popup::Message("Must input Network Address"); - UI::SetFocus(tid); - ret = false; - } - }); - foreach(symbol tid, [`mcastport1], { - if (!regexpmatch((string)UI::QueryWidget(`id(tid), `Value), "^[0-9]+$")) { - Popup::Message("Must input integer"); - UI::SetFocus(`id(tid)); - ret = false; - } - }); + if (IP::Check((string)UI::QueryWidget(`id(`bindnetaddr1), `Value)) == false) { + Popup::Message("The Bind Network Address has to be fulfilled"); + UI::SetFocus(`bindnetaddr1); + return false; + } + if (IP::Check((string)UI::QueryWidget(`id(`mcastaddr1), `Value)) == false) { + Popup::Message("The Multicast Address has to be fulfilled"); + UI::SetFocus(`mcastaddr1); + return false; + } + if (!regexpmatch((string)UI::QueryWidget(`id(`mcastport1), `Value), "^[0-9]+$")) { + Popup::Message("The Multicast port must be a positive integer"); + UI::SetFocus(`id(`mcastport1)); + return false; + } if (UI::QueryWidget(`id(`autoid), `Value) == false) { string noid = (string)UI::QueryWidget(`id(`nodeid), `Value); boolean s = regexpmatch(noid, "^[0-9]+$"); if (!s) { - Popup::Message("Must input integer"); + Popup::Message("Node ID has to be a positive integer"); UI::SetFocus(`id(`nodeid)); - ret = false; + return false; } integer i = tointeger(noid); if (i == 0) { Popup::Message("NodeID 0 is reserved"); UI::SetFocus(`id(`nodeid)); - ret = false; + return false; } } if (UI::QueryWidget(`id(`enable2), `Value) == true) { - foreach(symbol tid, [`bindnetaddr2, `mcastaddr2, ], { - if (IP::Check((string)UI::QueryWidget(`id(tid), `Value)) == false) { - Popup::Message("Must input Network Address"); - UI::SetFocus(tid); - ret = false; - } - }); - foreach(symbol tid, [`mcastport2], { - if (!regexpmatch((string)UI::QueryWidget(`id(tid), `Value), "^[0-9]+$")) { - Popup::Message("Must input integer"); - UI::SetFocus(`id(tid)); - ret = false; - } - }); + if (IP::Check((string)UI::QueryWidget(`id(`bindnetaddr2), `Value)) == false) { + Popup::Message("The Bind Network Address has to be fulfilled"); + UI::SetFocus(`bindnetaddr2); + return false; + } + if (IP::Check((string)UI::QueryWidget(`id(`mcastaddr2), `Value)) == false) { + Popup::Message("The Multicast Address has to be fulfilled"); + UI::SetFocus(`mcastaddr2); + return false; + } + if (!regexpmatch((string)UI::QueryWidget(`id(`mcastport2), `Value), "^[0-9]+$")) { + Popup::Message("The Multicast port must be a positive integer"); + UI::SetFocus(`id(`mcastport2)); + return false; + } } - return ret; + return true; } void SaveCommunicationToConf () -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org