summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-09-12 23:40:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-09-12 23:40:48 +0000
commit2d92149a58246b77fc9427fbdd354baba4982a86 (patch)
tree485d2fa71681bf82ed4909b8b9bef56237a06608
parentbffb022e14866052364fb547cefd6cd6be87b14c (diff)
downloaddrakx-2d92149a58246b77fc9427fbdd354baba4982a86.tar
drakx-2d92149a58246b77fc9427fbdd354baba4982a86.tar.gz
drakx-2d92149a58246b77fc9427fbdd354baba4982a86.tar.bz2
drakx-2d92149a58246b77fc9427fbdd354baba4982a86.tar.xz
drakx-2d92149a58246b77fc9427fbdd354baba4982a86.zip
no_comment
-rw-r--r--perl-install/Xconfigurator.pm1
-rw-r--r--perl-install/install2.pm10
-rw-r--r--perl-install/install_gtk.pm15
-rw-r--r--perl-install/install_steps_gtk.pm8
-rw-r--r--perl-install/my_gtk.pm5
5 files changed, 25 insertions, 14 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index df1e47ad7..eb3186fcb 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -470,6 +470,7 @@ sub testFinalConfig($;$$) {
Gtk->timeout_add(1000, sub {
$text->set(_("Leaving in %d seconds", $time));
$time-- or Gtk->main_quit;
+ 1;
});
exit (interactive_gtk->new->ask_yesorno('', [ _("Is this the correct setting?"), $text ], 0) ? 0 : 222);
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 90e711388..342255535 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -43,7 +43,7 @@ my (%installSteps, @orderedInstallSteps);
selectLanguage => [ __("Choose your language"), 1, 1, '' ],
selectInstallClass => [ __("Select installation class"), 1, 1, '' ],
setupSCSI => [ __("Hard drive detection"), 1, 0, '' ],
- selectMouse => [ __("Configure mouse"), 1, 1, '$::beginner', "selectInstallClass" ],
+ selectMouse => [ __("Configure mouse"), 1, 1, '', "selectInstallClass" ],
selectKeyboard => [ __("Choose your keyboard"), 1, 1, '', "selectInstallClass" ],
miscellaneous => [ __("Miscellaneous"), 1, 1, '$::beginner' ],
doPartitionDisks => [ __("Setup filesystems"), 1, 0, '$o->{lnx4win}', "selectInstallClass" ],
@@ -273,7 +273,6 @@ sub selectInstallClass {
sub doPartitionDisks {
$::live and return;
$o->{steps}{formatPartitions}{done} = 0;
- $o->{steps}{doPartitionDisks}{done} = 0;
$o->doPartitionDisksBefore;
$o->doPartitionDisks;
$o->doPartitionDisksAfter;
@@ -664,7 +663,12 @@ sub main {
while ($@) {
local $_ = $@;
$o->kill_action;
- /^setstep (.*)/ and $o->{step} = $1, $clicked = 1, redo MAIN;
+ if (/^setstep (.*)/) {
+ $o->{step} = $1;
+ $o->{steps}{$1}{done} = 0;
+ $clicked = 1;
+ redo MAIN;
+ }
/^theme_changed$/ and redo MAIN;
unless (/^already displayed/ || /^ask_from_list cancel/) {
eval { $o->errorInStep($_) };
diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm
index 7f1717f54..40daf8447 100644
--- a/perl-install/install_gtk.pm
+++ b/perl-install/install_gtk.pm
@@ -367,13 +367,14 @@ END
sub test_mouse {
my ($mouse) = @_;
- my $w = my_gtk->new('');
+ my $w = my_gtk->new;
my ($width, $height, $offset) = (210, 300, 25);
- my ($bw, $bh) = ($width / 3, $height * 2 / 5);
+ my ($bw, $bh) = ($width / 3, $height / 3);
gtkadd($w->{window},
gtkpack(new Gtk::VBox(0,0),
my $darea = gtkset_usize(new Gtk::DrawingArea, $width+1, $height+1),
+ '',
create_okcancel($w, '', '', "edge"),
),
);
@@ -408,8 +409,11 @@ sub test_mouse {
my $w = $font->string_width($t);
$darea->window->draw_string($font, $darea->style->fg_gc('normal'), ($width - $w) / 2, $y, $t);
};
+ my $default_time = 10;
+ my $time = $default_time;
$darea->signal_connect(button_press_event => sub {
my $b = $_[1]{button};
+ $time = $default_time;
$b >= 4 ?
$paintWheel->($b == 4 ? -1 : 1) :
$paintButton->($b - 1, 1);
@@ -422,10 +426,13 @@ sub test_mouse {
$darea->set_events([ 'button_press_mask', 'button_release_mask' ]);
$w->sync; # HACK
- $draw_rect->(0, 1, [ 0, 0, $width, $height]);
+ $draw_rect->(1, 0, [ 0, 0, $width, $height]);
$draw_text->(_("Please test the mouse"), 2 * $bh - 20);
- $draw_text->(_("Move your wheel"), 2 * $bh) if $mouse->{XMOUSETYPE} eq 'IMPS/2';
+ $draw_text->(_("Move your wheel!"), 2 * $bh + 10) if $mouse->{XMOUSETYPE} eq 'IMPS/2';
$paintButton->($_, 0) foreach 0..2;
+ $w->{cancel}->grab_focus;
+ my $timeout = Gtk->timeout_add(1000, sub { if ($time-- == 0) { undef $w->{retval}; Gtk->main_quit } 1 });
+ my $b = before_leaving { Gtk->timeout_remove($timeout) };
$w->main;
}
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 42e017f81..5254cffa6 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -192,11 +192,9 @@ sub selectMouse {
eval { commands::modprobe("serial") } if $o->{mouse}{device} =~ /ttyS/;
$set->($o->{mouse}) unless $::testing;
-
- install_gtk::test_mouse($o->{mouse}) and return;
-
- $set->(\%old);
- goto &selectMouse;
+ }
+ if ($old{FULLNAME} ne $o->{mouse}{FULLNAME}) {
+ install_gtk::test_mouse($o->{mouse}) or goto &selectMouse;
}
}
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 2d9c65a2a..e59a1404c 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -45,7 +45,8 @@ sub new {
sub main($;$) {
my ($o, $f) = @_;
gtkset_mousecursor_normal();
- my $idle = Gtk->timeout_add(1000, sub { gtkset_mousecursor_normal() });
+ my $timeout = Gtk->timeout_add(1000, sub { log::l("gtkset_mousecursor_normal"); gtkset_mousecursor_normal(); 1 });
+ my $b = before_leaving { Gtk->timeout_remove($timeout) };
$o->show;
do {
@@ -240,7 +241,7 @@ sub create_okcancel {
$ok ||= $::isWizard ? _("Next ->") : _("Ok");
my $b1 = gtksignal_connect($w->{ok} = new Gtk::Button($ok), "clicked" => $w->{ok_clicked} || sub { $w->{retval} = 1; Gtk->main_quit });
- my $b2 = !$one && gtksignal_connect(new Gtk::Button($cancel || _("Cancel")), "clicked" => $w->{cancel_clicked} || sub { $w->{retval} = 0; Gtk->main_quit });
+ my $b2 = !$one && gtksignal_connect($w->{cancel} = new Gtk::Button($cancel || _("Cancel")), "clicked" => $w->{cancel_clicked} || sub { undef $w->{retval}; Gtk->main_quit });
my @l = grep { $_ } $::isStandalone ? ($b2, $b1) : ($b1, $b2);
$_->can_default($::isStandalone) foreach @l;