diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-10-20 16:47:13 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-10-20 16:47:13 +0000 |
commit | 48db6a78efd91232719f0a9f37dc9a9b607ca1c4 (patch) | |
tree | c4672fdae7ee73c7bea673518bbd00b676073ef8 /perl-install | |
parent | 3e112ce55d0d261931bf367e9243aedda5ae4897 (diff) | |
download | drakx-backup-do-not-use-48db6a78efd91232719f0a9f37dc9a9b607ca1c4.tar drakx-backup-do-not-use-48db6a78efd91232719f0a9f37dc9a9b607ca1c4.tar.gz drakx-backup-do-not-use-48db6a78efd91232719f0a9f37dc9a9b607ca1c4.tar.bz2 drakx-backup-do-not-use-48db6a78efd91232719f0a9f37dc9a9b607ca1c4.tar.xz drakx-backup-do-not-use-48db6a78efd91232719f0a9f37dc9a9b607ca1c4.zip |
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/help.pm | 2 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 6 | ||||
-rw-r--r-- | perl-install/my_gtk.pm | 79 |
3 files changed, 81 insertions, 6 deletions
diff --git a/perl-install/help.pm b/perl-install/help.pm index 278dd0bbf..b3423b239 100644 --- a/perl-install/help.pm +++ b/perl-install/help.pm @@ -330,7 +330,7 @@ doInstallStep => __("The packages selected are now being installed. This operation should only take a few minutes."), -configureMouse => +selectMouse => __("If DrakX failed to find your mouse, or if you want to check what it has done, you will be presented the list of mice above. diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index a79132b28..7090e6c75 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -57,9 +57,9 @@ sub selectLanguage($) { lang::lang2text($o->{lang}))); install_steps::selectLanguage($o); - $o->{useless_thing_accepted} = $o->ask_from_list_('', -"Warning no warranty", - [ __("Accept"), __("Refuse") ], "Accept") eq "Accept" or exit(1) unless $o->{useless_thing_accepted}; +#- $o->{useless_thing_accepted} = $o->ask_from_list_('', +#-"Warning no warranty", +#- [ __("Accept"), __("Refuse") ], "Accept") eq "Accept" or exit(1) unless $o->{useless_thing_accepted}; } #------------------------------------------------------------------------------ sub selectKeyboard($) { diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 7eefa8685..f0f92807b 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $border @grabbed); @ISA = qw(Exporter); %EXPORT_TAGS = ( - helpers => [ qw(create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title) ], + helpers => [ qw(create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title create_treeitem) ], wrappers => [ qw(gtksignal_connect gtkpack gtkpack_ gtkpack__ gtkappend gtkadd gtktext_insert gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_background gtkset_default_fontset) ], ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_from_list ask_file) ], ); @@ -212,7 +212,7 @@ sub create_box_with_title($@) { sub createScrolledWindow($) { my ($W) = @_; - if (ref $W eq "Gtk::Text") { + if (member(ref $W, qw(Gtk::Text)) { gtkpack_(new Gtk::HBox(0,0), 1, $W, 0, new Gtk::VScrollbar($W->vadj)); @@ -334,6 +334,81 @@ sub _create_window($$) { $o->{rwindow} = $w; } +my ($next_child, $left, $right, $up, $down); +{ + my $next_child = sub { + my ($c, $dir) = @_; + + my @childs = $c->parent->children; + + my $i; for ($i = 0; $i < @childs; $i++) { + last if $childs[$i] == $c || $childs[$i]->subtree == $c; + } + $i += $dir; + 0 <= $i && $i < @childs ? $childs[$i] : undef; + }; + $left = sub { &$next_child($_[0]->parent, 0); }; + $right = sub { + my ($c) = @_; + if ($c->subtree) { + $c->expand; + ($c->subtree->children)[0]; + } else { + $c; + } + }; + $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); + } + }; + $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_treeitem($$) { + my ($name) = @_; + + my $w = new Gtk::TreeItem($name); + $w->signal_connect(key_press_event => sub { + my (undef, $e) = @_; + local $_ = chr ($e->{keyval} & 0xff); + + if ($e->{keyval} > 0x100) { + my $n; + $n = &$left($w) if /[Q´\x96]/; + $n = &$right($w) if /[S¶\x98]/; + $n = &$up($w) if /[R¸\x97]/; + $n = &$down($w) if /[T²\x99]/; + if ($n) { + $n->focus('up'); + $w->signal_emit_stop("key_press_event"); + } + $w->expand if /[+«]/; + $w->collapse if /[-\xad]/; + do { + $w->expanded ? $w->collapse : $w->expand; + $w->signal_emit_stop("key_press_event"); + } if /[\r\x8d]/; + } + 1; + }); + $w; +} |