summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Duret <yduret@mandriva.com>2001-07-03 08:54:43 +0000
committerYves Duret <yduret@mandriva.com>2001-07-03 08:54:43 +0000
commitf377b3baf3fea0f8899f58ba3b99519577781b33 (patch)
tree09e41575ff98b7529673ce600fe05138af4ca294
parent8e22e2464c7e1383b833eb3d21d2e7dfd01e564d (diff)
downloadcontrol-center-f377b3baf3fea0f8899f58ba3b99519577781b33.tar
control-center-f377b3baf3fea0f8899f58ba3b99519577781b33.tar.gz
control-center-f377b3baf3fea0f8899f58ba3b99519577781b33.tar.bz2
control-center-f377b3baf3fea0f8899f58ba3b99519577781b33.tar.xz
control-center-f377b3baf3fea0f8899f58ba3b99519577781b33.zip
powered by DrakX technologie
-rwxr-xr-xlogdrake55
1 files changed, 22 insertions, 33 deletions
diff --git a/logdrake b/logdrake
index af4e3e0a..8339e7eb 100755
--- a/logdrake
+++ b/logdrake
@@ -78,7 +78,6 @@ my @menu_items = ( { path => _("/_File"),
{ path => _("/File/_Quit"),
accelerator => _("<control>Q"),
callback => sub { $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0) } },
-
{ path => _("/_Options"),
type => '<Branch>' },
{ path => _("/Options/Test") },
@@ -128,43 +127,31 @@ my $col=$cyan;
######### font and colors end
-
-#### far from window
-
-
-my $global_vbox = new Gtk::VBox();
-$::isEmbedded or $global_vbox->pack_start (new Gtk::Label(_("see your log")), 0, 0, 0);
-
-
-### the tree
-my $tree_frame = new Gtk::Frame(_("Choose file"));
-my $tree_scrolled_win = new Gtk::ScrolledWindow();
-$tree_scrolled_win->set_usize(300, $::isEmbedded ? 0 : 175);
-$tree_frame->add($tree_scrolled_win);
-$global_vbox->pack_start($tree_frame,0,0,0 );
-$tree_scrolled_win->set_policy('automatic', 'automatic');
-
# Create root tree
my $tree = new Gtk::Tree();
my $leaf;
my $root_dir;
-$tree_scrolled_win->add_with_viewport($tree);
$tree->set_selection_mode('single');
$tree->set_view_mode('item');
fill_tree ("");
-my $log_frame = new Gtk::Frame( _("log") );
-my $log = new Gtk::Text(undef, undef);
-my $vscrollbar = new Gtk::VScrollbar( $log->vadj );
-my $log_hbox = new Gtk::HBox (0, 0);
-$log_hbox->border_width (5);
-$log_hbox->pack_start($log, 1, 1, 0);
-$log_hbox->pack_start($vscrollbar, 0, 0, 0 );
-$log_frame->add($log_hbox);
-$global_vbox->pack_start($log_frame, 0, 0, 0);
-
-### back to window
-$window->add($global_vbox);
+#### far from window
+
+
+gtkadd($window,
+ gtkpack_(new Gtk::VBox(0,5),
+ 0, _("see your log"),
+ 1, gtkadd(new Gtk::Frame(_("Choose a file")),
+ createScrolledWindow($tree)
+ ),
+ 1, gtkadd(new Gtk::Frame(_("Content of the file")),
+ createScrolledWindow(my $log = new Gtk::Text(undef, undef))
+ )
+
+ )
+ );
+$window->realize;
+
$window->show_all();
Gtk->main_iteration while Gtk->events_pending;
@@ -240,12 +227,11 @@ sub collapse_tree {
# Called whenever an item is clicked on the tree widget.
sub select_item {
- my ( $widget, $file ) = @_;
+ my ($widget, $file) = @_;
return if (-d $file);
$log->backward_delete($log->get_length());
$file =~ s/\.gz$//;
$log->freeze();
-
foreach (catMaybeCompressed ($file)){
logcolorize($_);
}
@@ -264,7 +250,7 @@ sub logcolorize {
$timestamp=$1;
@rec = split;
- log_output($cyan,$timestamp,$b); # date & time
+ log_output($cyan,$timestamp,$b); # date & time if any...
log_output(($rec[0] eq $h) ? $blue : $col,"$rec[0] ",$b); # hostname
if ($rec[1] eq "last") {
@@ -363,6 +349,9 @@ sub destroy_window {
# log
# $Log$
+# Revision 1.5 2001/07/03 08:54:43 yduret
+# powered by DrakX technologie
+#
# Revision 1.4 2001/07/02 09:47:55 yduret
# fix bug in regexp
#