summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-07-13 08:46:49 +0000
committerOlivier Blin <oblin@mandriva.org>2005-07-13 08:46:49 +0000
commit0ca50afacd566c0fb1fb9326da034466fc2a9e57 (patch)
treee49a84bc1bcd18554eba51810714aa9a6419071f
parent050c4afaf710f5742782d2972223ff6d911ca4fd (diff)
downloaddrakx-0ca50afacd566c0fb1fb9326da034466fc2a9e57.tar
drakx-0ca50afacd566c0fb1fb9326da034466fc2a9e57.tar.gz
drakx-0ca50afacd566c0fb1fb9326da034466fc2a9e57.tar.bz2
drakx-0ca50afacd566c0fb1fb9326da034466fc2a9e57.tar.xz
drakx-0ca50afacd566c0fb1fb9326da034466fc2a9e57.zip
simplify
-rw-r--r--perl-install/standalone/net_applet18
1 files changed, 8 insertions, 10 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 0b4bcd79d..bb983c0b2 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -151,21 +151,19 @@ sub netMonitor() {
sub checkWireless() {
my $networks = $monitor->list_wireless;
foreach (keys %$networks) {
- my $new = !exists $wireless_networks{$_};
my $net = $wireless_networks{$_} ||= {};
- if ($new) {
- $net->{image} = Gtk2::Image->new;
- $net->{menuitem} = Gtk2::MenuItem->new;
- $net->{menuitem}->add(gtkshow(gtkpack_(Gtk2::HBox->new,
- 1, gtkset_alignment($net->{ssid_label} = Gtk2::Label->new, 0, 0),
- 0, $net->{keyring_image} = Gtk2::Image->new_from_pixbuf($pixbufs{keyring}),
- 0, $net->{level_image} = Gtk2::Image->new)));
+ put_in_hash($net, $networks->{$_});
+ unless (exists $net->{menuitem}) {
+ $net->{menuitem} = Gtk2::CheckMenuItem->new;
+ $net->{menuitem}->add(gtkpack_(gtkshow(Gtk2::HBox->new),
+ 1, gtkset_alignment($net->{ssid_label} = Gtk2::Label->new, 0, 0),
+ 0, $net->{keyring_image} = Gtk2::Image->new_from_pixbuf($pixbufs{keyring}),
+ 0, $net->{level_image} = Gtk2::Image->new));
undef $current_state; #- force menu redraw
}
- put_in_hash($net, $networks->{$_});
- my $approx_level = 20+int($net->{signal_level}/20)*20;
$net->{ssid_label}->set_text($net->{ssid} || "[$_]");
$net->{keyring_image}->visible(defined $net->{flags});
+ my $approx_level = 20 + int($net->{signal_level}/20)*20;
$net->{level_image}->set_from_pixbuf($pixbufs{link_level}{$approx_level});
}
$wireless_networks{$_}{menuitem}->visible(exists $networks->{$_}) foreach keys %wireless_networks;