diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-10-02 18:30:05 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-10-02 18:30:05 +0000 |
commit | 3723e9f74b377fb861443d7fb47add8091744afe (patch) | |
tree | bef43d01b4260cc063858823a921d0b797277e1a /bin/net_applet | |
parent | 7c858fc73a6d872400710ef9ab61a0a4e4384a3e (diff) | |
download | drakx-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-x | bin/net_applet | 9 |
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; |