diff options
author | Thierry Vignaud <tv@mandriva.org> | 2010-03-03 16:21:47 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2010-03-03 16:21:47 +0000 |
commit | 33a4a668f3761687d6e7cc1240d62987bdee25a6 (patch) | |
tree | ce0a9ae390d5a9eb397a5c7f12a82ef0e68b7d5e /Rpmdrake | |
parent | 2463c5f275f404f8cd10227531f9f6cebfaac013 (diff) | |
download | rpmdrake-33a4a668f3761687d6e7cc1240d62987bdee25a6.tar rpmdrake-33a4a668f3761687d6e7cc1240d62987bdee25a6.tar.gz rpmdrake-33a4a668f3761687d6e7cc1240d62987bdee25a6.tar.bz2 rpmdrake-33a4a668f3761687d6e7cc1240d62987bdee25a6.tar.xz rpmdrake-33a4a668f3761687d6e7cc1240d62987bdee25a6.zip |
(get_details) call get_url_link() here instead of in format_pkg_simplifiedinfo()
(get_url_link) simplify (no more inner knowledge of get_main_text()'s internals)
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/gui.pm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index 29883fd0..11c9252f 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -167,9 +167,9 @@ sub get_main_text { } sub get_details { - my ($key, $upkg, $installed_version, $raw_medium) = @_; + my ($key, $pkg, $upkg, $installed_version, $raw_medium) = @_; my (undef, $version, $release) = split_fullname($key); - ugtk2::markup_to_TextView_format( + my $a = ugtk2::markup_to_TextView_format( $spacing . join("\n$spacing", format_field(N("Version: ")) . $version . '-' . $release, ($upkg->flag_installed ? @@ -181,6 +181,9 @@ sub get_details { eval { format_field(N("Medium: ")) . $raw_medium->{name} }, ), ); + my @link = get_url_link($upkg, $pkg); + push @$a, @link if @link; + $a; } sub get_new_deps { @@ -211,7 +214,7 @@ sub get_new_deps { } sub get_url_link { - my ($upkg, $pkg, $details_txt) = @_; + my ($upkg, $pkg) = @_; my $url = $upkg->url || $pkg->{url}; @@ -221,10 +224,11 @@ sub get_url_link { return if !$url; - push @$details_txt, - @{ ugtk2::markup_to_TextView_format(format_field("\n$spacing" . N("URL: "))) }, - [ my $link = gtkshow(Gtk2::LinkButton->new($url, $url)) ]; + my @a = + (@{ ugtk2::markup_to_TextView_format(format_field("\n$spacing" . N("URL: "))) }, + [ my $link = gtkshow(Gtk2::LinkButton->new($url, $url)) ]); $link->set_uri_hook(\&run_help_callback); + @a; } sub format_pkg_simplifiedinfo { @@ -246,9 +250,7 @@ sub format_pkg_simplifiedinfo { push @$s, [ "\n" ]; my $installed_version = eval { find_installed_version($upkg) }; - my $details_txt = get_details($key, $upkg, $installed_version, $raw_medium); - - get_url_link($upkg, $pkg, $details_txt); + my $details_txt = get_details($key, $pkg, $upkg, $installed_version, $raw_medium); push @$s, [ gtkadd(gtkshow(my $exp0 = Gtk2::Expander->new(format_field(N("Details:")))), gtknew('TextView', text => $details_txt)) ]; |