home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / system-tools-backends-2.0 / scripts / TimeConfig.pm < prev    next >
Encoding:
Perl POD Document  |  2006-08-14  |  1.8 KB  |  67 lines

  1. #-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  
  3. # DBus object for the Time/Date configuration
  4. #
  5. # Copyright (C) 2005 Carlos Garnacho
  6. #
  7. # Authors: Carlos Garnacho Parro  <carlosg@gnome.org>
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Library General Public License as published
  11. # by the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. # GNU Library General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Library General Public License
  20. # along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  22.  
  23. package TimeConfig;
  24.  
  25. use base qw(Net::DBus::Object);
  26. use Net::DBus::Exporter ($Utils::Backend::DBUS_PREFIX);
  27. use Utils::Backend;
  28. use Time::TimeDate;
  29.  
  30. my $OBJECT_NAME = "TimeConfig";
  31. my $OBJECT_PATH = "$Utils::Backend::DBUS_PATH/$OBJECT_NAME";
  32.  
  33. sub new
  34. {
  35.   my $class   = shift;
  36.   my $service = shift;
  37.   my $self    = $class->SUPER::new ($service, $OBJECT_PATH);
  38.  
  39.   bless $self, $class;
  40.  
  41. #  Utils::Monitor::monitor_files (&Users::Groups::get_files (),
  42. #                                 $self, $OBJECT_NAME, "changed");
  43.  
  44.   return $self;
  45. }
  46.  
  47. dbus_method ("get", [], [ "int32", "int32", "int32", "int32", "int32", "int32", "string" ]);
  48. dbus_method ("set", [ "int32", "int32", "int32", "int32", "int32", "int32", "string" ], []);
  49. dbus_signal ("changed", []);
  50.  
  51. sub get
  52. {
  53.   my ($self) = @_;
  54.   my $config;
  55.  
  56.   return Time::TimeDate::get ();
  57. }
  58.  
  59. sub set
  60. {
  61.   my ($self, @config) = @_;
  62.  
  63.   Time::TimeDate::set (@config);
  64. }
  65.  
  66. 1;
  67.