From 0ea3633bbb0541335813e8d5d41387facb2e89a8 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 31 Oct 2010 07:26:14 +0000 Subject: installer: - (text mdoe) change scheme to scheme-custom if collections are changed - (gui) allow selecting scheme-custom in gui, and switch as above git-svn-id: svn://tug.org/texlive/trunk@20268 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/installer/install-menu-perltk.pl | 46 ++++++++++++++++++++++++--- Master/tlpkg/installer/install-menu-text.pl | 5 +++ 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index 7f75d0e2907..343eca2f52b 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -545,6 +545,7 @@ sub menu_select_scheme { } } @schemes=sort @schemes; + push @schemes, "scheme-custom"; my $selected = $vars{'selected_scheme'}; $sw->Label(-text => __("Selected scheme"))->pack(-padx => "2m", -pady => "2m"); my $f2 = $sw->Frame; @@ -553,14 +554,20 @@ sub menu_select_scheme { my $nrfh = $#schemes / 2; my $i = 0; foreach my $scheme (@schemes) { - my $tlpobj = $tlpdb->get_package("$scheme"); + my $desc; + if ($scheme ne "scheme-custom") { + my $tlpobj = $tlpdb->get_package("$scheme"); + $desc = $tlpobj->shortdesc; + } else { + $desc = "custom selection of collections"; + } my $b; if ($i < $nrfh) { $b = $f2l->Radiobutton(-variable => \$selected, -value => $scheme, - -text => __($tlpobj->shortdesc))->pack(-anchor => 'w'); + -text => __($desc))->pack(-anchor => 'w'); } else { $b = $f2r->Radiobutton(-variable => \$selected, -value => $scheme, - -text => __($tlpobj->shortdesc))->pack(-anchor => 'w'); + -text => __($desc))->pack(-anchor => 'w'); } if ($selected eq $scheme) { $b->focus(); @@ -612,7 +619,21 @@ sub menu_select_standard_collections { -command => sub { deselect_collections(\%lvars, @collections_std) })->pack(-side => 'right', -padx => "2m", -pady => "2m"); $fd->pack(-expand => 'x', -padx => "2m", -pady => "2m"); my $okbutton = $fd->Button(-text => __("Ok"), - -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m"); + -command => sub { + # we call the update only if something has changed + my $changed = 0; + for my $k (keys %lvars) { + if ($vars{$k} ne $lvars{$k}) { + $changed = 1; + last; + } + } + if ($changed) { + %vars = %lvars; + callback_select_collection(); + } + $sw->destroy; + })->pack(-side => 'left', -padx => "2m", -pady => "2m"); my $cancelbutton = $fd->Button(-text => __("Cancel"), -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m"); $sw->bind('' => [ $okbutton, 'Invoke']); @@ -675,7 +696,21 @@ sub menu_select_lang_collections { -command => sub { deselect_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'left', -padx => "2m", -pady => "2m"); my $f2 = $sw->Frame; $f2->pack(-expand => 'x'); my $okbutton = $f2->Button(-text => __("Ok"), - -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m"); + -command => sub { + # we call the update only if something has changed + my $changed = 0; + for my $k (keys %lvars) { + if ($vars{$k} ne $lvars{$k}) { + $changed = 1; + last; + } + } + if ($changed) { + %vars = %lvars; + callback_select_collection(); + } + $sw->destroy; + })->pack(-side => 'left', -padx => "2m", -pady => "2m"); my $cancelbutton = $f2->Button(-text => __("Cancel"), -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m"); $sw->bind('' => [ $okbutton, 'Invoke']); @@ -861,6 +896,7 @@ sub callback_select_collection { # special case for collection-texworks: $editoryesno = ($vars{'collection-texworks'} ? __("Yes") : __("No")); calc_depends(); + select_scheme("scheme-custom"); update_numbers(); menu_update_texts(); } diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl index 924e31e38a7..bef9921b91e 100755 --- a/Master/tlpkg/installer/install-menu-text.pl +++ b/Master/tlpkg/installer/install-menu-text.pl @@ -345,6 +345,10 @@ sub collection_menu { } if (defined $command{"\u$answer"}) { + # if we play around with collections we also select custom-scheme + # but we do not switch back to originally afterwards, too complicated + # to be done + select_scheme("scheme-custom"); return $command{"\u$answer"}->(); } else { return $command{'self'}->(); @@ -439,6 +443,7 @@ sub language_menu { return $command{'self'}->(); } if (defined $command{"\u$answer"}) { + select_scheme("scheme-custom"); return $command{"\u$answer"}->(); } else { return $command{'self'}->(); -- cgit v1.2.3