diff options
author | Aurélien Lefebvre <alefebvre@mandriva.com> | 2009-09-03 14:54:17 +0000 |
---|---|---|
committer | Aurélien Lefebvre <alefebvre@mandriva.com> | 2009-09-03 14:54:17 +0000 |
commit | 079f650d7a3a176d558df1220d1a6e2c36c7879b (patch) | |
tree | d272b9547feb14748ef1711da0ebd905c5f16636 | |
parent | 087d6e37767b5178bf2b97400e4325fd4328b6fa (diff) | |
download | drakx-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
-rw-r--r-- | perl-install/NEWS | 2 | ||||
-rw-r--r-- | perl-install/install/NEWS | 2 | ||||
-rw-r--r-- | perl-install/interactive/gtk.pm | 20 |
3 files changed, 14 insertions, 10 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 5ea292ff3..0021c52a6 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,5 @@ +- adduserdrake: + o use icons to display password weakness - added security-{low,medium,strong}.png pixmaps used for password weakness display - authentication: diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index bb56b119f..c2429224c 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,5 @@ +- adduserdrake: + o use icons to display password weakness - added security-{low,medium,strong}.png pixmaps used for password weakness display - authentication: 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; |