Author: jsuchome Date: Tue Jul 1 11:27:35 2008 New Revision: 48701 URL: http://svn.opensuse.org/viewcvs/yast?rev=48701&view=rev Log: adapted for .time agent usage Modified: branches/tmp/lslezak/workshop/country/timezone/src/Timezone.ycp Modified: branches/tmp/lslezak/workshop/country/timezone/src/Timezone.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/country/timezone/src/Timezone.ycp?rev=48701&r1=48700&r2=48701&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/country/timezone/src/Timezone.ycp (original) +++ branches/tmp/lslezak/workshop/country/timezone/src/Timezone.ycp Tue Jul 1 11:27:35 2008 @@ -253,6 +253,9 @@ } if (inst && !textmode) SCR::Execute ( .target.bash, "/usr/bin/xset +dpms"); + + // TODO something like + // DBUS::Execute (org.opensuse.yast/timezone.set, timezone) } // On first assignment store default timezone. @@ -352,6 +355,7 @@ string hour, string minute, string second ) { if (!Arch::s390 ()) { + /* string date = sformat( " --date=\"%1/%2/%3 %4:%5:%6\" ", month, day, year, hour, minute, second ); string cmd = ""; @@ -365,6 +369,14 @@ cmd = "/sbin/hwclock --hctosys " + hwclock; y2milestone( "SetTime cmd %1", cmd ); SCR::Execute(.target.bash, cmd ); + */ + SCR::Write (.time, $[ + // FIXME + "datestring" : sformat (" --date=\"%1/%2/%3 %4:%5:%6\"", + month, day, year, hour, minute, second), + "hwclock" : hwclock, + "timezone" : timezone + ]); } }; @@ -517,10 +529,16 @@ cmd = cmd + sformat( "/bin/date \"%1\" \"--date=now %2sec\"", date_format, ds*diff ); } - else - { + else { cmd = sformat( "/bin/date \"%1\"", date_format ); - } + // use new agent only here for now.... FIXME + map argmap = $[ + "localized" : locale_format + ]; + string local_date = (string) SCR::Read (.time, argmap); + y2internal (".time agent returned %1", local_date); + return local_date; + } y2milestone( "GetDateTime cmd=%1", cmd ); map out = (map) SCR::Execute (.target.bash_output, cmd); string local_date = out["stdout"]:""; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org