Author: mvidner Date: Fri Apr 11 10:45:42 2008 New Revision: 46384 URL: http://svn.opensuse.org/viewcvs/yast?rev=46384&view=rev Log: TestNtpServer enhanced with `no_ui option Modified: trunk/ntp-client/src/NtpClient.ycp trunk/ntp-client/src/widgets.ycp Modified: trunk/ntp-client/src/NtpClient.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/NtpClient.ycp?rev=... ============================================================================== --- trunk/ntp-client/src/NtpClient.ycp (original) +++ trunk/ntp-client/src/NtpClient.ycp Fri Apr 11 10:45:42 2008 @@ -957,14 +957,16 @@ /** * Test if specified NTP server answers * @param server string host name or IP address of the NTP server - * @param silent boolean don't report the result of the detection + * @param verbosity `no_ui: ..., `transient_popup: pop up while scanning, + * `result_popup: also final pop up about the result * @return boolean true if NTP server answers properly */ -global boolean TestNtpServer (string server, boolean silent) { - UI::OpenDialog( +global boolean TestNtpServer (string server, symbol verbosity) { + if (verbosity != `no_ui) + UI::OpenDialog( // An informative popup label diring the NTP server testings `Left(`Label(_("Testing the NTP server..."))) - ); + ); integer status = -1; //Do not do anything to ntp service during installation @@ -999,10 +1001,12 @@ Service::Start (service_name); } - UI::CloseDialog(); + if (verbosity != `no_ui) { + UI::CloseDialog(); + } boolean ok = (ret_IPv4 == 0 || ret_IPv6 == 0); - if (! silent) + if (verbosity == `result_popup) { if (ok) { Modified: trunk/ntp-client/src/widgets.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/widgets.ycp?rev=46... ============================================================================== --- trunk/ntp-client/src/widgets.ycp (original) +++ trunk/ntp-client/src/widgets.ycp Fri Apr 11 10:45:42 2008 @@ -631,10 +631,10 @@ if (ev_id == `test_server) { if (UI::WidgetExists(`id("use_random_servers")) && (boolean) UI::QueryWidget(`id("use_random_servers"), `Value)) { - NtpClient::TestNtpServer (NtpClient::random_pool_servers[random(4)]:"0.pool.ntp.org", false); + NtpClient::TestNtpServer (NtpClient::random_pool_servers[random(4)]:"0.pool.ntp.org", `result_popup); } else { if (serverAddressValidate("server_address",$[])) - NtpClient::TestNtpServer (server, false); + NtpClient::TestNtpServer (server, `result_popup); } } else if (ev_id == `select_local) { @@ -928,7 +928,7 @@ } if (event["ID"]:nil == `test) { - NtpClient::TestNtpServer (server, false); + NtpClient::TestNtpServer (server, `result_popup); } return nil; } @@ -1088,6 +1088,7 @@ */ void FoundServersInit (string id) { list <term> items = []; + foreach (string server, found_servers_cache, { items = add (items, `item(`id(server), server)); }); @@ -1138,7 +1139,7 @@ // { // server = (string)UI::QueryWidget (`id (`servers), `Value); // } - NtpClient::TestNtpServer (server, false); + NtpClient::TestNtpServer (server, `result_popup); return nil; } @@ -1152,7 +1153,7 @@ // { server = (string)UI::QueryWidget (`id (`servers), `Value); // } - NtpClient::TestNtpServer (server, false); + NtpClient::TestNtpServer (server, `result_popup); return nil; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org