From c44cd87427adfbca62fe107e4c0eb24538c01212 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 17 Aug 2004 05:54:23 +0000 Subject: add release notes during install of packages --- perl-install/install_steps_gtk.pm | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index e6ee8515d..ce83cb311 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -429,15 +429,17 @@ sub installPackages { my $w = ugtk2->new(N("Installing")); $w->sync; my $text = Gtk2::Label->new; - my ($advertising, $change_time, $i); + my ($advertising, $change_time, $i, $show_release_notes); my $show_advertising if 0; $show_advertising = to_bool(@install_any::advertising_images) if !defined $show_advertising; - my $detail_or_not = sub { $show_advertising ? N("Details") : N("No details") }; + + my $release_notes_scroll = gtkset_size_request(create_scrolled_window(gtktext_insert(Gtk2::TextView->new, $o->{release_notes})), + -1, 280); my ($msg, $msg_time_remaining) = map { Gtk2::Label->new($_) } '', N("Estimating"); my ($progress, $progress_total) = map { Gtk2::ProgressBar->new } (1..2); gtkadd($w->{window}, my $box = Gtk2::VBox->new(0,10)); $box->pack_end(gtkshow(gtkpack(Gtk2::VBox->new(0,5), - $msg, $progress, + $msg, $progress, $release_notes_scroll, create_packtable({}, [N("Time remaining "), $msg_time_remaining], ), @@ -445,19 +447,31 @@ sub installPackages { $progress_total, gtkadd(create_hbox(), my $cancel = Gtk2::Button->new(N("Cancel")), - my $details = Gtk2::Button->new($detail_or_not->()), + my $release_notes_button = Gtk2::Button->new(''), + my $details = Gtk2::Button->new(''), ), )), 0, 1, 0); + $release_notes_button->hide if !$o->{release_notes}; $details->hide if !@install_any::advertising_images; $w->sync; $msg->set_label(N("Please wait, preparing installation...")); - gtkset_mousecursor_normal($cancel->window); - gtkset_mousecursor_normal($details->window); + foreach ($cancel, $release_notes_button, $details) { + gtkset_mousecursor_normal($_->window); + } my $advertize = sub { + my ($update) = @_; @install_any::advertising_images or return; - $show_advertising ? $_->hide : $_->show foreach $msg, $progress, $text; + foreach ($msg, $progress, $text) { + $show_advertising || $show_release_notes ? $_->hide : $_->show; + } + for ($release_notes_scroll) { + $show_release_notes ? $_->show : $_->hide; + } + $details->set_label($show_advertising ? N("Details") : N("No details")); + $release_notes_button->set_label($show_release_notes ? N("Hide Release Notes") : N("Release Notes")); + gtkdestroy($advertising) if $advertising; - if ($show_advertising && $_[0]) { + if ($show_advertising && !$show_release_notes && $update) { $change_time = time(); my $f = $install_any::advertising_images[$i++ % @install_any::advertising_images]; log::l("advertising $f"); @@ -498,10 +512,15 @@ sub installPackages { $cancel->signal_connect(clicked => sub { $pkgs::cancel_install = 1 }); $details->signal_connect(clicked => sub { invbool \$show_advertising; - $details->set_label($detail_or_not->()); + $show_release_notes = 0 if !$show_advertising; + $advertize->(1); + }); + $release_notes_button->signal_connect(clicked => sub { + invbool \$show_release_notes; + $show_advertising = 1 if $show_release_notes; $advertize->(1); }); - $advertize->(); + $advertize->(0); my $oldInstallCallback = \&pkgs::installCallback; local *pkgs::installCallback = sub { -- cgit v1.2.1