From 24ebc650d1bd156ff3124f8b6dbdcbb0ae20f717 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 3 Aug 2007 16:27:19 +0000 Subject: (display_READMEs_if_needed) split it out of perform_installation() --- Rpmdrake/pkg.pm | 56 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index befb2e09..371eca13 100755 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -439,6 +439,35 @@ sub get_pkgs { }; } +sub display_READMEs_if_needed { + my ($urpm, $w) = @_; + my %Readmes = %{$urpm->{readmes}}; + if (keys %Readmes) { #- display the README*.urpmi files + interactive_packtable( + N("Upgrade information"), + $w, + N("These packages come with upgrade information"), + [ map { + my $fullname = $_; + [ gtkpack__( + gtknew('HBox'), + gtkset_selectable(gtknew('Label', text => $Readmes{$fullname}),1), + ), + gtksignal_connect( + gtknew('Button', text => N("Upgrade information about this package")), + clicked => sub { + interactive_msg( + N("Upgrade information about package %s", $Readmes{$fullname}), + (join '' => formatAlaTeX(scalar cat_($fullname))), + scroll => 1, + ); + }, + ), + ] } keys %Readmes ], + [ gtknew('Button', text => N("Ok"), clicked => sub { Gtk2->main_quit }) ] + ); + } +} sub perform_parallel_install { my ($urpm, $group, $w, $statusbar_msg_id) = @_; @@ -781,32 +810,7 @@ you may now inspect some in order to take actions:"), %pkg2rpmnew) and $statusbar_msg_id = statusbar_msg(N("All requested packages were installed successfully.")); - my %Readmes = %{$urpm->{readmes}}; - if (keys %Readmes) { #- display the README*.urpmi files - interactive_packtable( - N("Upgrade information"), - $w, - N("These packages come with upgrade information"), - [ map { - my $fullname = $_; - [ gtkpack__( - gtknew('HBox'), - gtkset_selectable(gtknew('Label', text => $Readmes{$fullname}),1), - ), - gtksignal_connect( - gtknew('Button', text => N("Upgrade information about this package")), - clicked => sub { - interactive_msg( - N("Upgrade information about package %s", $Readmes{$fullname}), - (join '' => formatAlaTeX(scalar cat_($fullname))), - scroll => 1, - ); - }, - ), - ] } keys %Readmes ], - [ gtknew('Button', text => N("Ok"), clicked => sub { Gtk2->main_quit }) ] - ); - } + display_READMEs_if_needed($urpm, $w); } else { interactive_msg(N("Error"), N("Unrecoverable error: no package found for installation, sorry.")); -- cgit v1.2.1