diff options
-rwxr-xr-x | logdrake | 118 |
1 files changed, 54 insertions, 64 deletions
@@ -162,34 +162,26 @@ fill_tree (""); -#{ -# no strict 'refs'; -# map { ${$_ . "1"} = $i++ } qw(a b c); -# -# print join(" ", map { ${$_ . "1"} = $i++ } qw(a b c)), "\n"; -#} -#print join(" ", map { ${$foo::{$_ . "1"}} } qw(a b c)), "\n"; - #### far from window gtkadd($window, gtkpack_(new Gtk::VBox(0,5), 0, _("see your log"), 1, gtkadd(new Gtk::Frame(_("toi aussi choisi")), - gtkpack_(new Gtk::VBox(0,5), - 0, gtkpack_(new Gtk::HBox(0,5), - 0, _("matching"), - 1, $e_yes = new Gtk::Entry(), - 0, _("not matching"), - 1, $e_no = new Gtk::Entry() - ), - 0, _("tips: you can use OR"), - 0, gtkpack (new Gtk::VBox(0,5), + gtkpack__(new Gtk::VBox(0,5), + gtkpack__(new Gtk::HBox(0,5), + _("matching"), + $e_yes = new Gtk::Entry(), + _("not matching"), + $e_no = new Gtk::Entry() + ), + _("tips: you can use OR"), + gtkpack (new Gtk::VBox(0,5), map { ${"b_". $_} = new Gtk::CheckButton($files{$_}{desc}) } keys %files, - ), - 0, gtksignal_connect(new Gtk::Button(_("search")), clicked => \&search) + ), + gtksignal_connect(new Gtk::Button(_("search")), clicked => \&search) ) ), 1, gtkadd(new Gtk::Frame(_("Content of the file")), @@ -210,15 +202,50 @@ Gtk->main; # search functions #------------------------------------------------------------- sub search { - $log->backward_delete($log->get_length()); $log->freeze(); - - map { parse_file($files{$_}{file}) if ${$::{"b_". $_}}->active } keys %files; -# map { print "($files{$_}{file})\n" if ${$::{"b_". $_}}->active } keys %files; - + foreach (keys %files) { + parse_file($files{$_}{file}) if ${$::{"b_". $_}}->active + }; $log->thaw(); +} + +sub parse_file { + my $file = $_[0]; + $file =~ s/\.gz$//; + my @all=catMaybeCompressed ($file); + my $taille= @all +1; + my $i=1; + gtkadd(my $win_pb = new Gtk::Window(), + gtkpack(new Gtk::VBox(5,0), + _("please wait, parsing file : "). $files{$_}{desc}, + my $pbar = new Gtk::ProgressBar() + ) + ); + $win_pb->realize(); + $win_pb->show_all(); + my $ey= $e_yes->get_chars( 0, -1 ); + my $en= $e_no->get_chars( 0, -1 ); + $ey =~ s/ OR /\|/; + foreach (@all) { + if ($i % 10) { + $pbar->update($i/$taille); + Gtk->main_iteration while Gtk->events_pending; + } + + if (($en eq "") and ($ey eq "")) { + logcolorize($_) + } else { + if (/$ey/i and ($en eq "")) { + logcolorize($_); + } else { + logcolorize($_) if (/$ey/i and (not /$en/i)); + } + } + $i++; + } + $win_pb->destroy(); } #------------------------------------------------------------- @@ -298,46 +325,6 @@ sub select_item { $log->thaw(); } -sub parse_file { - print "$_\n"; -return; - $file =~ s/\.gz$//; - my @all=catMaybeCompressed ($file); - my $taille= @all +1; - my $i=1; - gtkadd(my $win_pb = new Gtk::Window(), - gtkpack(new Gtk::VBox(5,0), - _("please wait"), - my $pbar = new Gtk::ProgressBar() - ) - ); - $win_pb->realize(); - $win_pb->show_all(); - my $ey= $e_yes->get_chars( 0, -1 ); - my $en= $e_no->get_chars( 0, -1 ); - $ey =~ s/ OR /\|/; - - foreach (@all) { - if ($i % 10) { - $pbar->update($i/$taille); - Gtk->main_iteration while Gtk->events_pending; - } - - if (($en eq "") and ($ey eq "")) { - logcolorize($_) - } else { - if (/$ey/i and ($en eq "")) { - logcolorize($_); - } else { - # eq =! "" - logcolorize($_) if (/$ey/i and (not /$en/i)); - } - } - $i++; - } - $win_pb->destroy(); -} - sub log_output { $log->insert($_[2],$_[0], undef,$_[1]); } @@ -449,6 +436,9 @@ sub destroy_window { # log # $Log$ +# Revision 1.11 2001/08/01 19:06:05 yduret +# pour boblack +# # Revision 1.10 2001/08/01 17:30:21 yduret # added mapping.. # |