summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-09-26 06:38:18 +0000
committerOlivier Blin <oblin@mandriva.org>2004-09-26 06:38:18 +0000
commitd94f11b6066aa854076e91dceee8b104bfb12508 (patch)
tree44296251c9477a5048dcbaa4b47e90e51815a5f2 /perl-install/standalone
parente3222e8ba05fa6462f0264797a502ef7aec1759f (diff)
downloaddrakx-d94f11b6066aa854076e91dceee8b104bfb12508.tar
drakx-d94f11b6066aa854076e91dceee8b104bfb12508.tar.gz
drakx-d94f11b6066aa854076e91dceee8b104bfb12508.tar.bz2
drakx-d94f11b6066aa854076e91dceee8b104bfb12508.tar.xz
drakx-d94f11b6066aa854076e91dceee8b104bfb12508.zip
(go2state) do not destroy/re-create menu if state hasn't changed, or
else the menu may disappear without any reason
Diffstat (limited to 'perl-install/standalone')
-rw-r--r--perl-install/standalone/net_applet9
1 files changed, 6 insertions, 3 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 35ef4703e..9bcc3bd3e 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -14,7 +14,7 @@ use Gtk2::TrayIcon;
use ugtk2 qw(:create :helpers :wrappers);
my ($eventbox, $img);
-my ($menu, $timeout);
+my ($current_state, $menu, $timeout);
my $onstartupfile = "$ENV{HOME}/.net_applet";
add_icon_path("/usr/share/libDrakX/pixmaps/");
# Allow multiple instances, but only one per user:
@@ -131,8 +131,11 @@ sub cronNetwork() {
}
sub go2State {
my ($state_type, $interface) = @_;
- $menu and $menu->destroy;
- $menu = setState($state_type, $interface);
+ if ($current_state ne $state_type) {
+ $current_state = $state_type;
+ $menu and $menu->destroy;
+ $menu = setState($state_type, $interface);
+ }
}
sub setState {
my ($state_type, $interface) = @_;