aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-03-03 16:21:41 +0000
committerThierry Vignaud <tv@mandriva.org>2010-03-03 16:21:41 +0000
commit2463c5f275f404f8cd10227531f9f6cebfaac013 (patch)
tree80ace14dd29fd95304ea1bc03cce831dd2b230ee
parentcdcd5c7303ee0660e22caefe694324b858509a26 (diff)
downloadrpmdrake-2463c5f275f404f8cd10227531f9f6cebfaac013.tar
rpmdrake-2463c5f275f404f8cd10227531f9f6cebfaac013.tar.gz
rpmdrake-2463c5f275f404f8cd10227531f9f6cebfaac013.tar.bz2
rpmdrake-2463c5f275f404f8cd10227531f9f6cebfaac013.tar.xz
rpmdrake-2463c5f275f404f8cd10227531f9f6cebfaac013.zip
(get_url_link) split it out of format_pkg_simplifiedinfo()
-rw-r--r--Rpmdrake/gui.pm29
1 files changed, 18 insertions, 11 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index e172e7e1..29883fd0 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -210,6 +210,23 @@ sub get_new_deps {
@a;
}
+sub get_url_link {
+ my ($upkg, $pkg, $details_txt) = @_;
+
+ my $url = $upkg->url || $pkg->{url};
+
+ if (!$url) {
+ open_rpm_db()->traverse_tag('name', [ $upkg->name ], sub { $url = $_[0]->url });
+ }
+
+ 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)) ];
+ $link->set_uri_hook(\&run_help_callback);
+}
+
sub format_pkg_simplifiedinfo {
my ($pkgs, $key, $urpm, $descriptions) = @_;
my ($name) = split_fullname($key);
@@ -231,17 +248,7 @@ sub format_pkg_simplifiedinfo {
my $details_txt = get_details($key, $upkg, $installed_version, $raw_medium);
- my $url = $upkg->url || $pkg->{url};
- if (!$url) {
- open_rpm_db()->traverse_tag('name', [ $upkg->name ], sub { $url = $_[0]->url });
- }
-
- if ($url) {
- push @$details_txt,
- @{ 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);
- }
+ get_url_link($upkg, $pkg, $details_txt);
push @$s, [ gtkadd(gtkshow(my $exp0 = Gtk2::Expander->new(format_field(N("Details:")))),
gtknew('TextView', text => $details_txt)) ];