From 2a24afb6e61254d4e44ae615c9c6c1ba71058a16 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 3 Mar 2010 16:21:32 +0000 Subject: (get_details) split it out of format_pkg_simplifiedinfo() --- Rpmdrake/gui.pm | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'Rpmdrake') diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index d0bb11c1..144ac22e 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -166,9 +166,26 @@ sub get_main_text { )); } +sub get_details { + my ($key, $upkg, $installed_version, $raw_medium) = @_; + my (undef, $version, $release) = split_fullname($key); + ugtk2::markup_to_TextView_format( + $spacing . join("\n$spacing", + format_field(N("Version: ")) . $version . '-' . $release, + ($upkg->flag_installed ? + format_field(N("Currently installed version: ")) . $installed_version : () + ), + format_field(N("Group: ")) . translate_group($upkg->group), + format_field(N("Architecture: ")) . $upkg->arch, + format_field(N("Size: ")) . N("%s KB", int($upkg->size/1024)), + eval { format_field(N("Medium: ")) . $raw_medium->{name} }, + ), + ); +} + sub format_pkg_simplifiedinfo { my ($pkgs, $key, $urpm, $descriptions) = @_; - my ($name, $version, $release) = split_fullname($key); + my ($name) = split_fullname($key); my $pkg = $pkgs->{$key}; my $upkg = $pkg->{pkg}; return if !$upkg; @@ -185,20 +202,7 @@ sub format_pkg_simplifiedinfo { push @$s, [ "\n" ]; my $installed_version = eval { find_installed_version($upkg) }; - my $details_txt = ugtk2::markup_to_TextView_format( - $spacing . join("\n$spacing", - format_field(N("Version: ")) . $version . '-' . $release, - - ($upkg->flag_installed ? - format_field(N("Currently installed version: ")) . $installed_version - : () - ), - format_field(N("Group: ")) . translate_group($upkg->group), - format_field(N("Architecture: ")) . $upkg->arch, - format_field(N("Size: ")) . N("%s KB", int($upkg->size/1024)), - eval { format_field(N("Medium: ")) . $raw_medium->{name} }, - ), - ); + my $details_txt = get_details($key, $upkg, $installed_version, $raw_medium); my $url = $upkg->url || $pkg->{url}; if (!$url) { -- cgit v1.2.1