summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoretienne2007-12-27 14:02:33 +0000
committeretienne2007-12-27 14:02:33 +0000
commit07ee868777ce74809ff7359913ae5eeb39a10980 (patch)
treef992dcd7fe7b62b51e80e6af5ed09041d6c07eb2 /src
parent735eed5c2319560db4035dda8922dbbbd0377b9c (diff)
downloadivycontrolpanel-07ee868777ce74809ff7359913ae5eeb39a10980.zip
ivycontrolpanel-07ee868777ce74809ff7359913ae5eeb39a10980.tar.gz
ivycontrolpanel-07ee868777ce74809ff7359913ae5eeb39a10980.tar.bz2
ivycontrolpanel-07ee868777ce74809ff7359913ae5eeb39a10980.tar.xz
Fix : quand on tuait un agent dont le voyant \ufffdtait rouge, celui restait rouge
au lieu de passer noir.
Diffstat (limited to 'src')
-rw-r--r--src/Agent.pm17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Agent.pm b/src/Agent.pm
index 9e2e6c8..44c72ff 100644
--- a/src/Agent.pm
+++ b/src/Agent.pm
@@ -190,21 +190,33 @@ sub on {
sub off {
my $self = shift;
$self->{status} = 0;
+ $self->stopPbAnim;
$self->{led}->configure(-image => $off_img);
} # end off
# graphical effect when a know agent has a ping problem (latency)
+
+sub stopPbAnim {
+
+ my $self = shift;
+ if ($self->{afterid}) {
+ $mw->afterCancel($self->{afterid});
+ undef $self->{afterid};
+ }
+
+}
+
sub pb {
my $self = shift;
$self->{status} = 2;
$self->{led}->configure(-image => $pb_img);
my $i = 0;
my $id;
- $id = $mw->repeat(100, sub {
+ $self->{afterid} = $mw->repeat(100, sub {
if ($i == 4) {
- $mw->afterCancel($id);
+ $self->stopPbAnim;
} elsif ($i % 2 == 0) {
$self->{led}->configure(-image => $on_img);
} else {
@@ -364,6 +376,7 @@ sub _cbOnPress {
$self->{label}->configure(-foreground => $hlbg);
if ($self->{status} > 0) {
IvyIO::kill($self->{appname});
+ $self->StopPbAnim;
$mw->after(400, sub {$self->{label}->configure(-foreground => $fg);});
} elsif ($self->{command}) {
my ($x, $y) = ($self->{label}->rootx, $self->{label}->rooty);