diff options
-rwxr-xr-x | control-center3 | 109 |
1 files changed, 91 insertions, 18 deletions
diff --git a/control-center3 b/control-center3 index 54e8a809..b49a1c78 100755 --- a/control-center3 +++ b/control-center3 @@ -104,7 +104,7 @@ $vbox_global->pack_start($hpane_global, 1, 1, 0); $hpane_global->border_width(5); my $scrolled_global = new Gtk::ScrolledWindow; $scrolled_global->set_policy('automatic','automatic'); -$scrolled_global->set_usize(190, 0); +$scrolled_global->set_usize(195, 0); $scrolled_global->set_name("icons_back"); $hpane_global->pack1($scrolled_global,0,1); @@ -187,9 +187,9 @@ sub draw_exposed { 0, 0, 0, 0, 540, 460); my $style = new Gtk::Style; my $style_dflt = new Gtk::Style; - $style->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--25-*-100-100-p-*-iso8859-*,*-r-*"))); - $pix->draw_string($style->font, $darea1->style->black_gc, 100, 170, _("The Mandrake Control Center") ); - $pix->draw_string($style_dflt->font, $darea1->style->black_gc, 120, 190, ("The place where you can configure your Mandrake Box") ); + $style->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--17-*-100-100-p-*-iso8859-*,*-r-*"))); +# $pix->draw_string($style->font, $darea1->style->black_gc, 100, 170, _("The Mandrake Control Center") ); + $pix->draw_string($style->font, $darea1->style->black_gc, 73, 170, ("The place where you can configure your Mandrake Box") ); my @revtree; my @info_tree; @@ -240,9 +240,13 @@ sub about_mdk_cc { my $window_about = new Gtk::Dialog(); $window_about->set_position(1); + + my $bbox1 = new Gtk::HButtonBox; + $window_about->action_area->pack_start($bbox1,0,0,0); + my $button = new Gtk::Button(_("Close")); $button->signal_connect_object("clicked",$window_about => 'destroy'); - $window_about->action_area->pack_start($button,$true,$true,0); + $bbox1->add($button); my $label = new Gtk::Label( _("Mandrake Control Center 1.0 \n Copyright (C) 2001 Mandrakesoft SA\n") ); my $style1 = new Gtk::Style; @@ -261,14 +265,18 @@ sub splash_warning my ($label) = @_; my $win_about = new Gtk::Dialog(); $win_about->set_position(1); + + my $bbox1 = new Gtk::HButtonBox; + $win_about->action_area->pack_start($bbox1,0,0,0); + my $button = new Gtk::Button(_("Close")); - $button->signal_connect_object("clicked",$window_about => 'destroy'); - $win_about->action_area->pack_start($button,$true,$true,0); - + $button->signal_connect_object("clicked",$win_about => 'destroy'); + $bbox1->add($button); + my $lab = new Gtk::Label($label); my $style1 = new Gtk::Style; - $style1->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*"))); - $lab->set_style($style1); +# $style1->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*"))); +# $lab->set_style($style1); $win_about->vbox->pack_start( $lab, $true, $true, 0 ); $win_about->show_all(); @@ -279,30 +287,69 @@ sub connect_to_site { my ($link)=@_; my $browser="netscape"; - if (system("$browser -geometry 600x800+10+10 -no-about-splash $link ")) - { - splash_warning(_("You seems to not have Netscape installed")); - } + splash_warning(_("We won't launch a browser in root mode. This will be corrected, be patient.")); +# if (system("$browser -geometry 600x800+10+10 -no-about-splash $link ")) +# { +# splash_warning(_("You don't seem to have Netscape installed")); +# } } +my $treeitem_old; +my $left = sub { &$next_child($_[0]->parent, 0); }; +my $right = sub { + print "RRRRRRRRRR\n"; + my ($c) = @_; + if ($c->subtree) { + $c->expand; + ($c->subtree->children)[0]; + } else { + $c; + } +}; +my $down = sub { + my ($c) = @_; + return &$right($c) if ref $c eq "Gtk::TreeItem" && $c->subtree && $c->expanded; + + if (my $n = &$next_child($c, 1)) { + $n; + } else { + return if ref $c->parent ne 'Gtk::Tree'; + &$down($c->parent); + } +}; +my $up = sub { + my ($c) = @_; + if (my $n = &$next_child($c, -1)) { + $n = ($n->subtree->children)[-1] while ref $n eq "Gtk::TreeItem" && $n->subtree && $n->expanded; + $n; + } else { + return if ref $c->parent ne 'Gtk::Tree'; + &$left($c); + } +}; + sub create_tree_item { my ($parent_tree, $label, $pixmap, $tree_depth_max) =@_; - + my ($treeitem, $treebox, $new_subtree); - + $treeitem = new Gtk::TreeItem(); $treebox = xpm_label_box($window_global,$pixmap,$label); $treeitem->add($treebox); $treebox->show(); if ($tree_depth_max == 0) { +# $treeitem->signal_connect('clicked', sub { exec_treeitem($label, $tree_exec{$label});}); $treeitem->signal_connect('select', sub { exec_treeitem($label, $tree_exec{$label});}); } else { - $treeitem->signal_connect('select', sub { $treeitem->expand(); $treeitem->deselect(); }); + $treeitem->signal_connect('select', sub { $treeitem_old and $$treeitem_old->collapse(); $treeitem->expand(); $treeitem_old=\$treeitem; + #$treeitem->deselect(); + }); + $treeitem->signal_connect('deselect', sub { $treeitem->collapse(); }); } $parent_tree->append($treeitem); $treeitem->show(); - + if ($tree_depth_max) { $tree_depth_max-- ; $new_subtree= new Gtk::Tree(); @@ -310,6 +357,32 @@ sub create_tree_item $new_subtree->ref(); unshift(@treeitem_sub, $new_subtree); } + + $treeitem->signal_connect(key_press_event => sub { + my (undef, $e) = @_; + local $_ = chr ($e->{keyval}); + + if ($e->{keyval} > 0x100) { + my $n; + $n = &$left($treeitem) if /[Q´\x96]/; + print "RRRRRRRR\n"; + $n = &$right($treeitem) if /[S¶\x98]/; + print "RRRRRRRR\n"; + $n = &$up($treeitem) if /[R¸\x97]/; + $n = &$down($treeitem) if /[T²\x99]/; + if ($n) { + $n->focus('up'); + $treeitem->signal_emit_stop("key_press_event"); + } + $treeitem->expand if /[+«]/; + $treeitem->collapse if /[-\xad]/; + do { + $treeitem->expanded ? $treeitem->collapse : $treeitem->expand; + $treeitem->signal_emit_stop("key_press_event"); + } if /[\r\x8d]/; + } + 1; + }); } sub xpm_label_box |