summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2004-08-30 08:26:34 +0000
committerDaouda Lo <daouda@mandriva.com>2004-08-30 08:26:34 +0000
commit7315a4c5466cfe644a7243c8714eeae24858e83d (patch)
tree9243293670538dd2f6302fc3cfaffdd12ba08510
parent5b9ae3ea17568d687c196f20b5989b0426632155 (diff)
downloaddrakx-7315a4c5466cfe644a7243c8714eeae24858e83d.tar
drakx-7315a4c5466cfe644a7243c8714eeae24858e83d.tar.gz
drakx-7315a4c5466cfe644a7243c8714eeae24858e83d.tar.bz2
drakx-7315a4c5466cfe644a7243c8714eeae24858e83d.tar.xz
drakx-7315a4c5466cfe644a7243c8714eeae24858e83d.zip
- launch net_monitor once (test if there's a running net_monitor before)
-rw-r--r--perl-install/standalone/net_applet10
1 files changed, 4 insertions, 6 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 330bd84bb..5f7627904 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -14,7 +14,6 @@ use ugtk2 qw(:create :helpers :wrappers);
my ($eventbox, $img);
my ($menu, $timeout);
-my $raisedwindow = 0;
my $onstartupfile = "$ENV{HOME}/.net_applet";
add_icon_path("/usr/share/libDrakX/pixmaps/");
# Allow multiple instances, but only one per user:
@@ -54,11 +53,10 @@ gtkadd(my $icon = Gtk2::TrayIcon->new("Net_Applet"),
)
);
$eventbox->signal_connect(button_press_event => sub {
- if (!$raisedwindow) {
- if ($_[1]->button == 1) {
- $raisedwindow = 1; netMonitor()
- }
- }
+ if ($_[1]->button == 1) {
+ my @nm_pid = `ps -u $ENV{USER}` =~ /net_monitor/;
+ @nm_pid > 1 and netMonitor()
+ }
$_[1]->button == 3 && $menu and $menu->popup(undef, undef, undef, undef, $_[1]->button, $_[1]->time);
});
my ($opt) = @ARGV;