#!/usr/bin/perl 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; use interactive; use modules; use mouse; use c; $ugtk2::wm_icon = "/usr/share/mcc/themes/default/mousedrake-mdk.png"; my $in = 'interactive'->vnew('su'); my $modules_conf = modules::any_conf->read; begin: my $mouse = mouse::read(); my %old = %$mouse; if (!$::noauto) { my $probed_mouse = mouse::detect($modules_conf); $mouse = $probed_mouse if !$mouse->{Protocol} || !$probed_mouse->{unsafe}; } if (!$mouse || !$::auto) { $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); 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}, 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; } system('service', 'gpm', 'restart') if -e '/var/lock/subsys/gpm'; $in->exit(0);