summaryrefslogtreecommitdiffstats
path: root/bin/net_applet
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-10-02 18:30:05 +0000
committerOlivier Blin <oblin@mandriva.com>2008-10-02 18:30:05 +0000
commit3723e9f74b377fb861443d7fb47add8091744afe (patch)
treebef43d01b4260cc063858823a921d0b797277e1a /bin/net_applet
parent7c858fc73a6d872400710ef9ab61a0a4e4384a3e (diff)
downloaddrakx-net-3723e9f74b377fb861443d7fb47add8091744afe.tar
drakx-net-3723e9f74b377fb861443d7fb47add8091744afe.tar.gz
drakx-net-3723e9f74b377fb861443d7fb47add8091744afe.tar.bz2
drakx-net-3723e9f74b377fb861443d7fb47add8091744afe.tar.xz
drakx-net-3723e9f74b377fb861443d7fb47add8091744afe.zip
correctly initialize monitor object in draknetcenter/drakroam/net_applet so that it can be reused later
Diffstat (limited to 'bin/net_applet')
-rwxr-xr-xbin/net_applet9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/net_applet b/bin/net_applet
index 4c91f32..d20f5ed 100755
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -173,9 +173,8 @@ my %actions = (
$icon = Gtk2::StatusIcon->new;
-my ($monitor);
eval { $dbus = dbus_object::system_bus() } if !defined($global_settings{NET_APPLET_DBUS}) || text2bool($global_settings{NET_APPLET_DBUS});
-eval { $monitor = network::monitor->new($dbus) } if $dbus;
+eval { $net->{monitor} = network::monitor->new($dbus) } if $dbus;
eval {
require network::net_applet::ifw;
network::net_applet::ifw::create();
@@ -256,8 +255,8 @@ sub generate_wireless_menuitem {
0, $menuitem->{security} = Gtk2::Image->new,
));
$menuitem->{activate} = $menuitem->{widget}->signal_connect('activate' => sub {
- if ($monitor && exists $wnet->{id}) {
- eval { $monitor->select_network($wnet->{id}) };
+ if ($net->{monitor} && exists $wnet->{id}) {
+ eval { $net->{monitor}->select_network($wnet->{id}) };
$@ and err_dialog(N("Interactive Firewall"), N("Unable to contact daemon"));
} else {
run_drakroam($wnet->{ap});
@@ -280,7 +279,7 @@ sub update_wireless_item {
}
sub checkWireless() {
$wireless_device or return;
- my ($networks) = network::monitor::list_wireless($monitor);
+ my ($networks) = network::monitor::list_wireless($net->{monitor});
my $force_applet_update;
foreach (keys %$networks) {
exists $wireless_networks{$_} or $force_applet_update = 1;