diff options
author | Thierry Vignaud <tv@mandriva.org> | 2010-03-03 16:21:37 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2010-03-03 16:21:37 +0000 |
commit | cdcd5c7303ee0660e22caefe694324b858509a26 (patch) | |
tree | dc27a5e2261c777e7fce7fdffa505325e76a29e9 /Rpmdrake/gui.pm | |
parent | 2a24afb6e61254d4e44ae615c9c6c1ba71058a16 (diff) | |
download | rpmdrake-cdcd5c7303ee0660e22caefe694324b858509a26.tar rpmdrake-cdcd5c7303ee0660e22caefe694324b858509a26.tar.gz rpmdrake-cdcd5c7303ee0660e22caefe694324b858509a26.tar.bz2 rpmdrake-cdcd5c7303ee0660e22caefe694324b858509a26.tar.xz rpmdrake-cdcd5c7303ee0660e22caefe694324b858509a26.zip |
(get_new_deps) split it out of format_pkg_simplifiedinfo()
Diffstat (limited to 'Rpmdrake/gui.pm')
-rw-r--r-- | Rpmdrake/gui.pm | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index 144ac22e..e172e7e1 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -183,6 +183,33 @@ sub get_details { ); } +sub get_new_deps { + my ($urpm, $upkg) = @_; + my $deps_textview; + my @a = [ gtkadd( + gtksignal_connect( + gtkshow(my $dependencies = Gtk2::Expander->new(format_field(N("New dependencies:")))), + activate => sub { + slow_func($::main_window->window, sub { + my $state = {}; + my @requested = $urpm->resolve_requested( + open_rpm_db(), $state, + { $upkg->id => 1 }, + ); + $urpm->disable_selected(open_rpm_db(), $state, @requested); + my @nodes_with_deps = map { urpm_name($_) } @requested; + my @deps = sort { $a cmp $b } difference2(\@nodes_with_deps, [ urpm_name($upkg) ]); + @deps = N("No non installed dependancy.") if !@deps; + gtktext_insert($deps_textview, join("\n", @deps)); + }); + } + ), + $deps_textview = gtknew('TextView') + ) ]; + $dependencies->set_use_markup(1); + @a; +} + sub format_pkg_simplifiedinfo { my ($pkgs, $key, $urpm, $descriptions) = @_; my ($name) = split_fullname($key); @@ -232,28 +259,7 @@ sub format_pkg_simplifiedinfo { push @$s, [ "\n\n" ]; if ($upkg->id) { # If not installed - my $deps_textview; - push @$s, [ gtkadd( - gtksignal_connect( - gtkshow(my $dependencies = Gtk2::Expander->new(format_field(N("New dependencies:")))), - activate => sub { - slow_func($::main_window->window, sub { - my $state = {}; - my @requested = $urpm->resolve_requested( - open_rpm_db(), $state, - { $upkg->id => 1 }, - ); - $urpm->disable_selected(open_rpm_db(), $state, @requested); - my @nodes_with_deps = map { urpm_name($_) } @requested; - my @deps = sort { $a cmp $b } difference2(\@nodes_with_deps, [ urpm_name($upkg) ]); - @deps = N("No non installed dependancy.") if !@deps; - gtktext_insert($deps_textview, join("\n", @deps)); - }); - } - ), - $deps_textview = gtknew('TextView') - ) ]; - $dependencies->set_use_markup(1); + push @$s, get_new_deps($urpm, $upkg); } $s; |