~ubuntu-branches/ubuntu/intrepid/system-tools-backends/intrepid

1.1.2 by Daniel Holbach
Import upstream version 1.9.1
1
#-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
3
# DBus object for the SMB 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 SMBConfig;
24
1.1.11 by Sebastien Bacher
Import upstream version 2.1.0
25
use base qw(StbObject);
1.1.2 by Daniel Holbach
Import upstream version 1.9.1
26
use Net::DBus::Exporter ($Utils::Backend::DBUS_PREFIX);
27
use Shares::SMB;
28
29
my $OBJECT_NAME = "SMBConfig";
30
my $OBJECT_PATH = "$Utils::Backend::DBUS_PATH/$OBJECT_NAME";
1.1.11 by Sebastien Bacher
Import upstream version 2.1.0
31
my $format = [[ "array", [ "struct", "string", "string", "string", "int32", "int32", "int32", "int32" ]],
32
              "string", "string", "int32", "string" ];
1.1.2 by Daniel Holbach
Import upstream version 1.9.1
33
34
sub new
35
{
36
  my $class   = shift;
1.1.11 by Sebastien Bacher
Import upstream version 2.1.0
37
  my $self    = $class->SUPER::new ($OBJECT_PATH, $OBJECT_NAME);
1.1.2 by Daniel Holbach
Import upstream version 1.9.1
38
39
  bless $self, $class;
40
1.1.11 by Sebastien Bacher
Import upstream version 2.1.0
41
#  Utils::Monitor::monitor_files (&Shares::SMB::get_distro_smb_file (),
42
#                                 $self, $OBJECT_NAME, "changed");
1.1.2 by Daniel Holbach
Import upstream version 1.9.1
43
  return $self;
44
}
45
1.1.11 by Sebastien Bacher
Import upstream version 2.1.0
46
dbus_method ("get", [], $format);
47
dbus_method ("set", $format, []);
48
#dbus_signal ("changed", []);
1.1.2 by Daniel Holbach
Import upstream version 1.9.1
49
50
sub get
51
{
52
  my ($self) = @_;
1.1.11 by Sebastien Bacher
Import upstream version 2.1.0
53
  $self->SUPER::reset_counter ();
1.1.2 by Daniel Holbach
Import upstream version 1.9.1
54
55
  return &Shares::SMB::get ();
56
}
57
58
sub set
59
{
60
  my ($self, @config) = @_;
1.1.11 by Sebastien Bacher
Import upstream version 2.1.0
61
  $self->SUPER::reset_counter ();
1.1.2 by Daniel Holbach
Import upstream version 1.9.1
62
63
  &Shares::SMB::set (@config);
64
}
65
1.1.11 by Sebastien Bacher
Import upstream version 2.1.0
66
my $config = SMBConfig->new ();
67
1.1.2 by Daniel Holbach
Import upstream version 1.9.1
68
1;