diff options
author | Thierry Vignaud <tv@mandriva.org> | 2010-03-03 16:21:32 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2010-03-03 16:21:32 +0000 |
commit | 2a24afb6e61254d4e44ae615c9c6c1ba71058a16 (patch) | |
tree | 1253fc92c6482412ef4c0840f5dd11425c72514f /Rpmdrake | |
parent | be0dcd37ef406ecf5eceee8b29a3b6fcf30a43d2 (diff) | |
download | rpmdrake-2a24afb6e61254d4e44ae615c9c6c1ba71058a16.tar rpmdrake-2a24afb6e61254d4e44ae615c9c6c1ba71058a16.tar.gz rpmdrake-2a24afb6e61254d4e44ae615c9c6c1ba71058a16.tar.bz2 rpmdrake-2a24afb6e61254d4e44ae615c9c6c1ba71058a16.tar.xz rpmdrake-2a24afb6e61254d4e44ae615c9c6c1ba71058a16.zip |
(get_details) split it out of format_pkg_simplifiedinfo()
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/gui.pm | 34 |
1 files changed, 19 insertions, 15 deletions
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) { |