summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretienne2006-10-06 08:52:53 +0000
committeretienne2006-10-06 08:52:53 +0000
commite1d8100a9f6913dff978511616810aa8f672ad87 (patch)
tree79c6c862a5073272afaa93a5a8832b52079f91f4
parent0fb650db658e3180cd7b58884cab07ce6743f586 (diff)
downloadivymon-e1d8100a9f6913dff978511616810aa8f672ad87.zip
ivymon-e1d8100a9f6913dff978511616810aa8f672ad87.tar.gz
ivymon-e1d8100a9f6913dff978511616810aa8f672ad87.tar.bz2
ivymon-e1d8100a9f6913dff978511616810aa8f672ad87.tar.xz
Meilleure gestion de la barre de progression de chargement de fichier.
-rwxr-xr-xsrc/ivymon49
1 files changed, 25 insertions, 24 deletions
diff --git a/src/ivymon b/src/ivymon
index 406769e..4030feb 100755
--- a/src/ivymon
+++ b/src/ivymon
@@ -2162,32 +2162,33 @@ sub loadfile {
} # end loadfile
+#______
sub stepsnumber {
- my $step = 0;
- my $timefound;
- my $lc;
- # select loading mode
- # if the 1rst message contains a time field, a dialog window
- # will be displayed in order to select replay mode or simple
- # display mode.
- while(<IN>) {
- chomp;
- next if (/^applications=/ or /^(marker\d+)$/);
- if (/^messages_number=(.*)/) {
- $step = int($1/10);
- next;
- }
- my ($sender, $message) = split(/\s+/, $_, 2);
- $timefound = 1 if $message =~ /^(\d[\d\.]+\d)\s+.*/;
- last if $step;
- $lc++;
- }
- $step = int($lc/10) unless $step;
- $progressbar->configure(-to => $step*10);
- seek(IN, 0, 0);
- return ($step, $timefound);
-
+ my $step = 0;
+ my $timefound;
+ my $lc = 0;
+ # select loading mode
+ # if the 1rst message contains a time field, a dialog window
+ # will be displayed in order to select replay mode or simple
+ # display mode.
+
+ # get lines number and test if exists time field
+ while(<IN>) {
+ chomp;
+ next if (/^applications=/ or /^(marker\d+)$/ or /^(messages_number=)/
+ or /^\#/);
+ my ($sender, $message) = split(/\s+/, $_, 2);
+ if ($message =~ /^(\d[\d\.]+\d)\s+.*/) {
+ $timefound = 1;
+ }
+ $lc++;
+ }
+ $step = int($lc/10);
+ $progressbar->configure(-to => $step*10);
+ seek(IN, 0, 0);
+ return ($step, $timefound);
+
} # end stepsnumber