diff options
author | carlosg <carlosg> | 2006-05-16 15:03:57 +0000 |
---|---|---|
committer | carlosg <carlosg> | 2006-05-16 15:03:57 +0000 |
commit | d2aa1ae17071ea6289bead36e7a27613e535545c (patch) | |
tree | fb89b28bf5ee31c4d38691815facc8788629f5c9 /TimeConfig.pm | |
parent | e9b940071d7c926a6be6bb2aca0e38b2bddadbb2 (diff) |
2006-05-15 Carlos Garnacho Parro <carlosg@gnome.org>
* Merged the waiting-the-dbus branch into HEAD
* configure.in, Makefile.am, autogen.sh: bump to 1.9.0, do not use
translations (no longer needed) and fix references to the new .pc file
* GroupsConfig.pm, HostsConfig.pm, IfacesConfig.pm, NFSConfig.pm,
NTPConfig.pm, SMBConfig.pm, ServicesConfig.pm, ServicesList.pm,
SharesList.pm, SystemToolsBackends.pl.in, TimeConfig.pm,
UsersConfig.pm, org.freedesktop.SystemToolsBackends.service.in,
system-tools-backends-2.0.pc.in, test-backends, Init/Services.pm,
Init/ServicesList.pm, Network/Hosts.pm, Network/Ifaces.pm,
Shares/Exports.pm, Shares/NFS.pm, Shares/SMB.pm, Time/NTP.pm,
Time/TimeDate.pm, Users/Groups.pm, Users/Shells.pm, Users/Users.pm,
Utils/Backend.pm, Utils/File.pm, Utils/Monitor.pm, Utils/Parse.pm,
Utils/Platform.pm, Utils/Replace.pm, Utils/Report.pm, Utils/Util.pm,
Utils/XML.pm: Added/refactored files, replace the functionality in
the older *.pl.in files
* boot-conf.in, boot-grub.pl.in, boot-lilo.pl.in, boot-yaboot.pl.in,
boot.pl.in, file.pl.in, general.pl.in, network-conf.in, network.pl.in,
parse.pl.in, platform.pl.in, replace.pl.in, report.pl.in,
service-list.pl.in, service.pl.in, services-conf.in, share.pl.in,
shares-conf.in, system-tools-backends.pc.in, time-conf.in,
users-conf.in, util.pl.in, xml.pl.in: Functional removed files,
they've been replaced with the files above.
* add_amp.sh, debug.pl.in, dhcpd-conf.in, dhcpd.pl.in, disks-conf.in,
display-conf.in, filesys.pl.in, font-conf.in, font.pl.in,
gen-reportcode-list.sh, guess_system.sh, hardware-conf.in,
internetsharing-conf.in, ishare.pl.in, media.pl.in, memory-conf.in,
mouse-conf.in, option.pl, package-conf.in, partition.pl.in,
perldoc.pl, print-conf.in, print.pl.in, process.pl.in,
removable-media.pl.in, rhprinterdb2gstxml.pl, test.pl,
tokenizer.pl.in, type1inst, x.pl.in: Bunch of unused files (or used in
unstable tools), if/when they prove their usefulness, they'll be added
back, but for now they'd better be in the Attic.
Diffstat (limited to 'TimeConfig.pm')
-rw-r--r-- | TimeConfig.pm | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/TimeConfig.pm b/TimeConfig.pm new file mode 100644 index 0000000..05d06e2 --- /dev/null +++ b/TimeConfig.pm @@ -0,0 +1,66 @@ +#-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +# DBus object for the Time/Date configuration +# +# Copyright (C) 2005 Carlos Garnacho +# +# Authors: Carlos Garnacho Parro <carlosg@gnome.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +package TimeConfig; + +use base qw(Net::DBus::Object); +use Net::DBus::Exporter ($Utils::Backend::DBUS_PREFIX); +use Utils::Backend; +use Time::TimeDate; + +my $OBJECT_NAME = "TimeConfig"; +my $OBJECT_PATH = "$Utils::Backend::DBUS_PATH/$OBJECT_NAME"; + +sub new +{ + my $class = shift; + my $service = shift; + my $self = $class->SUPER::new ($service, $OBJECT_PATH); + + bless $self, $class; + +# Utils::Monitor::monitor_files (&Users::Groups::get_files (), +# $self, $OBJECT_NAME, "changed"); + + return $self; +} + +dbus_method ("get", [], [ "int32", "int32", "int32", "int32", "int32", "int32", "string" ]); +dbus_method ("set", [ "int32", "int32", "int32", "int32", "int32", "int32", "string" ], []); +dbus_signal ("changed", []); + +sub get +{ + my ($self) = @_; + my $config; + + return Time::TimeDate::get (); +} + +sub set +{ + my ($self, @config) = @_; + + Time::TimeDate::set (@config); +} + +1; |