From 07e0ecd0ed6222ae98b0a5e8c0d4e1d80497bb8f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 5 Sep 2007 10:38:38 +0000 Subject: - display a warning when capslock is enabled and entering a password (#33028) --- perl-install/NEWS | 2 ++ perl-install/install/NEWS | 1 + perl-install/interactive/gtk.pm | 12 +++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index 8de41f9f5..04365760a 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,5 @@ +- display a warning when capslock is enabled and entering a password (#33028) + Version 10.4.188 - 4 September 2007, by Thierry Vignaud - hardware detection layer: diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 898af721e..5b63860f8 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,4 @@ +- display a warning when capslock is enabled and entering a password (#33028) - fix insmoding raid0 (#33172) Version 10.4.189 - 4 September 2007, by Thierry Vignaud diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 59b0fb288..306ea0c9e 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -535,7 +535,17 @@ sub create_widget { } } $w->signal_connect(key_press_event => $e->{may_go_to_next}); - $w->set_visibility(0) if $e->{hidden}; + if ($e->{hidden}) { + $w->set_visibility(0); + $w->signal_connect(key_press_event => sub { + my (undef, $event) = @_; + if (!$o->{capslock_warned} && member('lock-mask', @{$event->state}) && !$w->get_text) { + $o->{capslock_warned} = 1; + $o->ask_warn('', N("Beware, Caps Lock is enabled")); + } + 0; + }); + } } if (my $focus_out = $e->{focus_out}) { -- cgit v1.2.1