aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-10-06 19:08:10 +0000
committerThierry Vignaud <tv@mandriva.org>2008-10-06 19:08:10 +0000
commita4aca13e1a42b4db1c958f879721ca9abb03086f (patch)
tree64ea15ddc3e69d0926ebb278f12f47916892c364
parentaafa007aef5b61f93fcb4f1fdc8aa1fd690771ff (diff)
downloadrpmdrake-a4aca13e1a42b4db1c958f879721ca9abb03086f.tar
rpmdrake-a4aca13e1a42b4db1c958f879721ca9abb03086f.tar.gz
rpmdrake-a4aca13e1a42b4db1c958f879721ca9abb03086f.tar.bz2
rpmdrake-a4aca13e1a42b4db1c958f879721ca9abb03086f.tar.xz
rpmdrake-a4aca13e1a42b4db1c958f879721ca9abb03086f.zip
(run_help_callback) factorize code
-rw-r--r--Rpmdrake/gui.pm15
1 files changed, 7 insertions, 8 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index a5ffbfe4..f65007f7 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -151,10 +151,7 @@ sub format_pkg_simplifiedinfo {
'')); # extra empty line
if ($is_update) {
push @$s, [ my $link = gtkshow(Gtk2::LinkButton->new($update_descr->{URL}, N("Security advisory"))) ];
- $link->set_uri_hook(sub {
- my (undef, $url) = @_;
- run_program::raw({ detach => 1, setuid => get_parent_uid() }, 'www-browser', $url);
- });
+ $link->set_uri_hook(\&run_help_callback);
}
push @$s, @{ ugtk2::markup_to_TextView_format(join("\n",
@@ -187,10 +184,7 @@ sub format_pkg_simplifiedinfo {
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(sub {
- my (undef, $url) = @_;
- run_program::raw({ detach => 1, setuid => get_parent_uid() }, 'www-browser', $url);
- });
+ $link->set_uri_hook(\&run_help_callback);
}
push @$s, [ gtkadd(gtkshow(my $exp0 = Gtk2::Expander->new(format_field(N("Details:")))),
@@ -918,4 +912,9 @@ sub sort_callback {
URPM::rpmvercmp(map { $store->get_value($_, $pkg_columns{version}) } $treeiter1, $treeiter2);
}
+sub run_help_callback {
+ my (undef, $url) = @_;
+ run_program::raw({ detach => 1, setuid => get_parent_uid() }, 'www-browser', $url);
+}
+
1;