Author: jsuchome
Date: Thu Oct 1 12:29:48 2009
New Revision: 58866
URL: http://svn.opensuse.org/viewcvs/yast?rev=58866&view=rev
Log:
- added YaPI files TIME and LANGUAGE for webYaST
- 2.17.35
Added:
branches/SuSE-Code-11-SP1-Branch/country/language/src/YaPI/
branches/SuSE-Code-11-SP1-Branch/country/language/src/YaPI/LANGUAGE.pm
branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.language.policy
branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.time.policy
branches/SuSE-Code-11-SP1-Branch/country/timezone/src/YaPI/
branches/SuSE-Code-11-SP1-Branch/country/timezone/src/YaPI/TIME.pm
Modified:
branches/SuSE-Code-11-SP1-Branch/country/VERSION
branches/SuSE-Code-11-SP1-Branch/country/language/src/Makefile.am
branches/SuSE-Code-11-SP1-Branch/country/package/yast2-country.changes
branches/SuSE-Code-11-SP1-Branch/country/timezone/src/Makefile.am
branches/SuSE-Code-11-SP1-Branch/country/yast2-country.spec.in
Modified: branches/SuSE-Code-11-SP1-Branch/country/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/VERSION?rev=58866&r1=58865&r2=58866&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/country/VERSION Thu Oct 1 12:29:48 2009
@@ -1 +1 @@
-2.17.34
+2.17.35
Modified: branches/SuSE-Code-11-SP1-Branch/country/language/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/language/src/Makefile.am?rev=58866&r1=58865&r2=58866&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/language/src/Makefile.am (original)
+++ branches/SuSE-Code-11-SP1-Branch/country/language/src/Makefile.am Thu Oct 1 12:29:48 2009
@@ -15,6 +15,12 @@
rnc_DATA = language.rnc
-EXTRA_DIST = $(client_DATA) $(desktop_DATA) $(rnc_DATA)
+YaPI_perldir = @moduledir@/YaPI
+
+YaPI_perl_DATA = \
+ YaPI/LANGUAGE.pm
+
+
+EXTRA_DIST = $(client_DATA) $(desktop_DATA) $(YaPI_perl_DATA) $(rnc_DATA)
include $(top_srcdir)/Makefile.am.common
Added: branches/SuSE-Code-11-SP1-Branch/country/language/src/YaPI/LANGUAGE.pm
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/language/src/YaPI/LANGUAGE.pm?rev=58866&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/language/src/YaPI/LANGUAGE.pm (added)
+++ branches/SuSE-Code-11-SP1-Branch/country/language/src/YaPI/LANGUAGE.pm Thu Oct 1 12:29:48 2009
@@ -0,0 +1,63 @@
+package YaPI::LANGUAGE;
+
+use strict;
+use YaST::YCP qw(Boolean);
+use YaPI;
+
+textdomain("language");
+
+# ------------------- imported modules
+YaST::YCP::Import ("Language");
+# -------------------------------------
+
+our $VERSION = '1.0.0';
+our @CAPABILITIES = ('SLES9');
+our %TYPEINFO;
+
+
+BEGIN{$TYPEINFO{Read} = ["function",
+ ["map","string","any"]
+,["map","string","string"]];
+}
+sub Read {
+ my $self = shift;
+ my $values = shift;
+ my $ret = {};
+ if (($values->{"languages"} || "false") eq "true"){
+ $ret->{"languages"} = Language->GetLanguagesMap(0);
+ }
+ if (($values->{"current"} || "false") eq "true"){
+ $ret->{"current"} = Language->language;
+ }
+ my $expr = Language->GetExpertValues();
+ if (($values->{"utf8"} || "false") eq "true"){
+ $ret->{"utf8"} = $expr->{"use_utf8"}?"true":"false";
+ }
+ if (($values->{"rootlang"} || "false") eq "true"){
+ $ret->{"rootlang"} = $expr->{"rootlang"};
+ }
+ return $ret;
+}
+
+BEGIN{$TYPEINFO{Write} = ["function",
+ "boolean",["map","string","string"]];
+}
+sub Write {
+ my $self = shift;
+ my $values = shift;
+ if ( defined $values->{"current"}){
+ Language->QuickSet($values->{"current"});
+ }
+ my $expr = {};
+ if (defined $values->{"utf8"}){
+ $expr->{"use_utf8"} = YaST::YCP::Boolean($values->{"utf8"} eq "true");
+ }
+ if (defined $values->{"rootlang"}){
+ $expr->{"rootlang"} = $values->{"rootlang"};
+ }
+ Language->SetExpertValues($expr);
+ Language->Save();
+ return 1;
+}
+
+1;
Added: branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.language.policy
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.language.policy?rev=58866&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.language.policy (added)
+++ branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.language.policy Thu Oct 1 12:29:48 2009
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
+<policyconfig>
+
+ <vendor>YaST Webservice Project</vendor>
+ http://en.opensuse.org/YAST
+
+<!--
+Rights for languages
+-->
+
+ <action id="org.opensuse.yast.modules.yapi.language.read">
+ <description>Reading languages settings</description>
+ <message>Authentication is required to read languages settings</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+ <action id="org.opensuse.yast.modules.yapi.language.write">
+ <description>Writing new language settings</description>
+ <message>Authentication is required to edit language settings</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+
+</policyconfig>
\ No newline at end of file
Added: branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.time.policy
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.time.policy?rev=58866&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.time.policy (added)
+++ branches/SuSE-Code-11-SP1-Branch/country/package/org.opensuse.yast.modules.yapi.time.policy Thu Oct 1 12:29:48 2009
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
+<policyconfig>
+
+ <vendor>YaST Webservice Project</vendor>
+ http://en.opensuse.org/YAST
+
+<!--
+Rights for system.time
+-->
+
+ <action id="org.opensuse.yast.modules.yapi.time.read">
+ <description>Reading system time settings</description>
+ <message>Authentication is required to read system time settings</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+ <action id="org.opensuse.yast.modules.yapi.time.write">
+ <description>Writing system time settings</description>
+ <message>Authentication is required to read system time settings</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+
+</policyconfig>
Modified: branches/SuSE-Code-11-SP1-Branch/country/package/yast2-country.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/package/yast2-country.changes?rev=58866&r1=58865&r2=58866&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/package/yast2-country.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/country/package/yast2-country.changes Thu Oct 1 12:29:48 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Oct 1 11:51:29 CEST 2009 - jsuchome@suse.cz
+
+- added YaPI files TIME and LANGUAGE for webYaST
+- 2.17.35
+
+-------------------------------------------------------------------
Fri Jul 17 11:19:02 CEST 2009 - jsuchome@suse.cz
- correct path to xset binary (bnc#522615)
Modified: branches/SuSE-Code-11-SP1-Branch/country/timezone/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/timezone/src/Makefile.am?rev=58866&r1=58865&r2=58866&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/timezone/src/Makefile.am (original)
+++ branches/SuSE-Code-11-SP1-Branch/country/timezone/src/Makefile.am Thu Oct 1 12:29:48 2009
@@ -22,7 +22,12 @@
rnc_DATA = timezone.rnc
-EXTRA_DIST = $(client_DATA) $(module_DATA) $(desktop_DATA) $(ynclude_DATA) $(rnc_DATA)
+YaPI_perldir = @moduledir@/YaPI
+
+YaPI_perl_DATA = \
+ YaPI/TIME.pm
+
+EXTRA_DIST = $(client_DATA) $(module_DATA) $(desktop_DATA) $(ynclude_DATA) $(YaPI_perl_DATA) $(rnc_DATA)
YCPCFLAGS = -M ../../language/src/modules
Added: branches/SuSE-Code-11-SP1-Branch/country/timezone/src/YaPI/TIME.pm
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/timezone/src/YaPI/TIME.pm?rev=58866&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/timezone/src/YaPI/TIME.pm (added)
+++ branches/SuSE-Code-11-SP1-Branch/country/timezone/src/YaPI/TIME.pm Thu Oct 1 12:29:48 2009
@@ -0,0 +1,78 @@
+package YaPI::TIME;
+
+use strict;
+use YaST::YCP qw(Boolean);
+use YaPI;
+
+textdomain("time");
+
+# ------------------- imported modules
+YaST::YCP::Import ("Timezone");
+# -------------------------------------
+
+our $VERSION = '1.0.0';
+our @CAPABILITIES = ('SLES9');
+our %TYPEINFO;
+
+BEGIN{$TYPEINFO{Read} = ["function",
+ ["map","string","any"],["map","string","string"]];
+}
+sub Read {
+ my $self = shift;
+ my $args = shift;
+ my $ret = {};
+ Timezone->Read();
+ if ($args->{"zones"} eq "true")
+ {
+ $ret->{"zones"} = Timezone->get_zonemap();
+ }
+ if ($args->{"utcstatus"} eq "true"){
+ if (Timezone->utc_only()){
+ $ret->{"utcstatus"} = "UTConly";
+ } elsif (Timezone->hwclock eq "-u") {
+ $ret->{"utcstatus"} = "UTC";
+ } else {
+ $ret->{"utcstatus"} = "local";
+ }
+ }
+ if ($args->{"currenttime"} eq "true"){
+ $ret->{"time"} = Timezone->GetDateTime(YaST::YCP::Boolean(1),YaST::YCP::Boolean(0));
+ }
+ if ($args->{"timezone"} eq "true"){
+ $ret->{"timezone"} = Timezone->timezone;
+ }
+ return $ret;
+}
+
+BEGIN{$TYPEINFO{Write} = ["function",
+ "boolean",["map","string","string"]];
+}
+sub Write {
+ my $self = shift;
+ my $args = shift;
+ Timezone->Read();
+ if (defined $args->{"utcstatus"}){
+ if (Timezone->utc_only()){
+ #do nothink as utc cannot be change
+ } elsif ($args->{"utcstatus"} eq "UTC") {
+ Timezone->hwclock("-u");
+ } else {
+ Timezone->hwclock("--localtime");
+ }
+ }
+ if (defined $args->{"timezone"}){
+ Timezone->Set($args->{"timezone"},YaST::YCP::Boolean(1));
+ }
+ if (defined $args->{"currenttime"}){
+#format yyyy-dd-mm - hh:mm:ss
+ if ($args->{"currenttime"} =~ m/(\d+)-(\d+)-(\d+) - (\d+):(\d+):(\d+)/)
+ {
+ Timezone->SetTime(int($1),int($3),int($2),int($4),int($5),int($6));
+ }
+ }
+
+ Timezone->Save();
+ return 1;
+}
+
+1;
Modified: branches/SuSE-Code-11-SP1-Branch/country/yast2-country.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/country/yast2-country.spec.in?rev=58866&r1=58865&r2=58866&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/country/yast2-country.spec.in (original)
+++ branches/SuSE-Code-11-SP1-Branch/country/yast2-country.spec.in Thu Oct 1 12:29:48 2009
@@ -1,6 +1,12 @@
@HEADER-COMMENT@
@HEADER@
+Group: System/YaST
+License: GPL v2 or later
+#policy files for YaPI dbus interface
+Source1: org.opensuse.yast.modules.yapi.time.policy
+Source2: org.opensuse.yast.modules.yapi.language.policy
+
BuildRequires: perl-XML-Writer update-desktop-files yast2-devtools yast2-testsuite yast2 yast2-perl-bindings
Requires: yast2-trans-stats yast2-perl-bindings timezone
# XVersion.ycp
@@ -39,10 +45,12 @@
Provides: y2t_inst-environment
Obsoletes: y2t_inst-environment
-Summary: Setting the keyboard, language and time zone
-Group: System/YaST
+Summary: YaST2 - Country Settings (Language, Keyboard, and Timezone)
%description
+Country specific data and configuration modules (language, keyboard,
+timezone) for yast2.
+
-
@PREP@
@@ -55,6 +63,11 @@
rm -f $RPM_BUILD_ROOT@desktopdir@/keyboard.desktop
%endif
+# Policies
+mkdir -p $RPM_BUILD_ROOT/usr/share/PolicyKit/policy
+install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/usr/share/PolicyKit/policy/
+install -m 0644 %SOURCE2 $RPM_BUILD_ROOT/usr/share/PolicyKit/policy/
+
@CLEAN@
# common
@@ -65,6 +78,9 @@
@moduledir@/Keyboard.y*
@moduledir@/Timezone.y*
@moduledir@/XLibAPI.pm
+%dir @moduledir@/YaPI
+@moduledir@/YaPI/TIME.pm
+@moduledir@/YaPI/LANGUAGE.pm
@clientdir@/*.ycp
@ydatadir@/*.ycp
@yncludedir@/keyboard/
@@ -76,9 +92,10 @@
%endif
@desktopdir@/yast-language.desktop
@desktopdir@/timezone.desktop
+%attr(644,root,root) %config /usr/share/PolicyKit/policy/org.opensuse.yast.modules.yapi.*.policy
%package data
-Summary: Data files for country-related settings
+Summary: YaST2 - Data files for Country settings
Group: System/YaST
%description data
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org