diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-09-27 16:04:16 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-09-27 16:04:16 +0000 |
commit | 11dca9bb397c79ebf52730db22847c7c54060288 (patch) | |
tree | b31c923888289ff50f1406844203b5dfca1dd4f7 | |
parent | da2fa96bb276cce53f475abc5a30852260c9e0e6 (diff) | |
download | drakx-11dca9bb397c79ebf52730db22847c7c54060288.tar drakx-11dca9bb397c79ebf52730db22847c7c54060288.tar.gz drakx-11dca9bb397c79ebf52730db22847c7c54060288.tar.bz2 drakx-11dca9bb397c79ebf52730db22847c7c54060288.tar.xz drakx-11dca9bb397c79ebf52730db22847c7c54060288.zip |
(display_release_notes) split it out of acceptLicense()
-rw-r--r-- | perl-install/any.pm | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 5afe8d2d9..5f009a66b 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -843,6 +843,42 @@ sub autologin { } } +sub display_release_notes { + my ($o) = @_; + require Gtk2::Html2; + require ugtk2; + ugtk2->import(':all'); + require mygtk2; + mygtk2->import('gtknew'); + my $view = Gtk2::Html2::View->new; + my $document = Gtk2::Html2::Document->new; + $view->set_document($document); + + $document->clear; + $document->open_stream("text/html"); + $document->write_stream($o->{release_notes}); + + my $w = ugtk2->new(N("Release Notes"), transient => $::main_window, modal => 1); + gtkadd($w->{rwindow}, + gtkpack_(Gtk2::VBox->new, + 1, create_scrolled_window(ugtk2::gtkset_border_width($view, 5), + [ 'never', 'automatic' ], + ), + 0, gtkpack(create_hbox('edge'), + gtknew('Button', text => N("Close"), + clicked => sub { Gtk2->main_quit }) + ), + ), + ); + # make parent visible still visible: + local ($::real_windowwidth, $::real_windowheight) = ($::real_windowwidth - 50, $::real_windowheight - 50); + mygtk2::set_main_window_size($w->{rwindow}); + $w->{real_window}->grab_focus; + $w->{real_window}->show_all; + $w->main; + return; +} + sub acceptLicense { my ($o) = @_; require messages; @@ -872,42 +908,7 @@ sub acceptLicense { messages => formatAlaTeX(messages::main_license() . "\n\n\n" . messages::warning_about_patents()), interactive_help_id => 'acceptLicense', if_($o->{release_notes}, - more_buttons => [ - [ - N("Release Notes"), sub { - require Gtk2::Html2; - require ugtk2; - ugtk2->import(':all'); - require mygtk2; - mygtk2->import('gtknew'); - my $view = Gtk2::Html2::View->new; - my $document = Gtk2::Html2::Document->new; - $view->set_document($document); - - $document->clear; - $document->open_stream("text/html"); - $document->write_stream($o->{release_notes}); - - my $w = ugtk2->new(N("Release Notes"), transient => $mainw->{real_window}, modal => 1); - gtkadd($w->{rwindow}, - gtkpack_(Gtk2::VBox->new, - 1, create_scrolled_window(ugtk2::gtkset_border_width($view, 5), - [ 'never', 'automatic' ], - ), - 0, gtkpack(create_hbox('edge'), - gtknew('Button', text => N("Close"), - clicked => sub { Gtk2->main_quit }) - ), - ), - ); - # make parent visible still visible: - local ($::real_windowwidth, $::real_windowheight) = ($::real_windowwidth - 50, $::real_windowheight - 50); - mygtk2::set_main_window_size($w->{rwindow}); - $w->{real_window}->grab_focus; - $w->{real_window}->show_all; - $w->main; - return; - }, 1 ] ]), + more_buttons => [ [ N("Release Notes"), sub { display_release_notes($o) }, 1 ] ]), callbacks => { ok_disabled => sub { $r eq 'Refuse' } }, }, [ { list => [ N_("Accept"), N_("Refuse") ], val => \$r, type => 'list', format => sub { translate($_[0]) } } ]) |