summaryrefslogtreecommitdiffstats
path: root/lib/network
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-04-30 19:24:51 +0000
committerOlivier Blin <oblin@mandriva.com>2008-04-30 19:24:51 +0000
commitf332e5d67fa625a1948bd2b8c2b6beda127cf516 (patch)
tree73f894873c5809b6700ac5a1c1fbfe18aa25b188 /lib/network
parent908cafda2c2585220d0b5ce222dc09ff8460874d (diff)
downloaddrakx-net-f332e5d67fa625a1948bd2b8c2b6beda127cf516.tar
drakx-net-f332e5d67fa625a1948bd2b8c2b6beda127cf516.tar.gz
drakx-net-f332e5d67fa625a1948bd2b8c2b6beda127cf516.tar.bz2
drakx-net-f332e5d67fa625a1948bd2b8c2b6beda127cf516.tar.xz
drakx-net-f332e5d67fa625a1948bd2b8c2b6beda127cf516.zip
add support for using dbus-send to select a network (will require some way to get network IDs first)
Diffstat (limited to 'lib/network')
-rw-r--r--lib/network/monitor.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/network/monitor.pm b/lib/network/monitor.pm
index fb9247a..43e9e78 100644
--- a/lib/network/monitor.pm
+++ b/lib/network/monitor.pm
@@ -105,7 +105,16 @@ sub list_wireless {
sub select_network {
my ($o, $id) = @_;
my $method = 'SelectNetwork';
- $o->call_method($method, Net::DBus::dbus_uint32($id));
+ if ($o) {
+ $o->call_method($method, Net::DBus::dbus_uint32($id));
+ } else {
+ require run_program;
+ run_program::run("dbus-send", "--system", "--type=method_call",
+ "--dest=" . $monitor_service,
+ $monitor_path,
+ $monitor_interface . '.' . $method,
+ 'uint32:' . $id);
+ }
}
1;