summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/net_applet
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-06-22 06:08:29 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-06-22 06:08:29 +0000
commit137dfbb8619e52fdd5a1d71246e9673a89aae0ad (patch)
treee7bebc0148d01456692ef6c5a9a02dec1fa654de /perl-install/standalone/net_applet
parentf2e41431590d656a5fd3892eddea59e54e62e152 (diff)
downloaddrakx-backup-do-not-use-137dfbb8619e52fdd5a1d71246e9673a89aae0ad.tar
drakx-backup-do-not-use-137dfbb8619e52fdd5a1d71246e9673a89aae0ad.tar.gz
drakx-backup-do-not-use-137dfbb8619e52fdd5a1d71246e9673a89aae0ad.tar.bz2
drakx-backup-do-not-use-137dfbb8619e52fdd5a1d71246e9673a89aae0ad.tar.xz
drakx-backup-do-not-use-137dfbb8619e52fdd5a1d71246e9673a89aae0ad.zip
perl_checker fixes
Diffstat (limited to 'perl-install/standalone/net_applet')
-rw-r--r--perl-install/standalone/net_applet26
1 files changed, 13 insertions, 13 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 0875f6c83..265664c17 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -2,19 +2,20 @@
#use strict;
use lib qw(/usr/lib/libDrakX);
+use c;
use common;
use Digest::MD5;
use Gtk2::TrayIcon;
-eval { require ugtk2; ugtk2->import(qw(:all)); require Gtk2::Pango; };
+eval { require ugtk2; ugtk2->import(qw(:all)); require Gtk2::Pango };
if ($@) {
print "This program cannot be run in console mode.\n";
c::_exit(0); #- skip ugtk2::END
}
my ($eventbox, $img);
-my ($menu, $timeout);
+my ($menu, $_timeout);
my $raisedwindow = 0;
my $onstartupfile = "$ENV{HOME}/.net_applet";
add_icon_path("/usr/share/libDrakX/pixmaps/");
@@ -82,14 +83,14 @@ sub shouldStart() {
sub md5file {
my @md5;
foreach my $file (@_) {
- open(FILE, $file) or do { print STDERR "Can't open '$file': $!"; push @md5, "" };
- binmode(FILE);
- push @md5, Digest::MD5->new->addfile(*FILE)->hexdigest;
- close(FILE);
+ open(my $FILE, $file) or do { print STDERR "Can't open '$file': $!"; push @md5, "" };
+ binmode($FILE);
+ push @md5, Digest::MD5->new->addfile($FILE)->hexdigest;
+ close($FILE);
}
return wantarray() ? @md5 : $md5[0];
}
-sub netMonitor {
+sub netMonitor() {
system("/usr/sbin/net_monitor --testing");
checkNetwork()
}
@@ -104,7 +105,7 @@ sub checkNetwork {
go2State('connected', $h{GATEWAYDEV})
} else { go2State('disconnected', '') }
} else { die "No Gatewaydev defined" }
- if ($new_md5 ne $current_md5) { exec("$prog_name") };
+ if ($new_md5 ne $current_md5) { exec($prog_name) };
}
sub getIP {
my ($interface) = shift;
@@ -114,25 +115,24 @@ sub getIP {
return wantarray() ? @ip : $ip[0];
}
sub cronNetwork {
- $timeout = Glib::Timeout->add(60*1000, sub {
+ $_timeout = Glib::Timeout->add(60*1000, sub {
checkNetwork();
1;
});
}
sub go2State {
- $menu && $menu->destroy;
+ $menu and $menu->destroy;
$menu = setState(@_)
}
sub setState {
my ($state_type, $interface) = @_;
my $checkmi;
my $arr = $appletstate{$state_type}{menu};
- my $tmp = gtkcreate_pixbuf($appletstate{$state_type}{colour}->[0]);
+ my $tmp = gtkcreate_pixbuf($appletstate{$state_type}{colour}[0]);
$img->set_from_pixbuf($tmp);
- gtkset_tip(new Gtk2::Tooltips, $eventbox, formatAlaTeX($appletstate{$state_type}{tt}->[0] . $interface));
+ gtkset_tip(new Gtk2::Tooltips, $eventbox, formatAlaTeX($appletstate{$state_type}{tt}[0] . $interface));
my $menu = Gtk2::Menu->new;
foreach (@$arr) {
- my $l = $actions{$_}{name};
$menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label($actions{$_}{name})), activate => $actions{$_}{launch}));
}
$menu->append(gtkshow(Gtk2::SeparatorMenuItem->new));