diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-08-03 16:27:19 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-08-03 16:27:19 +0000 |
commit | 24ebc650d1bd156ff3124f8b6dbdcbb0ae20f717 (patch) | |
tree | 90a498912ae6f43bb1e2014f3ccbf84ac7eb171b /Rpmdrake/pkg.pm | |
parent | d3989619f6e0c8bb1f759efbf08b9c948f6f9bb8 (diff) | |
download | rpmdrake-24ebc650d1bd156ff3124f8b6dbdcbb0ae20f717.tar rpmdrake-24ebc650d1bd156ff3124f8b6dbdcbb0ae20f717.tar.gz rpmdrake-24ebc650d1bd156ff3124f8b6dbdcbb0ae20f717.tar.bz2 rpmdrake-24ebc650d1bd156ff3124f8b6dbdcbb0ae20f717.tar.xz rpmdrake-24ebc650d1bd156ff3124f8b6dbdcbb0ae20f717.zip |
(display_READMEs_if_needed) split it out of perform_installation()
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rwxr-xr-x | Rpmdrake/pkg.pm | 56 |
1 files 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.")); |