diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-09-11 16:25:55 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-09-11 16:25:55 +0000 |
commit | 96bd2aef26feb5bfd0fefa2d7d6b815c7906a1d1 (patch) | |
tree | 67d0381adf2168933b0cc23a30a316f5972895a0 /perl-install | |
parent | c290890d427108bf28dbf64f12d7b26fc9c8c510 (diff) | |
download | drakx-96bd2aef26feb5bfd0fefa2d7d6b815c7906a1d1.tar drakx-96bd2aef26feb5bfd0fefa2d7d6b815c7906a1d1.tar.gz drakx-96bd2aef26feb5bfd0fefa2d7d6b815c7906a1d1.tar.bz2 drakx-96bd2aef26feb5bfd0fefa2d7d6b815c7906a1d1.tar.xz drakx-96bd2aef26feb5bfd0fefa2d7d6b815c7906a1d1.zip |
(display_help) reindent and make it clearer through using 'elsif'
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/interactive/gtk.pm | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 4127f8688..a5b410219 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -777,40 +777,40 @@ sub get_html_file { sub display_help { my ($o, $common, $mainw) = @_; - if (my $file = $common->{interactive_help_id}) { - require Gtk2::Html2; - my $view = Gtk2::Html2::View->new; - my $document = Gtk2::Html2::Document->new; - $document->signal_connect(request_url => sub { - my ($_document, $url, $stream) = @_; - $stream->write(join('', cat_("$help_path/$url"))); - $stream->close; - }); - $document->signal_connect('link-clicked' => \&load_from_uri); - $view->set_document($document); - - load_from_uri($document, "$file.html"); - - my $w = ugtk2->new(N("Help"), transient => $mainw->{real_window}, modal => 1); - gtkadd($w->{rwindow}, - gtkpack_(Gtk2::VBox->new, - 1, create_scrolled_window(gtkset_border_width($view, 5), - [ 'never', 'automatic' ], - ), - 0, Gtk2::HSeparator->new, - 0, gtkpack(create_hbox('end'), - gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) - ), - ), - ); - mygtk2::set_main_window_size($w->{rwindow}); - $w->{real_window}->grab_focus; - $w->{real_window}->show_all; - $w->main; - return; - } - my $message = $common->{interactive_help}->() or return; - $o->ask_warn(N("Help"), $message); + if (my $file = $common->{interactive_help_id}) { + require Gtk2::Html2; + my $view = Gtk2::Html2::View->new; + my $document = Gtk2::Html2::Document->new; + $document->signal_connect(request_url => sub { + my ($_document, $url, $stream) = @_; + $stream->write(join('', cat_("$help_path/$url"))); + $stream->close; + }); + $document->signal_connect('link-clicked' => \&load_from_uri); + $view->set_document($document); + + load_from_uri($document, "$file.html"); + + my $w = ugtk2->new(N("Help"), transient => $mainw->{real_window}, modal => 1); + gtkadd($w->{rwindow}, + gtkpack_(Gtk2::VBox->new, + 1, create_scrolled_window(gtkset_border_width($view, 5), + [ 'never', 'automatic' ], + ), + 0, Gtk2::HSeparator->new, + 0, gtkpack(create_hbox('end'), + gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) + ), + ), + ); + mygtk2::set_main_window_size($w->{rwindow}); + $w->{real_window}->grab_focus; + $w->{real_window}->show_all; + $w->main; + return; + } elsif (my $message = $common->{interactive_help}->()) { + $o->ask_warn(N("Help"), $message); + } } sub ask_fromW { |