diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-04-25 12:26:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-04-25 12:26:16 +0000 |
commit | 5fd2d25f56ee44f0a4f93eee0fb161879404241d (patch) | |
tree | 17c35744bbd555ccdcbb9ee319c1969e7a588157 /tools | |
parent | 0ad51b215fff27243c114a67ae0b7eea46b2cb5a (diff) | |
download | drakx-kbd-mouse-x11-5fd2d25f56ee44f0a4f93eee0fb161879404241d.tar drakx-kbd-mouse-x11-5fd2d25f56ee44f0a4f93eee0fb161879404241d.tar.gz drakx-kbd-mouse-x11-5fd2d25f56ee44f0a4f93eee0fb161879404241d.tar.bz2 drakx-kbd-mouse-x11-5fd2d25f56ee44f0a4f93eee0fb161879404241d.tar.xz drakx-kbd-mouse-x11-5fd2d25f56ee44f0a4f93eee0fb161879404241d.zip |
re-sync after the big svn loss
Diffstat (limited to 'tools')
-rw-r--r-- | tools/.perl_checker | 1 | ||||
-rwxr-xr-x | tools/XFdrake | 28 | ||||
-rwxr-xr-x | tools/keyboarddrake | 11 | ||||
-rwxr-xr-x | tools/mousedrake | 42 |
4 files changed, 29 insertions, 53 deletions
diff --git a/tools/.perl_checker b/tools/.perl_checker new file mode 100644 index 0000000..202e053 --- /dev/null +++ b/tools/.perl_checker @@ -0,0 +1 @@ +Basedir .. diff --git a/tools/XFdrake b/tools/XFdrake index a1932db..19988f3 100755 --- a/tools/XFdrake +++ b/tools/XFdrake @@ -1,7 +1,7 @@ #!/usr/bin/perl # XFdrake -# Copyright (C) 1999-2005 Mandriva (pixel@mandrakesoft.com) +# Copyright (C) 1999-2006 Mandriva (pixel@mandrakesoft.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,9 @@ use lib qw(/usr/lib/libDrakX); +# i18n: IMPORTANT: to get correct namespace (drakx-kbd-mouse-x11 instead of libDrakX) +BEGIN { unshift @::textdomains, 'drakx-kbd-mouse-x11' } + use standalone; #- warning, standalone must be loaded very first, for 'explanations' use Xconfig::main; @@ -54,7 +57,7 @@ $configure_this ||= $::auto ? 'auto_install' : 'everything'; }; if (!$::auto) { if ($rc eq 'need_restart') { - ask_for_X_restart($in); + any::ask_for_X_restart($in); } elsif ($rc eq 'need_reboot') { $in->ask_warn('', N("You need to reboot for changes to take effect")); } @@ -72,26 +75,7 @@ sub check_XFree { symlinkf("$_.standard", $f) if -l $f && -e "$f.standard"; } - my $f = "/usr/X11R6/lib/X11/rgb.txt"; #- this one is on all platform - -e $f or $in->do_pkgs->install('xorg-x11', 'xorg-x11-75dpi-fonts'); - -e $f or die "install Xorg first!\n"; + $in->do_pkgs->ensure_are_installed(['task-x11']) or $in->exit; system("mount /proc 2>/dev/null"); # ensure /proc is mounted for pci probing } - -sub ask_for_X_restart { - my ($in) = @_; - - $::isStandalone && $in->isa('interactive::gtk') or return; - - my ($wm, $pid) = any::running_window_manager(); - - if (!$wm) { - $in->ask_warn('', N("Please log out and then use Ctrl-Alt-BackSpace")); - return; - } - - $in->ask_okcancel('', N("You need to log out and back in again for changes to take effect"), 1) or return; - - any::ask_window_manager_to_logout_then_do($wm, $pid, 'killall X'); -} diff --git a/tools/keyboarddrake b/tools/keyboarddrake index 0961094..fb5d9be 100755 --- a/tools/keyboarddrake +++ b/tools/keyboarddrake @@ -2,6 +2,9 @@ use lib qw(/usr/lib/libDrakX); +# i18n: IMPORTANT: to get correct namespace (drakx-kbd-mouse-x11 instead of libDrakX) +BEGIN { unshift @::textdomains, 'drakx-kbd-mouse-x11' } + use standalone; #- warning, standalone must be loaded very first, for 'explanations' use interactive; @@ -28,11 +31,17 @@ if (my ($kb) = grep { !/^-/ } @ARGV) { choose: $in->ask_from(N("Keyboard"), N("Please, choose your keyboard layout."), - [ { val => \$keyboard->{KEYBOARD}, + [ { label => N("Keyboard layout"), + title => 1, + }, + { val => \$keyboard->{KEYBOARD}, format => sub { translate(keyboard::KEYBOARD2text($_[0])) }, list => [ keyboard::KEYBOARDs() ], type => 'list', }, + { label => N("Keyboard type"), + title => 1, + }, { val => \$keyboard->{XkbModel}, format => sub { $model2text->{$_[0]} }, separator => '|', diff --git a/tools/mousedrake b/tools/mousedrake index 2f6d0dd..0531372 100755 --- a/tools/mousedrake +++ b/tools/mousedrake @@ -2,6 +2,9 @@ use lib qw(/usr/lib/libDrakX); +# i18n: IMPORTANT: to get correct namespace (drakx-kbd-mouse-x11 instead of libDrakX) +BEGIN { unshift @::textdomains, 'drakx-kbd-mouse-x11' } + use standalone; #- warning, standalone must be loaded very first, for 'explanations' use common; @@ -22,34 +25,12 @@ my %old = %$mouse; if (!$::noauto) { my $probed_mouse = mouse::detect($modules_conf); - $mouse = $probed_mouse if !$mouse->{XMOUSETYPE} || !$probed_mouse->{unsafe}; + $mouse = $probed_mouse if !$mouse->{Protocol} || !$probed_mouse->{unsafe}; } if (!$mouse || !$::auto) { - $mouse ||= mouse::fullname2mouse("serial|Generic 2 Button Mouse"); - my $test_hbox; - my $name = $in->ask_from_treelistf('mousedrake', N("Please choose your mouse type."), '|', - sub { join '|', map { translate($_) } split '\|', $_[0] }, - [ mouse::fullnames() ], - $mouse->{type} . '|' . $mouse->{name}); - $name or $in->exit(0); - my $mouse_chosen = mouse::fullname2mouse($name); - $mouse = $mouse_chosen if !($mouse->{type} eq $mouse_chosen->{type} && $mouse->{name} eq $mouse_chosen->{name}); - - if ($mouse->{device} eq "usbmouse") { - modules::load_category($modules_conf, 'bus/usb') or die 'no usb bus found\n'; - modules::load(qw(hid mousedev usbmouse)); - } - - $mouse->{XEMU3} = 'yes' if $mouse->{nbuttons} < 3 && (!$::noauto || $in->ask_yesorno('', N("Emulate third button?"), 1)); - - $mouse->{device} = $in->ask_from_listf(N("Mouse Port"), - N("Please choose which serial port your mouse is connected to."), - \&mouse::serial_port2text, - [ mouse::serial_ports ], - $mouse->{device}, - ) || goto begin if $mouse->{type} eq 'serial'; - $test_hbox and $test_hbox->destroy; + $mouse ||= mouse::fullname2mouse('Universal|Any PS/2 & USB mice'); + mouse::select($in, $mouse) or $in->exit(0); } mouse::write_conf($in->do_pkgs, $modules_conf, $mouse, 1); @@ -58,12 +39,14 @@ if ($in->isa('interactive::gtk') && mouse::change_mouse_live($mouse, \%old)) { require ugtk2; ugtk2->import(qw(:wrappers :create)); + require mygtk2; + mygtk2->import(qw(gtknew)); my $w = ugtk2->new(N("Mouse test")); gtkadd($w->{window}, - gtkpack(Gtk2::VBox->new(0, 5), - Gtk2::Label->new(N("Please test your mouse:")), - my $test_hbox = Gtk2::HBox->new(0, 5), - $w->create_okcancel)); + gtknew('VBox', spacing => 5, children_loose => [ + gtknew('Label', text => N("Please test your mouse:")), + my $test_hbox = gtknew('HBox', spacing => 5), + $w->create_okcancel])); mouse::test_mouse_standalone($mouse, $test_hbox); $w->main or goto begin; } @@ -71,4 +54,3 @@ if ($in->isa('interactive::gtk') && mouse::change_mouse_live($mouse, \%old)) { system('service', 'gpm', 'restart') if -e '/var/lock/subsys/gpm'; $in->exit(0); -goto begin; |