From 90d6f05755719766ccbcbe9eb8bea018f20ac348 Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Fri, 9 Jul 2010 15:11:53 +0000 Subject: Use radio buttons for paper size setting in wizard installer. git-svn-id: svn://tug.org/texlive/trunk@19303 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/installer/install-menu-wizard.pl | 34 +++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'Master') diff --git a/Master/tlpkg/installer/install-menu-wizard.pl b/Master/tlpkg/installer/install-menu-wizard.pl index c65adcb778b..9be6c2697d4 100644 --- a/Master/tlpkg/installer/install-menu-wizard.pl +++ b/Master/tlpkg/installer/install-menu-wizard.pl @@ -323,13 +323,19 @@ sub callback_change_texdir { ################## OPTIONS SCREEN ################################ my %opts_to_str = ( - "letter" => "Use letter size instead of A4 by default", + "letter" => "Default paper size", "desktop_integration" => "Add shortcuts to menu and desktop", "file_assocs" => "Change file associations", "path" => "Adjust PATH setting in registry", "w32_multi_user" => "Installation for all users", ); +# options choices: if there is an entry, use radio buttons, +# otherwise a checkbutton +my %opts_choices = ( + "letter" => ["A4", "letter"], +); + sub ask_options { for ($fmain->children) { $_->destroy; @@ -366,9 +372,23 @@ sub ask_options { my $ytmp = 60; for my $o (@opts_list) { - $fmain->Checkbutton(-text => __($opts_to_str{$o}), - -variable => \$vars{"option_$o"})->place(-x => 0, -y => $ytmp); # $opt_cb{$o}->place(-x => 0, -y => $ytmp); + if (exists($opts_choices{$o})) { + my $fopt = $fmain->Frame()->place(-x => 0, -y => $ytmp); + $fopt->Label( + -text => __($opts_to_str{$o}) . ":\t" + )->pack(-side => 'left'); + for (my $i = 0; $i < @{$opts_choices{$o}}; $i++) { + $fopt->Radiobutton( + -text => __($opts_choices{$o}->[$i]), + -variable => \$vars{"option_$o"}, + -value => $i, + )->pack(-side => 'left'); + } + } else { + $fmain->Checkbutton(-text => __($opts_to_str{$o}), + -variable => \$vars{"option_$o"})->place(-x => 0, -y => $ytmp); + } $ytmp += 50; } @@ -402,8 +422,14 @@ sub ask_go { $ytmp += 20; for my $o (@opts_list) { + my $text = __($opts_to_str{$o}) . ":\t"; + if (exists ($opts_choices{$o})) { + $text .= $opts_choices{$o}->[$vars{"option_$o"}]; + } else { + $text .= $vars{"option_$o"} ? __("Yes") : __("No"); + } $fmain->Label(-justify => "left", - -text => __($opts_to_str{$o}) . ":\t" . ($vars{"option_$o"} ? __("Yes") : __("No")))->place(-x => 0, -y => $ytmp); + -text => $text)->place(-x => 0, -y => $ytmp); $ytmp += 20; } -- cgit v1.2.3