summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive/gtk.pm
diff options
context:
space:
mode:
authorAurélien Lefebvre <alefebvre@mandriva.com>2009-09-03 14:54:17 +0000
committerAurélien Lefebvre <alefebvre@mandriva.com>2009-09-03 14:54:17 +0000
commit079f650d7a3a176d558df1220d1a6e2c36c7879b (patch)
treed272b9547feb14748ef1711da0ebd905c5f16636 /perl-install/interactive/gtk.pm
parent087d6e37767b5178bf2b97400e4325fd4328b6fa (diff)
downloaddrakx-079f650d7a3a176d558df1220d1a6e2c36c7879b.tar
drakx-079f650d7a3a176d558df1220d1a6e2c36c7879b.tar.gz
drakx-079f650d7a3a176d558df1220d1a6e2c36c7879b.tar.bz2
drakx-079f650d7a3a176d558df1220d1a6e2c36c7879b.tar.xz
drakx-079f650d7a3a176d558df1220d1a6e2c36c7879b.zip
- adduserdrake:
o use icons to display password weakness
Diffstat (limited to 'perl-install/interactive/gtk.pm')
-rw-r--r--perl-install/interactive/gtk.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index a958fe7bc..8feea073c 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -554,7 +554,7 @@ sub create_widget {
if ($e->{weakness_check}) {
require authentication;
my $password_weakness = authentication::compute_password_weakness($w->get_text);
- $w->modify_base('GTK_STATE_NORMAL', get_weakness_color($password_weakness));
+ $w->set_icon_from_pixbuf('GTK_ENTRY_ICON_SECONDARY', get_weakness_icon($password_weakness));
}
$w->get_text;
}));
@@ -970,16 +970,16 @@ sub kill {
@tempory::objects = ();
}
-sub get_weakness_color {
+sub get_weakness_icon {
my ($password_weakness) = @_;
- my %weakness_color = (
- 1 => '#fd3434',
- 2 => '#fd6c34',
- 3 => '#f7871a',
- 4 => '#2ae000',
- 5 => '#30ff00');
- my $weakness_color = $weakness_color{$password_weakness} || '#ffffff';
- Gtk2::Gdk::Color->parse($weakness_color);
+ my %weakness_icon = (
+ 1 => gtknew('Pixbuf', file => 'security-low'),
+ 2 => gtknew('Pixbuf', file => 'security-low'),
+ 3 => gtknew('Pixbuf', file => 'security-medium'),
+ 4 => gtknew('Pixbuf', file => 'security-strong'),
+ 5 => gtknew('Pixbuf', file => 'security-strong'));
+ my $weakness_icon = $weakness_icon{$password_weakness} || return undef;
+ $weakness_icon;
}
1;